]> git.ipfire.org Git - ipfire-2.x.git/blob - src/initscripts/init.d/samba
Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next
[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 function fix_permissions() {
11 local lockdir="/var/lib/samba/winbindd_privileged"
12
13 chmod 750 "${lockdir}"
14 chgrp wbpriv "${lockdir}"
15 }
16
17 case "$1" in
18 start)
19 fix_permissions
20
21 boot_mesg "Starting nmbd..."
22 loadproc /usr/sbin/nmbd -D
23
24 boot_mesg "Starting smbd..."
25 loadproc /usr/sbin/smbd -D
26
27 boot_mesg "Starting winbind..."
28 loadproc /usr/sbin/winbindd
29 ;;
30
31 stop)
32 boot_mesg "Stopping smbd..."
33 killproc -p /var/run/smbd.pid /usr/sbin/smbd
34
35 boot_mesg "Stopping nmbd..."
36 killproc -p /var/run/nmbd.pid /usr/sbin/nmbd
37
38 boot_mesg "Stopping winbind..."
39 killproc -p /var/run/winbindd.pid /usr/sbin/winbindd
40 ;;
41
42 reload)
43 boot_mesg "Reloading smbd..."
44 reloadproc /usr/sbin/smbd
45
46 boot_mesg "Reloading nmbd..."
47 reloadproc /usr/sbin/nmbd
48
49 boot_mesg "Reloading winbind..."
50 reloadproc /usr/sbin/winbindd
51 ;;
52
53 restart)
54 $0 stop
55 sleep 3
56 $0 start
57 ;;
58
59 status)
60 statusproc /usr/sbin/nmbd
61 statusproc /usr/sbin/smbd
62 statusproc /usr/sbin/winbindd
63 ;;
64
65 *)
66 echo "Usage: $0 {start|stop|reload|restart|status}"
67 exit 1
68 ;;
69 esac
70
71 # End $rc_base/init.d/samba