f6c58902ac
-force some performance enhancing autoconf options -run 'installscripts' so findsmb and smbtar are installed -samba binaires were segfaulting with uclibc 0.9.29 when not using: samba_cv_fpie=no. Force it. Config.in: -create configure options for findsmb and smbtar S91smb: -create dir (/var/lock/subsys) that is referenced later in script
81 lines
1.1 KiB
Bash
Executable File
81 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Stolen from RedHat FC5.
|
|
#
|
|
|
|
# Check that smb.conf exists.
|
|
[ -f /etc/samba/smb.conf ] || exit 0
|
|
|
|
# Make directories.
|
|
mkdir -p /var/cache/samba
|
|
mkdir -p /var/log/samba
|
|
mkdir -p /var/lock/subsys
|
|
|
|
RETVAL=0
|
|
|
|
start() {
|
|
echo -n "Starting SMB services: "
|
|
smbd -D
|
|
RETVAL=$?
|
|
echo "done"
|
|
|
|
echo -n "Starting NMB services: "
|
|
nmbd -D
|
|
RETVAL2=$?
|
|
echo "done"
|
|
|
|
[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && touch /var/lock/subsys/smb || \
|
|
RETVAL=1
|
|
return $RETVAL
|
|
}
|
|
|
|
stop() {
|
|
echo -n "Shutting down SMB services: "
|
|
kill -9 `pidof smbd`
|
|
RETVAL=$?
|
|
rm -f /var/run/smbd.pid
|
|
echo "done"
|
|
|
|
echo -n "Shutting down NMB services: "
|
|
kill -9 `pidof nmbd`
|
|
RETVAL2=$?
|
|
rm -f /var/run/nmbd.pid
|
|
|
|
[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /var/lock/subsys/smb
|
|
echo "done"
|
|
return $RETVAL
|
|
}
|
|
|
|
restart() {
|
|
stop
|
|
start
|
|
}
|
|
|
|
reload() {
|
|
echo -n "Reloading smb.conf file: "
|
|
kill -HUP `pidof smbd`
|
|
RETVAL=$?
|
|
echo "done"
|
|
return $RETVAL
|
|
}
|
|
|
|
case "$1" in
|
|
start)
|
|
start
|
|
;;
|
|
stop)
|
|
stop
|
|
;;
|
|
restart)
|
|
restart
|
|
;;
|
|
reload)
|
|
reload
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart|reload}"
|
|
exit 1
|
|
esac
|
|
|
|
exit $?
|