aboutsummaryrefslogtreecommitdiffstats
path: root/add-service
diff options
context:
space:
mode:
Diffstat (limited to 'add-service')
-rwxr-xr-xadd-service19
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