http://www.freedesktop.org/wiki/Software/systemd
Use systemctl instead of service to control 389 daemons and get the running status.
The 389-ds-base package installs the following during yum/rpm install:
rm /etc/systemd/system/dirsrv.target.wants/dirsrv@INSTANCENAME.service
cp /lib/systemd/system/dirsrv@.service /etc/systemd/system/dirsrv.target.wants/dirsrv@INSTANCENAME.service
edit /etc/systemd/system/dirsrv.target.wants/dirsrv@INSTANCENAME.service
add the systemd directives to the [Service] section
systemctl daemon-reload
/etc/sysconfig/dirsrv and /etc/sysconfig/dirsrv-INSTANCENAME are still used to set environment variables - but you cannot use shell syntax - for example do this
KRB5_KTNAME=/path/to/ds.keytab
not
export KRB5_KTNAME=/path/to/ds.keytab
nor
KRB5_KTNAME=/path/to/ds.keytab ; export KRB5_KTNAME
If you try to use shell syntax to set the environment variable, your definition will be silently ignored
The 389-admin package installs the following during yum/rpm install:
dirsrv-admin.service has a dependency on dirsrv.target so that if it is enabled to start at boot time, it will be started after dirsrv.target - that is, after all dirsrv instances have been started.
Running setup-ds.pl or setup-ds-admin.pl will create the symlink /etc/systemd/system/dirsrv.target.wants/dirsrv@INST.service -> /lib/systemd/system/dirsrv@.service. This is what allows dirsrv.target to operate on all of the service instances together. Running remove-ds.pl or remove-ds-admin.pl will remove the symlink.
http://www.freedesktop.org/wiki/Software/systemd/FrequentlyAskedQuestions
In 389 in older versions EL6, EL5, very old Fedoras
service dirsrv start
For 389-ds-base (dirsrv) - it depends on if you want to operate on all instances at once, or if you want to operate on a per-instance basis. All of the slapd instances on the system use the target dirsrv.target. Individual instances use dirsrv@INSTNAME.service. For example, if you have two instances - /etc/dirsrv/slapd-foo and /etc/dirsrv/slapd-bar:
systemctl start dirsrv.target
would start both instances. If you just wanted to restart instance foo:
systemctl restart dirsrv@foo.service
systemctl enable | disable |
systemctl enable dirsrv.target # start all instances at boot time
systemctl enable dirsrv@instname.service # start only instance instname at boot time
“systemctl status
On the systemd version 219 or newer, systemctl option takes a wildcard (*). Using the wildcard, the command line
systemctl status dirsrv@*
works in the same way as
systemctl status dirsrv@instance1 dirsrv@instance2 ...
does without specifying every server instance name. See also https://bugzilla.redhat.com/show_bug.cgi?id=1202178 for more details.
See https://fedoraproject.org/wiki/Systemd#How_do_I_change_the_runlevel.3F and https://fedoraproject.org/wiki/Systemd#How_do_I_change_the_default_runlevel.3F
You still use /etc/sysconfig/dirsrv and /etc/sysconfig/dirsrv-INSTANCE - But you must use systemd syntax, not shell syntax - for example, use this
KRB5_KTNAME=/path/to/ds.keytab
not
export KRB5_KTNAME=/path/to/ds.keytab
nor
KRB5_KTNAME=/path/to/ds.keytab ; export KRB5_KTNAME
If you try to use shell syntax to set the environment variable, your definition will be silently ignored
With sysv init, you would just add something like
ulimit -c unlimited
to /etc/sysconfig/dirsrv - but systemd doesn’t support that
Edit /etc/sysconfig/dirsrv.systemd - in the [Service] section add
LimitCORE=infinity
then do
systemctl daemon-reload
you will also have to restart the directory server for the changes to take effect.
With sysv init, you would just add something like
ulimit -n 8192
to /etc/sysconfig/dirsrv - but systemd doesn’t support that
Edit /etc/sysconfig/dirsrv.systemd - in the [Service] section add
LimitNOFILE=8192
or whatever number you want, then do
systemctl daemon-reload
you will also have to restart the directory server for the changes to take effect.
Note: the systemd documentation is still undergoing changes as of this writing (April 26, 2011)