keepalived/keepalive-init.patch

72 lines
2.5 KiB
Diff
Raw Normal View History

Index: keepalived-2.0.7/keepalived/etc/init.d/keepalived.suse.init.in
===================================================================
--- keepalived-2.0.7.orig/keepalived/etc/init.d/keepalived.suse.init.in
+++ keepalived-2.0.7/keepalived/etc/init.d/keepalived.suse.init.in
@@ -1,23 +1,24 @@
#! /bin/sh
Accepting request 563827 from home:lrupp:branches:network - update to 1.4.0 * Add Linux build and runtime versions to -v output. * Log kernel version and build kernel version to log at startup. * Don't sleep for 1 send when exiting vrrp process if no vrrp instances. * With large configurations the syslog can get flooded and drop output. This commit adds options to not log to syslog, and also to log all output to files. * Add option to only flush log files before forking. * Don't poll netlink for all interfaces each time add a VMAC. We can poll for the individual interface details which significantly reduces what we have to process. * Print interface details in keepalived.data output. * Add high performace child finder code. The code to find the relevant thread to execute afer a child process (either a vrrp track script or a misc_check healthchecker) was doing a linear search for the matching pid, which if there are a large number of child processes running could become time consuming. The code now will enable high performance child finding, based on using mlists hashed by the pid, if there are 32 or more vrrp track scripts or misc check healthcheckers. The size of the mlist is based on the number of scripts, with a limit of 256. * Improve high performance child termination timeout code. * Preserve filename in script path name resolution. Some executables change their behaviour depending on the name by which they are invoked (e.g. /usr/sbin/pidof when it is a link to /usr/sbin/killall5). Using realpath() changes the file name part if it is a symbolic link. This commit resolves all symbolic links to directories, but leaves the file name part unaltered. It then checks the security of both the path to the link and the path to the real file. OBS-URL: https://build.opensuse.org/request/show/563827 OBS-URL: https://build.opensuse.org/package/show/network/keepalived?expand=0&rev=38
2018-01-15 16:17:04 +01:00
### BEGIN INIT INFO
-# Provides: keepalived
+# Provides: keepalived
# Required-Start: $remote_fs $syslog
-# Required-Stop : $remote_fs $syslog
-# Default-Start : 3 5
-# Default-Stop : 0 1 2 6
-# Description : Start keepalived to allow XY and provide YZ
-# continued on second line by '#<TAB>'
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Short-Description: Start keepalived to manage IPVS & LVS
+# Description: Start keepalived to manage IPVS & LVS
### END INIT INFO
Accepting request 563827 from home:lrupp:branches:network - update to 1.4.0 * Add Linux build and runtime versions to -v output. * Log kernel version and build kernel version to log at startup. * Don't sleep for 1 send when exiting vrrp process if no vrrp instances. * With large configurations the syslog can get flooded and drop output. This commit adds options to not log to syslog, and also to log all output to files. * Add option to only flush log files before forking. * Don't poll netlink for all interfaces each time add a VMAC. We can poll for the individual interface details which significantly reduces what we have to process. * Print interface details in keepalived.data output. * Add high performace child finder code. The code to find the relevant thread to execute afer a child process (either a vrrp track script or a misc_check healthchecker) was doing a linear search for the matching pid, which if there are a large number of child processes running could become time consuming. The code now will enable high performance child finding, based on using mlists hashed by the pid, if there are 32 or more vrrp track scripts or misc check healthcheckers. The size of the mlist is based on the number of scripts, with a limit of 256. * Improve high performance child termination timeout code. * Preserve filename in script path name resolution. Some executables change their behaviour depending on the name by which they are invoked (e.g. /usr/sbin/pidof when it is a link to /usr/sbin/killall5). Using realpath() changes the file name part if it is a symbolic link. This commit resolves all symbolic links to directories, but leaves the file name part unaltered. It then checks the security of both the path to the link and the path to the real file. OBS-URL: https://build.opensuse.org/request/show/563827 OBS-URL: https://build.opensuse.org/package/show/network/keepalived?expand=0&rev=38
2018-01-15 16:17:04 +01:00
-DAEMON="Keepalived daemon"
-DAEMON_BIN="@sbindir@/keepalived"
-DAEMON_CONF="@sysconfdir@/keepalived/keepalived.conf"
-DAEMON_PIDFILE="@localstatedir@/run/keepalived.pid"
-DAEMON_OPT="-d"
+DAEMON='Keepalived daemon'
+DAEMON_BIN='@sbindir@/keepalived'
+DAEMON_CONF='@sysconfdir@/keepalived/keepalived.conf'
+DAEMON_PIDFILE='@localstatedir@/run/keepalived.pid'
+DAEMON_SYSCONF='/etc/sysconfig/keepalived'
+DAEMON_OPT='-d'
#DAEMON_USER="root"
-SUPPORTS_HUP="yes"
+SUPPORTS_HUP='yes'
# PidFile @localstatedir@/run/keepalived.pid
# DatabaseOwner root
Accepting request 563827 from home:lrupp:branches:network - update to 1.4.0 * Add Linux build and runtime versions to -v output. * Log kernel version and build kernel version to log at startup. * Don't sleep for 1 send when exiting vrrp process if no vrrp instances. * With large configurations the syslog can get flooded and drop output. This commit adds options to not log to syslog, and also to log all output to files. * Add option to only flush log files before forking. * Don't poll netlink for all interfaces each time add a VMAC. We can poll for the individual interface details which significantly reduces what we have to process. * Print interface details in keepalived.data output. * Add high performace child finder code. The code to find the relevant thread to execute afer a child process (either a vrrp track script or a misc_check healthchecker) was doing a linear search for the matching pid, which if there are a large number of child processes running could become time consuming. The code now will enable high performance child finding, based on using mlists hashed by the pid, if there are 32 or more vrrp track scripts or misc check healthcheckers. The size of the mlist is based on the number of scripts, with a limit of 256. * Improve high performance child termination timeout code. * Preserve filename in script path name resolution. Some executables change their behaviour depending on the name by which they are invoked (e.g. /usr/sbin/pidof when it is a link to /usr/sbin/killall5). Using realpath() changes the file name part if it is a symbolic link. This commit resolves all symbolic links to directories, but leaves the file name part unaltered. It then checks the security of both the path to the link and the path to the real file. OBS-URL: https://build.opensuse.org/request/show/563827 OBS-URL: https://build.opensuse.org/package/show/network/keepalived?expand=0&rev=38
2018-01-15 16:17:04 +01:00
@@ -25,6 +26,18 @@ pid_par=${DAEMON_PIDFILE:+"-p $DAEMON_PI
usr_par=${DAEMON_USER:+"-u $DAEMON_USER"}
Accepting request 563827 from home:lrupp:branches:network - update to 1.4.0 * Add Linux build and runtime versions to -v output. * Log kernel version and build kernel version to log at startup. * Don't sleep for 1 send when exiting vrrp process if no vrrp instances. * With large configurations the syslog can get flooded and drop output. This commit adds options to not log to syslog, and also to log all output to files. * Add option to only flush log files before forking. * Don't poll netlink for all interfaces each time add a VMAC. We can poll for the individual interface details which significantly reduces what we have to process. * Print interface details in keepalived.data output. * Add high performace child finder code. The code to find the relevant thread to execute afer a child process (either a vrrp track script or a misc_check healthchecker) was doing a linear search for the matching pid, which if there are a large number of child processes running could become time consuming. The code now will enable high performance child finding, based on using mlists hashed by the pid, if there are 32 or more vrrp track scripts or misc check healthcheckers. The size of the mlist is based on the number of scripts, with a limit of 256. * Improve high performance child termination timeout code. * Preserve filename in script path name resolution. Some executables change their behaviour depending on the name by which they are invoked (e.g. /usr/sbin/pidof when it is a link to /usr/sbin/killall5). Using realpath() changes the file name part if it is a symbolic link. This commit resolves all symbolic links to directories, but leaves the file name part unaltered. It then checks the security of both the path to the link and the path to the real file. OBS-URL: https://build.opensuse.org/request/show/563827 OBS-URL: https://build.opensuse.org/package/show/network/keepalived?expand=0&rev=38
2018-01-15 16:17:04 +01:00
test -x $DAEMON_BIN || exit 5
+test -x $DAEMON_BIN || { echo "$DAEMON_BIN not installed or executable";
+ if [ "$1" = "stop" ]; then exit 0;
+ else exit 5; fi; }
+
+test -r $DAEMON_CONF || { echo "$DAEMON_CONF not existing or readable";
+ if [ "$1" = "stop" ]; then exit 0;
+ else exit 6; fi; }
+
+# read sysconfig variables that might overwrite the daemon options
+if [ -r "$DAEMON_SYSCONF" ]; then
+ . "$DAEMON_SYSCONF"
+fi
Accepting request 563827 from home:lrupp:branches:network - update to 1.4.0 * Add Linux build and runtime versions to -v output. * Log kernel version and build kernel version to log at startup. * Don't sleep for 1 send when exiting vrrp process if no vrrp instances. * With large configurations the syslog can get flooded and drop output. This commit adds options to not log to syslog, and also to log all output to files. * Add option to only flush log files before forking. * Don't poll netlink for all interfaces each time add a VMAC. We can poll for the individual interface details which significantly reduces what we have to process. * Print interface details in keepalived.data output. * Add high performace child finder code. The code to find the relevant thread to execute afer a child process (either a vrrp track script or a misc_check healthchecker) was doing a linear search for the matching pid, which if there are a large number of child processes running could become time consuming. The code now will enable high performance child finding, based on using mlists hashed by the pid, if there are 32 or more vrrp track scripts or misc check healthcheckers. The size of the mlist is based on the number of scripts, with a limit of 256. * Improve high performance child termination timeout code. * Preserve filename in script path name resolution. Some executables change their behaviour depending on the name by which they are invoked (e.g. /usr/sbin/pidof when it is a link to /usr/sbin/killall5). Using realpath() changes the file name part if it is a symbolic link. This commit resolves all symbolic links to directories, but leaves the file name part unaltered. It then checks the security of both the path to the link and the path to the real file. OBS-URL: https://build.opensuse.org/request/show/563827 OBS-URL: https://build.opensuse.org/package/show/network/keepalived?expand=0&rev=38
2018-01-15 16:17:04 +01:00
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
@@ -72,8 +85,8 @@ case "$1" in
0) echo -n "- Warning: daemon already running. " ;;
1) echo -n "- Warning: ${DAEMON_PIDFILE} exists. " ;;
esac
-# echo "startproc $usr_par $pid_par ${DAEMON_BIN} ${DAEMON_OPT}"
- startproc $usr_par $pid_par ${DAEMON_BIN} ${DAEMON_OPT}
+# echo "startproc $usr_par $pid_par ${DAEMON_BIN} ${DAEMON_OPT} ${KEEPALIVED_OPTIONS}"
+ startproc $usr_par $pid_par ${DAEMON_BIN} ${DAEMON_OPT} ${KEEPALIVED_OPTIONS}
rc_status -v
;;
stop)