r8366: Root-level files don't have a slash, but acls need to be settable on
[samba.git] / packaging / sysv / samba.init
1 #!/bin/sh
2 #
3 # Copyright (c) Timo Knuutila <knuutila@cs.utu.fi>     1996.
4 #
5 # This file should have uid root, gid sys and chmod 744
6 #
7 if [ ! -d /usr/bin ]
8 then                    # /usr not mounted
9         exit
10 fi
11
12 killproc() {            # kill the named process(es)
13         pid=`/usr/bin/ps -e |
14              /usr/bin/grep -w $1 |
15              /usr/bin/sed -e 's/^  *//' -e 's/ .*//'`
16         [ "$pid" != "" ] && kill $pid
17 }
18
19 # Start/stop processes required for samba server
20
21 case "$1" in
22
23 'start')
24 #
25 # Edit these lines to suit your installation (paths, workgroup, host)
26 #
27    /opt/samba/bin/smbd -D -s/opt/samba/smb.conf
28    /opt/samba/bin/nmbd -D -l/opt/samba/log -s/opt/samba/smb.conf
29    ;;
30 'stop')
31    killproc nmbd
32    killproc smbd
33    ;;
34 *)
35    echo "Usage: /etc/init.d/samba.server { start | stop }"
36    ;;
37 esac