From beaab801590c3bc0461f08c63432e0c3d3e2509b Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Thu, 9 Feb 2006 10:47:14 +0000 Subject: Patch by Ian D. Allen to handle rare case when a service name appears several times in rc3.d (bug 12856) --- add-service | 8 ++++++-- 1 file 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 || : -- cgit v1.2.1