389 – Starting/Stoping – Service VS. Systemctl

389 – Enterprise Class Open Source Directory Server for Fedora. I am going to write about the options given for stating and stopping the Directory Server using various command line tools. Some given by Operation System and some given by Directory Server ifself. So here are these options ::

1. Using Service Command – Service command is now a days replaced by systemctl. In RHEL7 and newer, systemctl is being used by default and service command also redirects to systemctl on execution. For older RHEL and Fedora, we still make use of service. This is how, it can be used to start/stop/restart/status for Directory Server ::

service dirsrv start
service dirsrv stop
service dirsrv status
service dirsrv restart

Above commands can be used for all the instances installed on machine. For any specific instance, one can use ::

service dirsrv start ID

2. Using Systemctl :: Everything is getting controled by systemd in Linux. Systemctl have functionality of both service and chkconfig into it. And this is how it can be used to control Directory Server daemon ::

systemctl start/stop/restart/status dirsrv.target
– This is for all the instances installed.

systemctl start/stop/restart/status dirsrv@<ID>.service
– This is for perticular instance.

3. Using Directory Server Tools :: We have placed these two tools at 2 places ::
a). /usr/sbin
/usr/sbin/start-dirsrv
/usr/sbin/stop-dirsrv
/usr/sbin/restart-dirsrv

b). /usr/lib64/dirsrv/slapd-ID
start-slapd
stop-slapd
restart-slapd

These scripts are using systemctl internally and quite handy to use as they come with the Directory Server and if you are automating then you must consider using them over service or systemctl as they will unlikly to change in their usage and will be enhanced to use the latest thing in future to keep up for example if systemctl will be replaced by something else in future 🙂 .. you never know!

Unfortunatley, We don’t have status-slapd in place, but developers are considering to have it.
Point to be noted here is we are getting rid of /usr/lib64/dirsrv/slapd-ID/{tools}, which include *-slapd.

So conclusion, perferred way is to use /usr/sbin scripts for stoping, starting and restarting Directory Server instances.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s