FS#25168 - [openldap] slapd can no longer run as non-root with pidfile in /run
Attached to Project:
Arch Linux
Opened by Geert Hendrickx (ghen) - Tuesday, 19 July 2011, 09:16 GMT
Last edited by Eric Belanger (Snowman) - Thursday, 21 July 2011, 19:26 GMT
Opened by Geert Hendrickx (ghen) - Tuesday, 19 July 2011, 09:16 GMT
Last edited by Eric Belanger (Snowman) - Thursday, 21 July 2011, 19:26 GMT
|
Details
Since moving the pidfile from /var/lib/openldap/run to /run,
slapd can no longer run as a non-root user:
unable to open pid file "/run/slapd.pid": 13 (Permission denied) (when running with -u ldap -d -1) This is probably more of an issue with slapd dropping privileges too early, but it worked before with the pidfile in a dedicated (ldap owned) directory. Or should /run be 1777 like /tmp? |
This task depends upon
Closed by Eric Belanger (Snowman)
Thursday, 21 July 2011, 19:26 GMT
Reason for closing: Implemented
Additional comments about closing: daemon now runs as ldap user and group.
Thursday, 21 July 2011, 19:26 GMT
Reason for closing: Implemented
Additional comments about closing: daemon now runs as ldap user and group.
If you edit the values of pidfile and argsfile in /etc/openldap/slapd.conf to have the files in /var/run or another directory, does it work?
slapd runs fine as a non-root user in general, if you give config files (640 root:ldap) and databases (ldap:ldap all the way) the proper permissions. I think it should be considered to make it run that way by default on Arch. There is no real reason to run it as root.
- install /run/openldap should be moved to the rc.d script instead of the package_openldap() target,
- libldap should be rebuilt as well for the new ldapi socket path (I edited /etc/openldap/ldap.conf for now).
PS: you can install(1) with -o/-g to set owner/group instead of the additional chown.
I thought about it but the packages were already built and tested so I decided to leave it. I'll change it in svn.
- libldap should be rebuilt as well for the new ldapi socket path (I edited /etc/openldap/ldap.conf for now).
Are you sure you have libldap 2.4.26-2 installed? Here it has the correct reference:
$ strings /usr/lib/libldap-2.4.so.2 |grep ldapi
ldap_is_ldapi_url
ldapi://
/run/openldap/ldapi
If you get different output, paste it here. Also, put steps to reproduce the problem as well as the change you did to the config file to fix it.
Thanks!