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
Task Type Feature Request
Category Packages: Current
Status Closed
Assigned To Judd Vinet (judd)
Architecture not specified
Severity Medium
Priority Normal
Reported Version 0.7 Wombat
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

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

Closed by  Judd Vinet (judd)
Wednesday, 03 January 2007, 20:27 GMT
Reason for closing:  Implemented
Comment by Brian Mattern (rephorm) - Friday, 10 November 2006, 22:20 GMT
Or maybe we could add winbindd to the samba rc script (possibly with a file in /etc/conf.d to specify which daemons to include?)
Comment by Brian Mattern (rephorm) - Monday, 13 November 2006, 04:59 GMT
I'm attaching a possible rc script that allows setting a DAEMONS variable in /etc/conf.d/samba to specify which daemons to launch.

e.g. "DAEMONS=(smbd nmbd winbindd)" would include winbindd in the mix

(application/octet-stream)    samba (1 KiB)
(application/octet-stream)    samba (0.1 KiB)
Comment by Brian Mattern (rephorm) - Monday, 13 November 2006, 05:03 GMT
those didn't seem to upload properly. here they are inline:


##### /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)
Comment by Moo-Crumpus (Moo-Crumpus) - Wednesday, 13 December 2006, 18:57 GMT
How about fixin' it now?

Loading...