Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problems starting and stopping openLDAP
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Lynggaard
n00b
n00b


Joined: 01 Feb 2003
Posts: 22

PostPosted: Wed Feb 12, 2003 10:16 pm    Post subject: Problems starting and stopping openLDAP Reply with quote

I'm having problems starting and stopping OpenLDAP.

I have just emerged openLDAP 2.0.27-r2

running /etc/init.d/slapd start gives me
" * Starting ldap-server...
/etc/openldap/slapd.conf: Permission denied
touch: creating `/var/state/openldap/slapd.pid': No such file or directory
chown: failed to get attributes of `/var/state/openldap/slapd.pid': No such file or directory [ !! ]
"

then I did the following
* created the folder /var/state/openldap
* chgrp ldap /var/state/openldap
* chgrp -R ldap /etc/openldap

Now it starts, but it won't stop, instaed it gives
* Stopping ldap-server... [ !! ]

and trying a /etc/init.d/slapd gives me a server allready started

what have I done wrong ?
Back to top
View user's profile Send private message
rojaro
l33t
l33t


Joined: 06 May 2002
Posts: 732

PostPosted: Mon Feb 17, 2003 4:59 am    Post subject: Reply with quote

hi lynggaard,

you didn't do anything wrong - i just tumbled over the same problem, but found the reason and a solution. it seems whoever made the ebuild messed up with the default config file and the init script.

if you have slapd running - shut it down by running "killall -INT slapd".

create a directory /var/run/openldap as root

edit the /etc/openldap/slapd.conf file and search for these two lines:
Code:
pidfile         /var/lib/slapd.pid
argsfile        /var/lib/slapd.args

and change them into the following
Code:
pidfile         /var/run/openldap/slapd.pid
argsfile        /var/run/openldap/slapd.args

now open the slapd initscript (/etc/init.d/slapd) and change the pidfile parameter into "/var/run/openldap/slapd.pid" in the start and the stop functions.

now delete the /var/lib/slapd.pid and /var/lib/slapd.args files and also those directories you've made. then run /etc/init.d/slapd zap to notify the rc script that openldap isnt running anymore.

now you should be able to start and stop slapd as usual.
_________________
A mathematician is a machine for turning coffee into theorems. ~ Alfred Renyi (*1921 - †1970)
Back to top
View user's profile Send private message
flowctrl
n00b
n00b


Joined: 18 May 2003
Posts: 53
Location: Banff, Canada

PostPosted: Wed Jun 18, 2003 1:37 am    Post subject: Reply with quote

rojaro wrote:
hi lynggaard,

you didn't do anything wrong - i just tumbled over the same problem, but found the reason and a solution. it seems whoever made the ebuild messed up with the default config file and the init script.

if you have slapd running - shut it down by running "killall -INT slapd".

create a directory /var/run/openldap as root

edit the /etc/openldap/slapd.conf file and search for these two lines:
Code:
pidfile         /var/lib/slapd.pid
argsfile        /var/lib/slapd.args

and change them into the following
Code:
pidfile         /var/run/openldap/slapd.pid
argsfile        /var/run/openldap/slapd.args

now open the slapd initscript (/etc/init.d/slapd) and change the pidfile parameter into "/var/run/openldap/slapd.pid" in the start and the stop functions.

now delete the /var/lib/slapd.pid and /var/lib/slapd.args files and also those directories you've made. then run /etc/init.d/slapd zap to notify the rc script that openldap isnt running anymore.

now you should be able to start and stop slapd as usual.


Thanks, rojaro. Note also that you may also have to:
Code:
rm /var/lib/init.d/started/slapd


--
http://oss.netmojo.ca
Back to top
View user's profile Send private message
denic
Apprentice
Apprentice


Joined: 04 Aug 2002
Posts: 168

PostPosted: Fri Jun 27, 2003 8:04 am    Post subject: Reply with quote

Hi,

I get the same error.

But your instruction to remove the error did not work for me.
Back to top
View user's profile Send private message
Rhysem
Tux's lil' helper
Tux's lil' helper


Joined: 18 Dec 2002
Posts: 76

