Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
network:ha-clustering:Unstable
corosync
0001-add_upgrade_shell.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-add_upgrade_shell.patch of Package corosync
From baa48c90da852fcae26d4708d96eb430dcdea628 Mon Sep 17 00:00:00 2001 From: liangxin1300 <XLiang@suse.com> Date: Mon, 5 Jul 2021 10:01:06 +0800 Subject: [PATCH] add_upgrade_shell --- init/upgrade.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 init/upgrade.sh diff --git a/init/upgrade.sh b/init/upgrade.sh new file mode 100644 index 00000000..60cb6cba --- /dev/null +++ b/init/upgrade.sh @@ -0,0 +1,30 @@ +#!/bin/bash +CONFIG_FILE=/etc/corosync/corosync.conf +CONFIG_FILE_OLD=/etc/corosync/corosync.conf.old + +if [ -f $CONFIG_FILE ]; then + + grep -E "nodelist\s+{" $CONFIG_FILE &> /dev/null + if [ $? -ne 0 ];then + echo "ERROR: Invalid corosync.conf, missing nodelist section" > /dev/stderr + exit 1 + fi + + cp $CONFIG_FILE $CONFIG_FILE_OLD + grep "ring1_addr" $CONFIG_FILE &> /dev/null + if [ $? -eq 0 ];then + # two rings, remove rrp_mode, and change as knet + sed -i "/\(rrp_mode\|bindnetaddr\)/d" $CONFIG_FILE && \ + sed -i "s/transport:\ *.*/transport: knet/g" $CONFIG_FILE + else + # one ring, keep origin transport, need to remove sec realted options + sed -i "/\(secauth\|crypto_hash\|crypto_cipher\):/d" $CONFIG_FILE + fi + if [ $? -ne 0 ]; then + cp $CONFIG_FILE_OLD $CONFIG_FILE + rm -f $CONFIG_FILE_OLD + else + echo "corosync.conf changed, origin is in $CONFIG_FILE_OLD" + diff $CONFIG_FILE $CONFIG_FILE_OLD + fi +fi -- 2.21.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor