Juergen Daubert
d48a7ee35a
- Security fix for CVE-11103, see https://www.samba.org/samba/history/samba-4.6.6.html - fix building with multiple jobs, FS#1446 - reduced dependencies
50 lines
935 B
Bash
50 lines
935 B
Bash
#!/bin/sh
|
|
#
|
|
# /etc/rc.d/samba: start/stop samba daemons
|
|
#
|
|
|
|
SSD=/sbin/start-stop-daemon
|
|
SMB=/usr/sbin/smbd
|
|
NMB=/usr/sbin/nmbd
|
|
SMB_PID=/var/run/samba/smbd.pid
|
|
NMB_PID=/var/run/samba/nmbd.pid
|
|
|
|
|
|
print_status() {
|
|
$SSD --status --pidfile $2
|
|
case $? in
|
|
0) echo "$1 is running with pid $(cat $2)" ;;
|
|
1) echo "$1 is not running but the pid file $2 exists" ;;
|
|
3) echo "$1 is not running" ;;
|
|
4) echo "Unable to determine the program status" ;;
|
|
esac
|
|
}
|
|
|
|
case $1 in
|
|
start)
|
|
$SSD --start --pidfile $NMB_PID --exec $NMB -- -D
|
|
$SSD --start --pidfile $SMB_PID --exec $SMB -- -D
|
|
;;
|
|
stop)
|
|
$SSD --stop --retry 10 --pidfile $SMB_PID
|
|
$SSD --stop --retry 10 --pidfile $NMB_PID
|
|
;;
|
|
restart)
|
|
$0 stop
|
|
$0 start
|
|
;;
|
|
reload)
|
|
/usr/bin/smbcontrol smbd reload-config
|
|
/usr/bin/smbcontrol nmbd reload-config
|
|
;;
|
|
status)
|
|
print_status $SMB $SMB_PID
|
|
print_status $NMB $NMB_PID
|
|
;;
|
|
*)
|
|
echo "usage: $0 [start|stop|restart|status]"
|
|
;;
|
|
esac
|
|
|
|
# End of file
|