]>
Commit | Line | Data |
---|---|---|
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 | chmod 750 "${lockdir}" | |
13 | chgrp wbpriv "${lockdir}" | |
14 | ||
15 | mkdir -p /var/run/samba/{nmbd,ncalrpc,winbindd} | |
16 | } | |
17 | ||
18 | case "$1" in | |
19 | start) | |
20 | fix_permissions | |
21 | ||
22 | boot_mesg "Starting nmbd..." | |
23 | loadproc /usr/sbin/nmbd -D | |
24 | ||
25 | boot_mesg "Starting smbd..." | |
26 | loadproc /usr/sbin/smbd -D | |
27 | ||
28 | boot_mesg "Starting winbind..." | |
29 | loadproc /usr/sbin/winbindd | |
30 | ;; | |
31 | ||
32 | stop) | |
33 | boot_mesg "Stopping smbd..." | |
34 | killproc /usr/sbin/smbd | |
35 | ||
36 | boot_mesg "Stopping nmbd..." | |
37 | killproc /usr/sbin/nmbd | |
38 | ||
39 | boot_mesg "Stopping winbind..." | |
40 | killproc /usr/sbin/winbindd | |
41 | ;; | |
42 | ||
43 | reload) | |
44 | boot_mesg "Reloading smbd..." | |
45 | reloadproc /usr/sbin/smbd | |
46 | ||
47 | boot_mesg "Reloading nmbd..." | |
48 | reloadproc /usr/sbin/nmbd | |
49 | ||
50 | boot_mesg "Reloading winbind..." | |
51 | reloadproc /usr/sbin/winbindd | |
52 | ;; | |
53 | ||
54 | restart) | |
55 | $0 stop | |
56 | sleep 3 | |
57 | $0 start | |
58 | ;; | |
59 | ||
60 | status) | |
61 | statusproc /usr/sbin/nmbd | |
62 | statusproc /usr/sbin/smbd | |
63 | statusproc /usr/sbin/winbindd | |
64 | ;; | |
65 | ||
66 | *) | |
67 | echo "Usage: $0 {start|stop|reload|restart|status}" | |
68 | exit 1 | |
69 | ;; | |
70 | esac | |
71 | ||
72 | # End $rc_base/init.d/samba |