1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

from Mathieu PARENT <math.parent@gmail.com>

Simulate "nice service" on systems that do not have "service"

(This used to be ctdb commit d0e6dcbadaf41745d423640e5ff5bafd9f68eb88)
This commit is contained in:
Ronnie Sahlberg 2008-02-13 08:20:20 +11:00
parent e3770e5f9d
commit 8da0e15a07
2 changed files with 14 additions and 1 deletions

View File

@ -66,7 +66,7 @@ case $cmd in
# start Samba service. Start it reniced, as under very heavy load
# the number of smbd processes will mean that it leaves few cycles for
# anything else
nice service smb start
nice_service smb start
;;
takeip)

View File

@ -28,6 +28,19 @@ service() {
fi
}
######################################################
# simulate /sbin/service (niced) on platforms that don't have it
nice_service() {
service_name="$1"
op="$2"
if [ -x /sbin/service ]; then
nice /sbin/service "$service_name" "$op"
elif [ -x /etc/init.d/$service_name ]; then
nice /etc/init.d/$service_name "$op"
elif [ -x /etc/rc.d/init.d/$service_name ]; then
nice /etc/rc.d/init.d/$service_name "$op"
fi
}
######################################################
# wait for a command to return a zero exit status