summaryrefslogtreecommitdiffstats
path: root/main/samba/samba.initd
diff options
context:
space:
mode:
Diffstat (limited to 'main/samba/samba.initd')
-rw-r--r--main/samba/samba.initd64
1 files changed, 64 insertions, 0 deletions
diff --git a/main/samba/samba.initd b/main/samba/samba.initd
new file mode 100644
index 000000000..d2d395a98
--- /dev/null
+++ b/main/samba/samba.initd
@@ -0,0 +1,64 @@
+#!/sbin/runscript
+
+opts="reload"
+
+DAEMON=${SVCNAME#samba.}
+if [ "$DAEMON" != "samba" ]; then
+ daemon_list=$DAEMON
+fi
+
+depend() {
+ need net
+}
+
+start_smbd() {
+ start-stop-daemon --start --quiet --exec /usr/sbin/smbd -- \
+ ${smbd_options:-"-D"}
+}
+
+stop_smbd() {
+ start-stop-daemon --stop --quiet --pidfile /var/run/samba/smbd.pid
+}
+
+start_nmbd() {
+ start-stop-daemon --start --quiet --exec /usr/sbin/nmbd -- \
+ ${nmbd_options:-"-D"}
+}
+
+stop_nmbd() {
+ start-stop-daemon --stop --quiet --pidfile /var/run/samba/nmbd.pid
+}
+
+start_winbindd() {
+ start-stop-daemon --start --quiet --exec /usr/sbin/winbindd -- \
+ $winbindd_options
+}
+
+stop_winbindd() {
+ start-stop-daemon --stop --quiet --pidfile /var/run/samba/winbindd.pid
+}
+
+start() {
+ for i in $daemon_list; do
+ ebegin "Starting $i"
+ start_$i
+ eend $?
+ done
+}
+
+stop() {
+ for i in $daemon_list; do
+ ebegin "Stopping $i"
+ stop_$i
+ eend $?
+ done
+}
+
+reload() {
+ for i in $daemon_list; do
+ ebegin "Reloading $i"
+ killall -HUP $i
+ eend $?
+ done
+}
+