]> git.ipfire.org Git - ipfire-2.x.git/blob - src/initscripts/init.d/samba
samba: Merge winbind initscript into samba initscript.
[ipfire-2.x.git] / src / initscripts / init.d / samba
1 #!/bin/sh
2 # Begin $rc_base/init.d/samba
3
4 # Based on sysklogd script from LFS-3.1 and earlier.
5 # Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
6
7 . /etc/sysconfig/rc
8 . $rc_functions
9
10 case "$1" in
11 start)
12 boot_mesg "Starting nmbd..."
13 loadproc /usr/sbin/nmbd -D
14
15 boot_mesg "Starting smbd..."
16 loadproc /usr/sbin/smbd -D
17
18 boot_mesg "Starting winbind..."
19 loadproc /usr/sbin/winbindd
20 ;;
21
22 stop)
23 boot_mesg "Stopping smbd..."
24 killproc -p /var/run/smbd.pid /usr/sbin/smbd
25
26 boot_mesg "Stopping nmbd..."
27 killproc -p /var/run/nmbd.pid /usr/sbin/nmbd
28
29 boot_mesg "Stopping winbind..."
30 killproc -p /var/run/winbindd.pid /usr/sbin/winbindd
31 ;;
32
33 reload)
34 boot_mesg "Reloading smbd..."
35 reloadproc /usr/sbin/smbd
36
37 boot_mesg "Reloading nmbd..."
38 reloadproc /usr/sbin/nmbd
39
40 boot_mesg "Reloading winbind..."
41 reloadproc /usr/sbin/winbindd
42 ;;
43
44 restart)
45 $0 stop
46 sleep 3
47 $0 start
48 ;;
49
50 status)
51 statusproc /usr/sbin/nmbd
52 statusproc /usr/sbin/smbd
53 statusproc /usr/sbin/winbindd
54 ;;
55
56 *)
57 echo "Usage: $0 {start|stop|reload|restart|status}"
58 exit 1
59 ;;
60 esac
61
62 # End $rc_base/init.d/samba