aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-02-09 10:47:14 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-02-09 10:47:14 +0000
commitbeaab801590c3bc0461f08c63432e0c3d3e2509b (patch)
tree1fc057dbbb0a66f3abdb307afa8dd6788105923e
parent5684ecf8c199f23c66a22497d0c327eb04c8f0af (diff)
downloadrpm-helper-beaab801590c3bc0461f08c63432e0c3d3e2509b.tar
rpm-helper-beaab801590c3bc0461f08c63432e0c3d3e2509b.tar.gz
rpm-helper-beaab801590c3bc0461f08c63432e0c3d3e2509b.tar.bz2
rpm-helper-beaab801590c3bc0461f08c63432e0c3d3e2509b.tar.xz
rpm-helper-beaab801590c3bc0461f08c63432e0c3d3e2509b.zip
Patch by Ian D. Allen to handle rare case when a service name appears several
times in rc3.d (bug 12856)
-rwxr-xr-xadd-service8
1 files changed, 6 insertions, 2 deletions
diff --git a/add-service b/add-service
index 94cc21d..2fc6bc5 100755
--- a/add-service
+++ b/add-service
@@ -71,10 +71,14 @@ else
# 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
+ set -- /etc/rc3.d/S??$srv
+ if [ $# -gt 1 ]; then
+ echo 1>&2 "add-service: Error: $srv appears multiple times: $*"
+ fi
+ if [ -f "$1" ]; then
/sbin/chkconfig --add $srv
fi
-
+
# restart the service if already running
if [ -f /var/lock/subsys/$srv ]; then
/sbin/service $srv restart > /dev/null 2>/dev/null || :