From 431059e10dd38677010facaaf3e0c4fc504c9351 Mon Sep 17 00:00:00 2001 From: Frederic Lepied Date: Thu, 23 Sep 2004 01:02:57 +0000 Subject: add the service again on upgrade if the service is activated --- add-service | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'add-service') diff --git a/add-service b/add-service index 8901ef0..cbf938c 100755 --- a/add-service +++ b/add-service @@ -19,8 +19,8 @@ pkg=$1 # name of the package num=$2 # number of packages installed srv=$3 # name of the service -if [ $num = 1 ]; then - # Install mode: add the services +add_service() { + # Add the service if [ -r /etc/sysconfig/msec ]; then . /etc/sysconfig/msec fi @@ -50,8 +50,21 @@ if [ $num = 1 ]; then # Low security: install all the services /sbin/chkconfig --add $srv fi +} + +if [ $num = 1 ]; then + # First install mode + add_service else - # Upgrade mode: restart the service if already running + # Upgrade mode + + # if the service is activated, add it again to be able to handle + # changes in start/stop levels + if [ -f /etc/rc3.d/S??$srv ]; then + add_service + fi + + # restart the service if already running if [ -f /var/lock/subsys/$srv ]; then /sbin/service $srv restart > /dev/null 2>/dev/null || : # restart services that depend of portmap -- cgit v1.2.1