summaryrefslogtreecommitdiff
path: root/packaging/Caldera/OpenLinux/samba.init
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/Caldera/OpenLinux/samba.init')
-rwxr-xr-xpackaging/Caldera/OpenLinux/samba.init66
1 files changed, 66 insertions, 0 deletions
diff --git a/packaging/Caldera/OpenLinux/samba.init b/packaging/Caldera/OpenLinux/samba.init
new file mode 100755
index 0000000000..37955e1555
--- /dev/null
+++ b/packaging/Caldera/OpenLinux/samba.init
@@ -0,0 +1,66 @@
+#!/bin/sh
+#
+# description: Starts and stops the Samba smbd and nmbd daemons
+# used to provide SMB network services.
+
+NAME_S=smbd
+DAEMON_S=/usr/sbin/$NAME_S
+NAME_N=nmbd
+DAEMON_N=/usr/sbin/$NAME_N
+NAME_W=winbindd
+DAEMON_W=/usr/sbin/winbindd
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# Source networking configuration.
+. /etc/sysconfig/network
+
+# See how we were called.
+case "$1" in
+ start)
+ [ -e $SVIlock ] && exit 1
+ [ ${NETWORKING} = "no" ] && exit 2
+ [ -x $DAEMON_S -a -x $DAEMON_N ] || exit 2
+
+ #[ "$CONFIGURED" != "no" -a "$CONFIGURED" != "false" ] || {
+ SVIemptyConfig /etc/samba.d/smb.conf && {
+ echo "$DESCRIPTIVE: not configured! Skipped..."
+ exit 2
+ }
+
+ echo -n "Starting $IDENT: "
+ ssd -S -n $NAME_S -x $DAEMON_S -- $OPTIONS_SMB
+ ssd -S -n $NAME_N -x $DAEMON_N -- $OPTIONS_NMB
+ ssd -S -n $NAME_W -x $DAEMON_W -- $OPTIONS_WINBD
+
+ echo "."
+ touch $SVIlock
+ ;;
+
+ stop)
+ [ -e $SVIlock ] || exit 0
+
+ echo -n "Stopping $IDENT: "
+ ssd -K -p /var/lock/samba.d/$NAME_W.pid -n $NAME_W #-x $DAEMON_W
+ ssd -K -p /var/lock/samba.d/$NAME_N.pid -n $NAME_N #-x $DAEMON_N
+ ssd -K -p /var/lock/samba.d/$NAME_S.pid -n $NAME_S #-x $DAEMON_S
+
+ echo "."
+ rm -f $SVIlock
+ ;;
+
+ restart)
+ echo -n "Restarting $IDENT: "
+ $0 stop
+ $0 start
+ exit $?
+ ;;
+
+ *)
+ echo "Usage: $SVIscript {start|restart|stop}"
+ exit 1
+ ;;
+esac
+
+exit 0