diff options
author | Jeremy Allison <jra@samba.org> | 2001-07-03 01:01:12 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-07-03 01:01:12 +0000 |
commit | eae35e8f00ad6d83afac6b06e0f83500e4633391 (patch) | |
tree | cad9544c7511fa6212ae722969fd3627ea31ce91 /packaging/LSB/samba.sh | |
parent | 9b70d328cbe3a48cde2821db4293ee6a974ac86d (diff) | |
download | samba-eae35e8f00ad6d83afac6b06e0f83500e4633391.tar.gz samba-eae35e8f00ad6d83afac6b06e0f83500e4633391.tar.bz2 samba-eae35e8f00ad6d83afac6b06e0f83500e4633391.zip |
Adding Michael Sweet's LSB packaging.
Jeremy.
(This used to be commit 90985da62f733bed550ef326359bdbb8631ea554)
Diffstat (limited to 'packaging/LSB/samba.sh')
-rwxr-xr-x | packaging/LSB/samba.sh | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/packaging/LSB/samba.sh b/packaging/LSB/samba.sh new file mode 100755 index 0000000000..99fa1b0117 --- /dev/null +++ b/packaging/LSB/samba.sh @@ -0,0 +1,80 @@ +#!/bin/sh +# +# "$Id: samba.sh,v 1.2 2001/07/03 01:01:12 jra Exp $" +# +# SAMBA startup (init) script for LSB-compliant systems. +# +# Provides: smbd nmbd +# Required-Start: 3 5 +# Required-Stop: 0 2 1 6 +# Default-Start: 3 5 +# Default-Stop: 0 2 1 6 +# Description: Starts and stops the SAMBA smbd and nmbd daemons \ +# used to provide SMB network services. +# + +# Source LSB function library. +. /lib/lsb/init-functions + +# Check that smb.conf exists. +if test ! -f /etc/samba/smb.conf; then + log_failure_msg "The smb.conf file does not exist." + exit 6 +fi + +# Make sure that smbd and nmbd exist... +if test ! -f /usr/sbin/nmbd -o ! -f /usr/sbin/smbd; then + log_failure_msg "The nmbd and/or smbd daemons are not installed." + exit 5 +fi + +# See how we were called. +case "$1" in + start) + start_daemon nmbd -D + start_daemon smbd -D + log_success_msg "Started SMB services." + ;; + + stop) + killproc smbd + killproc nmbd + log_success_msg "Shutdown SMB services." + ;; + + reload) + # smbd and nmbd automatically re-read the smb.conf file... + log_success_msg "Reload not necessary with SAMBA." + ;; + + status) + if test -z "`pidofproc smbd`"; then + log_success_msg "smbd is not running." + else + log_success_msg "smbd is running." + fi + if test -z "`pidofproc nmbd`"; then + log_success_msg "nmbd is not running." + else + log_success_msg "nmbd is running." + fi + ;; + + + restart | force-reload) + $0 stop + $0 start + ;; + + *) + echo "Usage: smb {start|stop|reload|force-reload|restart|status}" + exit 1 + ;; +esac + +# Return "success" +exit 0 + +# +# End of "$Id: samba.sh,v 1.2 2001/07/03 01:01:12 jra Exp $". +# |