1

I am trying to restart an LDAP server running on a CentOS machine so as to apply new SSL certificates. I have tracked the service to being run as

/usr/sbin/ns-slapd -D /etc/dirsrv/slapd-<instance> -i /var/run/dirsrv/slapd-<instance>.pid -w /var/run/dirsrv/slapd-<instance>.startpid

How can I restart this service? My ideas so far are to either reboot the whole computer as this service is set to run at startup. My other idea is to run that same command again however I have no guarantee that will work.

These commands service ldap\ldaps restart both return unrecognized service. No variation of ldap, ldaps, slapd or ns-slapd appear in the output of chkconfig --list. Should have put that in my question

2
  • The same way you restart any other service on CentOS? sudo systemctl restart ldap on v7, or sudo service ldap restart on v5, v6. Or sudo systemctl list-units --type=service on v7 to list all services and find its name, aka sudo chkconfig --list on v5, v6 May 28, 2018 at 7:13
  • @TessellatingHeckler These commands service ldap\ldaps restart both return unrecognized service. No variation of ldap, ldaps, slapd or ns-slapd appear in the output of chkconfig --list. Should have put that in my question.
    – Stringers
    May 28, 2018 at 7:19

3 Answers 3

-1

Assuming 389 Directory server:

The systemd service name is dirsrv, so systemctl restart dirsrv should do what you want in the proper way.

1
  • Yes you are right about the server being 389. So does restarting the service as you have said also result in my command being run?
    – Stringers
    May 28, 2018 at 23:16
1

Here's what worked for CentOS7.9, with the ns-slapd provided in the package 389-ds-base-1.3.10.2-15.el7_9.x86_64.rpm

sudo systemctl restart dirsrv@${instance}.service

It comes with these systemd files:

/usr/lib/systemd/system/dirsrv.target
/usr/lib/systemd/system/[email protected]
0

The RedHat guide lists this command as the correct one /usr/lib/dirsrv/slapd-instance/start-slapd

On 64 bit computers it may be located in /usr/lib64/dirsrv/slapd-instance/start-slapd which was the case in my situation.

1
  • You should use systemctl to control services.
    – Sven
    May 28, 2018 at 8:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .