# cannot start saslauthd with init scripts

## ewtrowbr

I am trying to follow Mike Featherstons excellent gentoo howto for open-xchange, and have run into a problem. WHen I try to start saslauthd...

root@spam init.d # ./saslauthd start

* WARNING: "saslauthd" has already been started.

root@spam init.d # ./saslauthd restart

* Stopping saslauthd...

No process in pidfile `/var/lib/sasl2/saslauthd.pid' found running; none killed. [ !! ]

root@spam init.d # ./saslauthd stop

* Stopping saslauthd...

No process in pidfile `/var/lib/sasl2/saslauthd.pid' found running; none killed. [ !! ]

root@spam init.d #

When I try to start saslauthd with 'saslauthd -a ldap', I get..

root@spam init.d # saslauthd -a ldap -O /etc/saslauthd.conf

saslauthd[23767] :set_auth_mech : unknown authentication mechanism: ldap

Please help...

erich

root@spam etc # cat /etc/conf.d/saslauthd

# $Header: /var/cvsroot/gentoo-x86/dev-libs/cyrus-sasl/files/saslauthd2.conf,v 1.3 2004/07/18 02:56:59 dragonheart Exp $

# Config file for /etc/init.d/saslauthd

SASL_AUTHMECH=ldap

# Initial (empty) options.

SASLAUTHD_OPTS="-a ${SASLAUTH_MECH}"

# Specify the authentications mechanism.

# *NOTE* For list see: saslauthd -v

# SASLAUTHD_OPTS="${SASLAUTH_MECH} -a pam"

#SASLAUTHD_OPTS="-a ${SASLAUTH_MECH}"

# Specify the hostname for remote IMAP server.

# *NOTE* Only needed if rimap auth mech is used.

#SASLAUTHD_OPTS="${SASLAUTHD_OPTS} -O localhost"

# Specify the number of worker processes to create.

#SASLAUTHD_OPTS="${SASLAUTHD_OPTS} -n 5"

# Enable credential cache, cache size, and timeout.

# *NOTE* Size is measured in kilobytes

# Timeout is measured in seconds

#SASLAUTHD_OPTS="${SASLAUTHD_OPTS} -c -s 128 -t 30"

root@spam etc # more /etc/saslauthd.conf

# Copyright 1999-2004 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo-x86/dev-libs/cyrus-sasl/files/saslauthd.conf,v 1.3 2004/07/14 22:02:41 agriffis Exp $

# Config file for /etc/init.d/saslauthd

# Authentications mechanism (for list see saslauthd -v)

SASL_AUTHMECH=pam

# Hostname for remote IMAP server (if rimap auth mech is used)

SASL_RIMAP_HOSTNAME=""

# Honour time-of-day login restrictions (if shadow auth mech is used)

# Make this ="" to turn it off. Putting =no will turn it on!

SASL_TIME_OF_DAY_LOGIN_RESTRICTIONS=yes

# Tack the above options together

[ -n ${SASL_AUTHMECH} ] && \

SASLAUTHD_OPTS="-a ${SASL_AUTHMECH}"

[ -n ${SASL_RIMAP_HOSTNAME} ] && \

SASLAUTHD_OPTS="${SASLAUTHD_OPTS} -H ${SASL_RIMAP_HOSTNAME}"

[ -n ${SASL_TIME_OF_DAY_LOGIN_RESTRICTIONS} ] && \

SASLAUTHD_OPTS="${SASLAUTHD_OPTS} -T"

ldap_servers: ldap://ox.nois.net:389/

ldap_bind_dn: cn-Manager.dc=ox.nois.net,dc=nois.net

ldap_bind_pw: secret

ldap_search_base: dc=ox,dc=nois.net

----------

## texas1emt

Hmm, this might not help, but if /etc/init.d/servicename start claims the service is running already, and then when you try to stop it, it claims it's not started, try this: 

```
/etc/init.d/servicename zap
```

Zap forces the service script to reset itself as stopped.

----------

## ewtrowbr

OMG!!! YOU ROCK!

that flag is awesome! where do I find out about more of these? And where do I find aout about pid files and .keep files and all that jazz?

thanks in advance,

erich

----------

## texas1emt

Hah, I learned 'zap' when dealing with pure-ftpd... GRRR    :Evil or Very Mad: 

Basically if you want to know all the neat commands available for init scripts: 

```
# /etc/init.d/scriptname

>> They're the same for ALL scripts, but if you're dealing with a certain one, like samba...

# /etc/init.d/samba
```

You'll get a laundry list of all the super duper functions you can do.

----------

## ewtrowbr

I know enough to look at the script and see what flags are available. 'zap' isn't listed in there anywhere for any of them. I guess I'll go slog though sbin runscript.sh...

I really don't see the zap feature in here anywhere. When I ran it, it stated that it was shutting down the process manually... what exactly does this mean? Clearing out the pidfile? 

thanks again for the good tool...

erich

----------

## texas1emt

Well basically, I think it takes you out of init script limbo.  Basically the script's reporting to gentoo 'Hey this process is running' but yet the processes itself aren't there.  

When you issue the zap command, it resets the script so that the script thinks it hasnt started yet.  If you have running processes that go with the script and you use zap then, the script thinks it hasn't been run yet, but the processes still run.

----------

