FS#2261 - Samba: Winbindd object in /etc/rc.d
Attached to Project:
Arch Linux
Opened by Pink Chick (Pink Chick) - Wednesday, 23 February 2005, 12:39 GMT
Last edited by Judd Vinet (judd) - Wednesday, 23 February 2005, 18:37 GMT
Opened by Pink Chick (Pink Chick) - Wednesday, 23 February 2005, 12:39 GMT
Last edited by Judd Vinet (judd) - Wednesday, 23 February 2005, 18:37 GMT
|
Details
Would it be possible if samba was installed to add a winbind
daemon starter file in /etc/rc.d like the following:
#!/bin/bash . /etc/rc.conf . /etc/rc.d/functions WINBIND_PID=`pidof -o %PPID /usr/sbin/winbindd` case "$1" in start) rc=0 stat_busy "Starting Winbind Daemon" [ -z "$WINBIND_PID" ] && /usr/sbin/winbindd -D rc=$(($rc+$?)) if [ $rc -gt 0 ]; then stat_fail else add_daemon winbindd stat_done fi ;; stop) rc=0 stat_busy "Stopping Winbind Daemon" kill $WINBIND_PID &>/dev/null rc=$(($rc+$?)) if [ $rc -gt 0 ]; then stat_fail else rm /var/run/winbindd.pid &>/dev/null rm_daemon winbindd stat_done fi ;; restart) $0 stop sleep 1 $0 start ;; *) echo "usage: $0 {start|stop|restart}" esac exit 0 |
This task depends upon
e.g. "DAEMONS=(smbd nmbd winbindd)" would include winbindd in the mix
samba (0.1 KiB)
##### /etc/rc.d/samba #####
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
[ -f /etc/conf.d/samba ] && . /etc/conf.d/samba
[ -z "$DAEMONS" ] && DAEMONS=(smbd nmbd)
case "$1" in
start)
rc=0
stat_busy "Starting Samba Server"
for d in ${DAEMONS[@]}; do
PID=`pidof -o %PPID /usr/sbin/$d`
[ -z "$PID" ] && /usr/sbin/$d -D
rc=$(($rc+$?))
done
if [ $rc -gt 0 ]; then
stat_fail
else
add_daemon samba
stat_done
fi
;;
stop)
rc=0
stat_busy "Stopping Samba Server"
for d in ${DAEMONS[@]}; do
PID=`pidof -o %PPID /usr/sbin/$d`
[ -z "$PID" ] || kill $PID &> /dev/null
rc=$(($rc+$?))
done
if [ $rc -gt 0 ]; then
stat_fail
else
rm /var/run/samba/smbd.pid &>/dev/null
rm /var/run/samba/nmbd.pid &>/dev/null
rm /var/run/samba/winbindd.pid &>/dev/null
rm_daemon samba
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0
##### /etc/conf.d/samba #####
#
# Configuration for the samba init script
#
# space separated list of daemons to launch
DAEMONS=(smbd nmbd)
#DAEMONS=(smbd nmbd winbindd)