samba/samba-initscript
Silvan Calarco 690f4a096f update to 3.6.23
x86_64: install cups backend under %{_prefix}/lib/cups, not %{_libdir}/cups
x86_64: install pam and nss libraries under /lib64 instead of /lib
use patch to fix smbd link against libtirpc instead of passing LDFLAGS [release 3.6.23-1mamba;Wed Apr 02 2014]
2024-01-05 17:37:14 +01:00

58 lines
1.2 KiB
Bash

#!/bin/sh
# Copyright (c) 2003-2007 Silvan Calarco <ilvan.calarco@mambasotf@org>
# Copyright (c) 2007 Davide Madrisan <davide.madrisan@gmail.com>
#
# chkconfig: 2345 55 15
# description: start Samba daemons (nmbd and smbd)
. /etc/sysconfig/rc
. $rc_functions
NAME=samba
NMBD=/usr/sbin/nmbd
SMBD=/usr/sbin/smbd
NMBDPID=/run/nmbd.pid
SMBDPID=/run/smbd.pid
[ -x $SMBD -a -x $NMBD ] || exit 0
[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME
case "$1" in
start)
echo -n "Starting nmbd: "
daemon --pidfile=$NMBDPID $NMBD -D
evaluate_retval; echo
echo -n "Starting smbd: "
daemon --pidfile=$SMBDPID $SMBD -D
evaluate_retval; echo
;;
stop)
echo -n "Stopping nmbd: "
killproc -p $NMBDPID $NMBD -TERM
echo
sleep 1
echo -n "Stopping smbd: "
killproc -p $SMBDPID $SMBD -TERM
echo
;;
reload)
echo -n "Reloading smbd: "
reloadproc $SMBD
echo
;;
restart|force-reload)
$0 stop
sleep 1
$0 start
;;
status)
statusproc $NMBD
statusproc $SMBD
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|reload|restart|force-reload|status}"
exit 1
;;
esac