summaryrefslogtreecommitdiff
path: root/packaging/SGI
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-03-16 19:43:04 +0000
committerGerald Carter <jerry@samba.org>2004-03-16 19:43:04 +0000
commit0e7efbe37114ea82ad36dec27765f9f82d32f461 (patch)
treeae49bf3141a53ea659b7592f2ccb0027472d2495 /packaging/SGI
parent9073c95b97386ad2a3d1f90bc41b735f4a53ed3d (diff)
downloadsamba-0e7efbe37114ea82ad36dec27765f9f82d32f461.tar.gz
samba-0e7efbe37114ea82ad36dec27765f9f82d32f461.tar.bz2
samba-0e7efbe37114ea82ad36dec27765f9f82d32f461.zip
BUG 768 - patch from jpeach@sgi.com (James Peach); accept profileing arg to init script
(This used to be commit a04573aeb0a137feb4be48b74627536e1f0d40b1)
Diffstat (limited to 'packaging/SGI')
-rw-r--r--packaging/SGI/samba.rc32
1 files changed, 28 insertions, 4 deletions
diff --git a/packaging/SGI/samba.rc b/packaging/SGI/samba.rc
index bc0f90ee77..23a9a30d6f 100644
--- a/packaging/SGI/samba.rc
+++ b/packaging/SGI/samba.rc
@@ -8,10 +8,14 @@ IS_ON=/etc/chkconfig
KILLALL=/sbin/killall
SAMBAD=/usr/samba/bin/smbd
+PROFILE_SAMBAD=/usr/samba/bin/smbd.profile
#SAMBA_OPTS=-d2
NMBD=/usr/samba/bin/nmbd
+PROFILE_NMBD=/usr/samba/bin/nmbd.profile
#NMBD_OPTS=-d1
+SMBCONTROL=/usr/samba/bin/smbcontrol
+
if test ! -x $IS_ON ; then
IS_ON=true
fi
@@ -22,22 +26,42 @@ else # For a quiet startup and shutdown
ECHO=:
fi
+if $IS_ON sambaprofiling ; then
+ enable_profiling=yes
+fi
+
+if test "$enable_profiling" -o "$1" = "profile" ; then
+ SAMBAD=$PROFILE_SAMBAD
+ NMBD=$PROFILE_NMBD
+ enable_profiling="yes"
+fi
+
case $1 in
-'start')
+start|profile)
if $IS_ON samba && test -x $SAMBAD; then
- $KILLALL -15 smbd nmbd
+ /etc/init.d/samba stop
$ECHO "Samba:\c"
$SAMBAD $SAMBA_OPTS -D; $ECHO " smbd\c"
$NMBD $NMBD_OPTS -D; $ECHO " nmbd\c"
$ECHO "."
fi
+ if $IS_ON samba && test "$enable_profiling" ; then
+ if test -x $SMBCONTROL; then
+ $ECHO "Enabling Samba profiling."
+ $SMBCONTROL smbd profile on > /dev/null 2>&1
+ $SMBCONTROL nmbd profile on > /dev/null 2>&1
+ fi
+ $KILLALL -HUP pmcd
+ fi
;;
-'stop')
+stop)
$ECHO "Stopping Samba Servers."
$KILLALL -15 smbd nmbd
+ $KILLALL -15 smbd.profile nmbd.profile
+ $KILLALL -15 pmdasamba
exit 0
;;
*)
- echo "usage: /etc/init.d/samba {start|stop}"
+ echo "usage: /etc/init.d/samba {start|stop|profile}"
;;
esac