4 # description: Starts and stops the Samba smbd daemon \
5 # used to provide SMB network services.
7 # pidfile: /var/run/samba4/smbd.pid
8 # config: /etc/samba4/smb.conf
12 # Source function library.
13 if [ -f /etc
/init.d
/functions
] ; then
14 .
/etc
/init.d
/functions
15 elif [ -f /etc
/rc.d
/init.d
/functions
] ; then
16 .
/etc
/rc.d
/init.d
/functions
21 # Avoid using root's TMPDIR
24 # Source networking configuration.
25 .
/etc
/sysconfig
/network
27 if [ -f /etc
/sysconfig
/$SAMBA_NAME ]; then
28 .
/etc
/sysconfig
/$SAMBA_NAME
31 # Check that networking is up.
32 [ ${NETWORKING} = "no" ] && exit 1
34 # Check that smb.conf exists.
35 [ -f /etc
/$SAMBA_NAME/smb.conf
] ||
exit 6
41 echo -n $
"Starting Samba services: "
42 daemon smbd
$SMBDOPTIONS
45 [ $RETVAL -eq 0 ] && touch /var
/lock
/subsys
/$SAMBA_NAME || \
51 echo -n $
"Shutting down Samba services: "
55 [ $RETVAL -eq 0 ] && rm -f /var
/lock
/subsys
/$SAMBA_NAME
65 echo -n $
"Reloading smb.conf file: "
78 # Allow status as non-root.
79 if [ "$1" = status
]; then
84 # Check that we can write to it... so non-root users stop here
85 [ -w /etc
/$SAMBA_NAME/smb.conf
] ||
exit 4
106 [ -f /var
/lock
/subsys
/$SAMBA_NAME ] && restart ||
:
109 echo $
"Usage: $0 {start|stop|restart|reload|status|condrestart}"