6 # Required-Start: $network
7 # Required-Stop: $network
8 # Default-Start: 2 3 4 5
11 # Starts and stops the Samba smbd and nmbd daemons
12 # used to provide SMB network services.
15 # Written by Miquel van Smoorenburg <miquels@drinkel.ow.org>.
16 # Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
17 # Modified for OpenLinux by Raymund Will <ray@caldera.de>
18 # Adapted for samba by Klaus Singvogel <klaus@caldera.de>
21 DAEMON_S
=/usr
/sbin
/$NAME_S
23 DAEMON_N
=/usr
/sbin
/$NAME_N
25 # Source function library (and set vital variables).
29 [ -e $1 ] ||
return 3; # lock / pid file doesn't exist, seems to be stopped
32 state
=`egrep '^State' /proc/$i/status 2>/dev/null| sed 's#.* \(.\).*#\1#'`
33 if [ x
$state = x
-o x
$state = xZ
]; then
34 return 2 # no such process (or zombie) --> dead
36 return 0 # seems to be up and running
41 [ ! -e $SVIlock ] ||
exit 0
42 [ -x $DAEMON_S -a -x $DAEMON_N ] ||
exit 5
43 SVIemptyConfig
/etc
/samba.d
/smb.conf
&& exit 6
45 echo -n "Starting $SVIsubsys services: "
46 ssd
-S -n $NAME_S -x $DAEMON_S -- $OPTIONS_SMB
47 ssd
-S -n $NAME_N -x $DAEMON_N -- $OPTIONS_NMB
55 [ -e $SVIlock ] ||
exit 0
57 echo -n "Stopping $SVIsubsys services: "
58 ssd
-K -p /var
/lock
/samba.d
/$NAME_N.pid
-n $NAME_N #-x $DAEMON_N
59 ssd
-K -p /var
/lock
/samba.d
/$NAME_S.pid
-n $NAME_S #-x $DAEMON_S
68 [ -e $SVIlock ] ||
exit 0
74 echo -n "Reloading $SVIsubsys service configuration: "
75 # nmbd has no config file to reload
76 ssd
-K --signal 1 -p /var
/lock
/samba.d
/$NAME_S.pid
-n $NAME_S #-x $DAEMON_S
88 echo -n "Checking status of $SVIsubsys service: "
89 status
/var
/lock
/samba.d
/$NAME_N.pid
91 if [ $ret -eq 0 ]; then
93 status
/var
/lock
/samba.d
/$NAME_S.pid
95 [ $ret -eq 0 ] && echo -n "$NAME_S"
101 echo "Usage: $SVIscript {start|stop|restart|force-reload|reload|status}"