PostPosted: Fri Jun 27, 2003 11:42 pm    Post subject: Reply with quote

I had the same problem -- slapd is running as user/group ldap which doesn't have permission to write to the (now created by the ebuild) /var/run/openldap directory. That's cause /var/run/openldap is owned by root. Chown it to ldap.ldap and it then will start. (for me at least)
Back to top
View user's profile Send private message
drzero
n00b
n00b


Joined: 06 Oct 2002
Posts: 50
Location: Denmark

PostPosted: Thu Jul 17, 2003 11:24 am    Post subject: Reply with quote

I have a similar problem, with openldap 2.0.27-r4 I can only get it to start if I make it run as root by changing:
Code:
eval start-stop-daemon --start --quiet --pidfile /var/run/openldap/slapd.pid --exec /usr/lib/openldap/slapd -- -u ldap -g ldap "${OPTS}"

into:
Code:
eval start-stop-daemon --start --quiet --pidfile /var/run/openldap/slapd.pid --exec /usr/lib/openldap/slapd -- "${OPTS}"


I have tried lots of stuff, I even tried stracing it and it seems that it isn't allowed to listen to the ldap port because it is below 1024 and I can't remember how I can give the ldap user permission to use a port below 1024. Can anybody enlighten me?
Back to top
View user's profile Send private message
drzero
n00b
n00b


Joined: 06 Oct 2002
Posts: 50
Location: Denmark

PostPosted: Fri Jul 25, 2003 12:53 pm    Post subject: Reply with quote

I have it working now, it turns out /var/lib/openldap-ldbm/* was owned by root. A quick chown ldap.ldap fixed it so that slapd can start as user ldap now! :)
Back to top
View user's profile Send private message
pyro-x
n00b
n00b


Joined: 06 Jan 2003
Posts: 31

PostPosted: Wed Sep 10, 2003 10:58 pm    Post subject: Reply with quote

Same problem here with openldap version 2.0.27-r4

But i fixed it doing a:

Code:
chown ldap: /etc/openldap/slapd.conf


I don't know if it was broken before, or if i broke it when i created that file, but it seems /etc/init.d/slapd couldn't read it because it starts as user ldap. Well it seems this fixed it.

Cheers,
Pyro-X
Back to top
View user's profile Send private message
tecknojunky
Veteran
Veteran


Joined: 19 Oct 2002
Posts: 1937
Location: Montréal

PostPosted: Thu Sep 25, 2003 8:20 pm    Post subject: Reply with quote

Similar problem here, /etc/init.d/slapd start gives [!!].

Everything mentionned in this thread seem to be already configured properly on my system. The only thing that could be problematic is that not all files in /etc/openldap are own by group ldap, but I'm afraid to mess with this and get a unsecure system.

Code:
openldap # ls -l
total 82
-rw-r--r--    1 root     root          397 Sep 25 15:34 ldap.conf
-rw-r--r--    1 root     root          337 Aug  9 01:48 ldap.conf.default
-rw-r--r--    1 root     root         3122 Aug  9 01:48 ldapfilter.conf
-rw-r--r--    1 root     root         3122 Aug  9 01:48 ldapfilter.conf.default
-rw-r--r--    1 root     root         5043 Aug  9 01:48 ldapsearchprefs.conf
-rw-r--r--    1 root     root         5043 Aug  9 01:48 ldapsearchprefs.conf.default
-rw-r--r--    1 root     root        16452 Aug  9 01:48 ldaptemplates.conf
-rw-r--r--    1 root     root        16452 Aug  9 01:48 ldaptemplates.conf.default
drwxr-xr-x    2 root     root          712 Aug  9 01:48 schema
-rw-r-----    1 root     ldap         2227 Sep 25 15:37 slapd.conf
-rw-r-----    1 root     ldap         1790 Aug  9 01:48 slapd.conf.default
drwxr-xr-x    2 root     root          104 Aug  9 01:48 ssl


It would help if the init scripts would print the error messages instead of just !!.
_________________
(7 of 9) Installing star-trek/species-8.4.7.2::talax.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum