Dear List,
I hope that somebody can help me here.
My OpenLDAP starts fine using “slapd -d -1 -F /etc/openldap/slapd.d”. Everything is OK if I start the service using that command. But if I try to use the service “/bin/systemctl start slapd.service” it fails to start.
“/bin/systemctl start slapd.service Job for slapd.service failed because the control process exited with error code. See "systemctl status slapd.service" and "journalctl -xe" for details.”
The output of “systemctl status slapd.service”:
● slapd.service - OpenLDAP Server Daemon Loaded: loaded (/usr/lib/systemd/system/slapd.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since Fri 2017-09-01 10:37:55 CEST; 7s ago Docs: man:slapd man:slapd-config man:slapd-hdb man:slapd-mdb file:///usr/share/doc/openldap-servers/guide.html Process: 45146 ExecStart=/usr/sbin/slapd -u ldap -h ${SLAPD_URLS} $SLAPD_OPTIONS (code=exited, status=1/FAILURE) Process: 45132 ExecStartPre=/usr/libexec/openldap/check-config.sh (code=exited, status=0/SUCCESS)
Sep 01 10:37:55 tmv2312.devlab.de.tmo systemd[1]: Starting OpenLDAP Server Daemon... Sep 01 10:37:55 tmv2312.devlab.de.tmo runuser[45135]: pam_unix(runuser:session): session opened for user ldap by (uid=0) Sep 01 10:37:55 tmv2312.devlab.de.tmo runuser[45135]: pam_unix(runuser:session): session closed for user ldap Sep 01 10:37:55 tmv2312.devlab.de.tmo slapd[45146]: @(#) $OpenLDAP: slapd 2.4.40 (Nov 3 2016 18:02:29) $ mockbuild@x86-ol7-builder-01:/builddir/build/BUILD/openldap-2.4.40/openldap-2.4.40/servers/slapd Sep 01 10:37:55 tmv2312.devlab.de.tmo systemd[1]: slapd.service: control process exited, code=exited status=1 Sep 01 10:37:55 tmv2312.devlab.de.tmo systemd[1]: Failed to start OpenLDAP Server Daemon. Sep 01 10:37:55 tmv2312.devlab.de.tmo systemd[1]: Unit slapd.service entered failed state. Sep 01 10:37:55 tmv2312.devlab.de.tmo systemd[1]: slapd.service failed.
Output of “journalctl -xe”
Sep 01 11:24:06 tmv2312.devlab.de.tmo polkitd[772]: Registered Authentication Agent for unix-process:51631:336035477 (system bus name :1.16850 [/usr/bin/pkttyagent --notify-fd 5 --fall Sep 01 11:24:06 tmv2312.devlab.de.tmo systemd[1]: Starting OpenLDAP Server Daemon... -- Subject: Unit slapd.service has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit slapd.service has begun starting up. Sep 01 11:24:06 tmv2312.devlab.de.tmo runuser[51640]: pam_unix(runuser:session): session opened for user ldap by (uid=0) Sep 01 11:24:06 tmv2312.devlab.de.tmo runuser[51640]: pam_unix(runuser:session): session closed for user ldap Sep 01 11:24:06 tmv2312.devlab.de.tmo slapd[51651]: @(#) $OpenLDAP: slapd 2.4.40 (Nov 3 2016 18:02:29) $ mockbuild@x86-ol7-builder-01:/builddir/build/BUILD/openldap-2.4.40/openldap-2.4.40/servers/slapd Sep 01 11:24:06 tmv2312.devlab.de.tmo systemd[1]: slapd.service: control process exited, code=exited status=1 Sep 01 11:24:06 tmv2312.devlab.de.tmo systemd[1]: Failed to start OpenLDAP Server Daemon. -- Subject: Unit slapd.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit slapd.service has failed. -- -- The result is failed. Sep 01 11:24:06 tmv2312.devlab.de.tmo systemd[1]: Unit slapd.service entered failed state. Sep 01 11:24:06 tmv2312.devlab.de.tmo systemd[1]: slapd.service failed. Sep 01 11:24:06 tmv2312.devlab.de.tmo polkitd[772]: Unregistered Authentication Agent for unix-process:51631:336035477 (system bus name :1.16850, object path /org/freedesktop/PolicyKit
I don’t see any message that would help me to understand the reason for the failure.
The content of slapd.service:
“[Unit] Description=OpenLDAP Server Daemon After=syslog.target network-online.target Documentation=man:slapd Documentation=man:slapd-config Documentation=man:slapd-hdb Documentation=man:slapd-mdb Documentation=file:///usr/share/doc/openldap-servers/guide.html
[Service] Type=forking PIDFile=/var/run/openldap/slapd.pid Environment="SLAPD_URLS=ldap:/// ldapi:///" "SLAPD_OPTIONS=" EnvironmentFile=/etc/sysconfig/slapd ExecStartPre=/usr/libexec/openldap/check-config.sh ExecStart=/usr/sbin/slapd -u ldap -h ${SLAPD_URLS} $SLAPD_OPTIONS
[Install] WantedBy=multi-user.target”
Where does the script take “${SLAPD_URLS}” and “$SLAPD_OPTIONS” from?
Thank you very much,
Michael
Michael.Haertel@t-systems.com schrieb am 01.09.2017 um 11:30 in
Nachricht e5a37c6f615146ccbb79f3e509547f30@HE101867.emea1.cds.t-internal.com:
Dear List,
I hope that somebody can help me here.
My OpenLDAP starts fine using “slapd -d -1 -F /etc/openldap/slapd.d”. Everything is OK if I start the service using that command. But if I try to
use the service “/bin/systemctl start slapd.service” it fails to
start.
Simple question: Could it be that you ran the command as root? The service might run as user "ldap", while you command runs it as root, then. What is the owner of the database and config files?
Regards, Ulrich
“/bin/systemctl start slapd.service Job for slapd.service failed because the control process exited with error code. See "systemctl status slapd.service" and "journalctl -xe" for
details.”
The output of “systemctl status slapd.service”:
● slapd.service - OpenLDAP Server Daemon Loaded: loaded (/usr/lib/systemd/system/slapd.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since Fri 2017-09-01 10:37:55 CEST; 7s
ago Docs: man:slapd man:slapd-config man:slapd-hdb man:slapd-mdb file:///usr/share/doc/openldap-servers/guide.html Process: 45146 ExecStart=/usr/sbin/slapd -u ldap -h ${SLAPD_URLS} $SLAPD_OPTIONS (code=exited, status=1/FAILURE) Process: 45132 ExecStartPre=/usr/libexec/openldap/check-config.sh (code=exited, status=0/SUCCESS)
Sep 01 10:37:55 tmv2312.devlab.de.tmo systemd[1]: Starting OpenLDAP Server Daemon... Sep 01 10:37:55 tmv2312.devlab.de.tmo runuser[45135]: pam_unix(runuser:session): session opened for user ldap by (uid=0) Sep 01 10:37:55 tmv2312.devlab.de.tmo runuser[45135]: pam_unix(runuser:session): session closed for user ldap Sep 01 10:37:55 tmv2312.devlab.de.tmo slapd[45146]: @(#) $OpenLDAP: slapd 2.4.40 (Nov 3 2016 18:02:29) $
mockbuild@x86-ol7-builder-01:/builddir/build/BUILD/openldap-2.4.40/openldap-2
.4.40/servers/slapd Sep 01 10:37:55 tmv2312.devlab.de.tmo systemd[1]: slapd.service: control process exited, code=exited status=1 Sep 01 10:37:55 tmv2312.devlab.de.tmo systemd[1]: Failed to start OpenLDAP Server Daemon. Sep 01 10:37:55 tmv2312.devlab.de.tmo systemd[1]: Unit slapd.service entered
failed state. Sep 01 10:37:55 tmv2312.devlab.de.tmo systemd[1]: slapd.service failed.
Output of “journalctl -xe”
Sep 01 11:24:06 tmv2312.devlab.de.tmo polkitd[772]: Registered Authentication Agent for unix-process:51631:336035477 (system bus name :1.16850 [/usr/bin/pkttyagent --notify-fd 5 --fall Sep 01 11:24:06 tmv2312.devlab.de.tmo systemd[1]: Starting OpenLDAP Server Daemon... -- Subject: Unit slapd.service has begun start-up -- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit slapd.service has begun starting up. Sep 01 11:24:06 tmv2312.devlab.de.tmo runuser[51640]: pam_unix(runuser:session): session opened for user ldap by (uid=0) Sep 01 11:24:06 tmv2312.devlab.de.tmo runuser[51640]: pam_unix(runuser:session): session closed for user ldap Sep 01 11:24:06 tmv2312.devlab.de.tmo slapd[51651]: @(#) $OpenLDAP: slapd 2.4.40 (Nov 3 2016 18:02:29) $
mockbuild@x86-ol7-builder-01:/builddir/build/BUILD/openldap-2.4.40/openldap-2
.4.40/servers/slapd Sep 01 11:24:06 tmv2312.devlab.de.tmo systemd[1]: slapd.service: control process exited, code=exited status=1 Sep 01 11:24:06 tmv2312.devlab.de.tmo systemd[1]: Failed to start OpenLDAP Server Daemon. -- Subject: Unit slapd.service has failed -- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit slapd.service has failed.
-- The result is failed. Sep 01 11:24:06 tmv2312.devlab.de.tmo systemd[1]: Unit slapd.service entered
failed state. Sep 01 11:24:06 tmv2312.devlab.de.tmo systemd[1]: slapd.service failed. Sep 01 11:24:06 tmv2312.devlab.de.tmo polkitd[772]: Unregistered Authentication Agent for unix-process:51631:336035477 (system bus name :1.16850, object path /org/freedesktop/PolicyKit
I don’t see any message that would help me to understand the reason for
the
failure.
The content of slapd.service:
“[Unit] Description=OpenLDAP Server Daemon After=syslog.target network-online.target Documentation=man:slapd Documentation=man:slapd-config Documentation=man:slapd-hdb Documentation=man:slapd-mdb Documentation=file:///usr/share/doc/openldap-servers/guide.html
[Service] Type=forking PIDFile=/var/run/openldap/slapd.pid Environment="SLAPD_URLS=ldap:/// ldapi:///" "SLAPD_OPTIONS=" EnvironmentFile=/etc/sysconfig/slapd ExecStartPre=/usr/libexec/openldap/check-config.sh ExecStart=/usr/sbin/slapd -u ldap -h ${SLAPD_URLS} $SLAPD_OPTIONS
[Install] WantedBy=multi-user.target”
Where does the script take “${SLAPD_URLS}” and “$SLAPD_OPTIONS”
from?
Thank you very much,
Michael
On 01.09.2017 11:30, Michael.Haertel@t-systems.com wrote:
Where does the script take “*/${SLAPD_URLS}” /*and */“$SLAPD_OPTIONS” /*from?
From /etc/sysconfig/slapd
Your problem was caused by wrong permissions of the database directory. I have fixed that, slapd is running now.
best regards Ulf Volmer
On 01-09-17 11:30, Michael.Haertel@t-systems.com wrote:
Dear List,
I hope that somebody can help me here.
My OpenLDAP starts fine using “slapd -d -1 -F /etc/openldap/slapd.d”. Everything is OK if I start the service using that command. But if I try to use the service “/bin/systemctl start slapd.service” it fails to start.
“/bin/systemctl start slapd.service
Job for slapd.service failed because the control process exited with error code. See "systemctl status slapd.service" and "journalctl -xe" for details.”
The output of “systemctl status slapd.service”:
/● slapd.service - OpenLDAP Server Daemon/
/ Loaded: loaded (/usr/lib/systemd/system/slapd.service; disabled; vendor preset: disabled)/
/ Active: failed (Result: exit-code) since Fri 2017-09-01 10:37:55 CEST; 7s ago/
/ Docs: man:slapd/
/ man:slapd-config/
/ man:slapd-hdb/
/ man:slapd-mdb/
/ file:///usr/share/doc/openldap-servers/guide.html/
/ Process: 45146 ExecStart=/usr/sbin/slapd -u ldap -h ${SLAPD_URLS} $SLAPD_OPTIONS (code=exited, status=1/FAILURE)/
/ Process: 45132 ExecStartPre=/usr/libexec/openldap/check-config.sh (code=exited, status=0/SUCCESS)/
/ /
/Sep 01 10:37:55 tmv2312.devlab.de.tmo systemd[1]: Starting OpenLDAP Server Daemon.../
/Sep 01 10:37:55 tmv2312.devlab.de.tmo runuser[45135]: pam_unix(runuser:session): session opened for user ldap by (uid=0)/
/Sep 01 10:37:55 tmv2312.devlab.de.tmo runuser[45135]: pam_unix(runuser:session): session closed for user ldap/
/Sep 01 10:37:55 tmv2312.devlab.de.tmo slapd[45146]: @(#) $OpenLDAP: slapd 2.4.40 (Nov 3 2016 18:02:29) $/
/ mockbuild@x86-ol7-builder-01:/builddir/build/BUILD/openldap-2.4.40/openldap-2.4.40/servers/slapd/
/Sep 01 10:37:55 tmv2312.devlab.de.tmo systemd[1]: slapd.service: control process exited, code=exited status=1/
/Sep 01 10:37:55 tmv2312.devlab.de.tmo systemd[1]: Failed to start OpenLDAP Server Daemon./
/Sep 01 10:37:55 tmv2312.devlab.de.tmo systemd[1]: Unit slapd.service entered failed state./
/Sep 01 10:37:55 tmv2312.devlab.de.tmo systemd[1]: slapd.service failed./
/ /
Output of “journalctl -xe”
/Sep 01 11:24:06 tmv2312.devlab.de.tmo polkitd[772]: Registered Authentication Agent for unix-process:51631:336035477 (system bus name :1.16850 [/usr/bin/pkttyagent --notify-fd 5 --fall/
/Sep 01 11:24:06 tmv2312.devlab.de.tmo systemd[1]: Starting OpenLDAP Server Daemon.../
/-- Subject: Unit slapd.service has begun start-up/
/-- Defined-By: systemd/
/-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel/
/--/
/-- Unit slapd.service has begun starting up./
/Sep 01 11:24:06 tmv2312.devlab.de.tmo runuser[51640]: pam_unix(runuser:session): session opened for user ldap by (uid=0)/
/Sep 01 11:24:06 tmv2312.devlab.de.tmo runuser[51640]: pam_unix(runuser:session): session closed for user ldap/
/Sep 01 11:24:06 tmv2312.devlab.de.tmo slapd[51651]: @(#) $OpenLDAP: slapd 2.4.40 (Nov 3 2016 18:02:29) $/
/ mockbuild@x86-ol7-builder-01:/builddir/build/BUILD/openldap-2.4.40/openldap-2.4.40/servers/slapd/
/Sep 01 11:24:06 tmv2312.devlab.de.tmo systemd[1]: slapd.service: control process exited, code=exited status=1/
/Sep 01 11:24:06 tmv2312.devlab.de.tmo systemd[1]: Failed to start OpenLDAP Server Daemon./
/-- Subject: Unit slapd.service has failed/
/-- Defined-By: systemd/
/-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel/
/--/
/-- Unit slapd.service has failed./
/--/
/-- The result is failed./
/Sep 01 11:24:06 tmv2312.devlab.de.tmo systemd[1]: Unit slapd.service entered failed state./
/Sep 01 11:24:06 tmv2312.devlab.de.tmo systemd[1]: slapd.service failed./
/Sep 01 11:24:06 tmv2312.devlab.de.tmo polkitd[772]: Unregistered Authentication Agent for unix-process:51631:336035477 (system bus name :1.16850, object path /org/freedesktop/PolicyKit/
/ /
/ /
I don’t see any message that would help me to understand the reason for the failure.
The content of slapd.service:
/“[Unit]/
/Description=OpenLDAP Server Daemon/
/After=syslog.target network-online.target/
/Documentation=man:slapd/
/Documentation=man:slapd-config/
/Documentation=man:slapd-hdb/
/Documentation=man:slapd-mdb/
/Documentation=file:///usr/share/doc/openldap-servers/guide.html/
/ /
/[Service]/
/Type=forking/
/PIDFile=/var/run/openldap/slapd.pid/
/Environment="SLAPD_URLS=ldap:/// ldapi:///" "SLAPD_OPTIONS="/
/EnvironmentFile=/etc/sysconfig/slapd/
/ExecStartPre=/usr/libexec/openldap/check-config.sh/
/ExecStart=/usr/sbin/slapd -u ldap -h *${SLAPD_URLS} $SLAPD_OPTIONS*/
/ /
/[Install]/
/WantedBy=multi-user.target”/
/ /
Where does the script take “*/${SLAPD_URLS}” /*and */“$SLAPD_OPTIONS” /*from?
On my servers ( SLES12 ) it reads from: /etc/sysconfig/openldap. Fairly self-explaining, but you might want to share it with us. Best,
gerard
Michael.Haertel@t-systems.com wrote:
My OpenLDAP starts fine using “slapd -d -1 -F /etc/openldap/slapd.d”. Everything is OK if I start the service using that command.
Good.
But if I try to use the service “/bin/systemctl start slapd.service” it fails to start.
“/bin/systemctl start slapd.service Job for slapd.service failed because the control process exited with error code. See "systemctl status slapd.service" and "journalctl -xe" for details.”
The output of “systemctl status slapd.service”: [..] Process: 45146 ExecStart=/usr/sbin/slapd -u ldap -h ${SLAPD_URLS} $SLAPD_OPTIONS (code=exited, status=1/FAILURE) [..] Where does the script take “${SLAPD_URLS}” and “$SLAPD_OPTIONS” from?
Maybe I missed it but what's your OS?
In general something like this depends on the Linux distribution and the OpenLDAP package you're using.
Ciao, Michael.
Am Freitag, 01. September 2017 17:13 CEST, Michael Ströder michael@stroeder.com schrieb:
Maybe I missed it but what's your OS?
Maybe I missed something, but since when was systemd ported to non-Linux OSs? ;-) But you are right - those shell variables look suspicious, almost as if the exec line was copied from an init script that sourced something like /etc/defaults/slapd ....
Cheers, Ralf Mattes
Ralf Mattes wrote:
Am Freitag, 01. September 2017 17:13 CEST, Michael Ströder michael@stroeder.com schrieb:
Maybe I missed it but what's your OS?
Maybe I missed something, but since when was systemd ported to non-Linux OSs? ;-)
As you might already know Linux distributions differ a lot. So I count them as different OSs.
Ciao, Michael.
openldap-technical@openldap.org