diff options
author | Frederic Lepied <flepied@mandriva.com> | 2004-09-23 01:02:57 +0000 |
---|---|---|
committer | Frederic Lepied <flepied@mandriva.com> | 2004-09-23 01:02:57 +0000 |
commit | 431059e10dd38677010facaaf3e0c4fc504c9351 (patch) | |
tree | f93d3aece602a7e949930ff6c6d4927713d7c6b9 /add-service | |
parent | 7c701fc99daf8250b363b013c63ed0aed14975c8 (diff) | |
download | rpm-helper-431059e10dd38677010facaaf3e0c4fc504c9351.tar rpm-helper-431059e10dd38677010facaaf3e0c4fc504c9351.tar.gz rpm-helper-431059e10dd38677010facaaf3e0c4fc504c9351.tar.bz2 rpm-helper-431059e10dd38677010facaaf3e0c4fc504c9351.tar.xz rpm-helper-431059e10dd38677010facaaf3e0c4fc504c9351.zip |
add the service again on upgrade if the service is activated
Diffstat (limited to 'add-service')
-rwxr-xr-x | add-service | 19 |
1 files changed, 16 insertions, 3 deletions
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 |