# Check that smb.conf exists.
[ -f /etc/samba/smb.conf ] || exit 0
+# return true if 'idmap uid' or 'idmap gid' is set in samba config
+configtest() {
+ egrep -qi '^idmap [ug]id' /etc/samba/smb.conf
+}
+
start() {
if [ ! -f /var/lock/subsys/winbind ]; then
- if [ "`grep -i 'idmap uid' /etc/samba/smb.conf | egrep -v [\#\;]`" -a "`grep -i 'idmap gid' /etc/samba/smb.conf | egrep -v [\#\;]`" ]; then
+ if configtest; then
msg_starting winbindd
- daemon winbindd
+ daemon /usr/sbin/winbindd
RETVAL=$?
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/winbind || \
- RETVAL=1
+ if [ $RETVAL -eq 0 ]; then
+ touch /var/lock/subsys/winbind
+ RETVAL=1
+ fi
else
nls "Winbind is not configured in /etc/samba/smb.conf, not starting"
fi