summaryrefslogtreecommitdiffstats
path: root/patches/source/samba/rc.samba
diff options
context:
space:
mode:
Diffstat (limited to 'patches/source/samba/rc.samba')
-rw-r--r--patches/source/samba/rc.samba46
1 files changed, 46 insertions, 0 deletions
diff --git a/patches/source/samba/rc.samba b/patches/source/samba/rc.samba
new file mode 100644
index 00000000..7fd2b61b
--- /dev/null
+++ b/patches/source/samba/rc.samba
@@ -0,0 +1,46 @@
+#!/bin/sh
+#
+# /etc/rc.d/rc.samba
+#
+# Start/stop/restart the Samba SMB file/print server.
+#
+# To make Samba start automatically at boot, make this
+# file executable: chmod 755 /etc/rc.d/rc.samba
+#
+
+samba_start() {
+ if [ -x /usr/sbin/smbd -a -x /usr/sbin/nmbd -a -r /etc/samba/smb.conf ]; then
+ mkdir -p /var/run/samba
+ echo "Starting Samba: /usr/sbin/smbd -D"
+ /usr/sbin/smbd -D
+ echo " /usr/sbin/nmbd -D"
+ /usr/sbin/nmbd -D
+ fi
+}
+
+samba_stop() {
+ killall smbd nmbd
+}
+
+samba_restart() {
+ samba_stop
+ sleep 2
+ samba_start
+}
+
+case "$1" in
+'start')
+ samba_start
+ ;;
+'stop')
+ samba_stop
+ ;;
+'restart')
+ samba_restart
+ ;;
+*)
+ # Default is "start", for backwards compatibility with previous
+ # Slackware versions. This may change to a 'usage' error someday.
+ samba_start
+esac
+