Stopping Domino in RHEL/CENTOS 7

I just can’t seem to figure out how to get RHEL7/CENTOS7 to not kill my Domino Server with a reboot command. I have successfully crafted a working systemd file that correctly starts the server on boot and allows me to gracefully shutdown or restart the server with systemctl:

[Unit]

Description=IBM (LOTUS!) Domino Server

Documentation=IBM Support

After=network.target

[Service]

Type=simple

PIDFile=/run/domino.pid

TimeoutSec=300

ExecStart=/usr/bin/su - notes -c ‘/opt/ibm/domino/bin/server -jc -c’

ExecReload=/usr/bin/su - notes -c ‘echo Y | /opt/ibm/domino/bin/server -jc -q’ && ‘/opt/ibm/domino/bin/server -jc -c’

ExecStop=/usr/bin/su - notes -c ‘echo Y | /opt/ibm/domino/bin/server -jc -q’

[Install]

WantedBy=multi-user.target graphical.target

However, if the server needs to be shut down, or rebooted, I need to remember to shut down the service manually with

systemctl stop domino

Otherwise, the databases need recovery when they start back up.

I have tried a couple of suggestions I have found on the web:

  1. create a shutdown script that is wanted by the shutdown.target

  2. copy systemd-halt.service, systemd-poweroff.service, systemd-shutdown.service, and systemd-reboot.service over to /etc/systemd/system and add a ExecStartPre= line to shut down the service

I don’t know what to do next, except ask if there is something simple that I’ve missed as a newbie to systemd.

Subject: Better service file

For some reason, I can’t edit or comment on your article…

With systemd, you don’t need ANY startup script.
The use of these scripts were actually the CAUSE of your shutdown issues.
Instead of forcing the use of old initd scripts into systemd, just let systemd start Domino server, and do nothing else.
See also jdebp.eu https://jdebp.eu/FGA/systemd-house-of-horror/

Here’s what my own domino.service file looks like:

[Unit]
Description=“IBM Domino Server”
Documentation=IBM Support
After=network.target

[Service]
User=notes
WorkingDirectory=/var/notes
LimitNOFILE=60000
ExecStart=/bin/sh /opt/ibm/lotus/bin/server -jc -c
ExecStop=/bin/sh /opt/ibm/lotus/bin/server -jc -q -y

[Install]
WantedBy=multi-user.target

Plain and simple.

Pros:

  • no exotic systemd feature involved (KillMode/RemainAfterExit)
  • no dependancy on any 3rd party startup script
  • systemd gains full visibility over Domino tasks (see “systemctl status domino”)

NB : If you don’t want to use the Java console, you can probably use (untested):
ExecStart=/bin/sh /opt/ibm/lotus/bin/server
ExecStop=/bin/sh /opt/ibm/lotus/bin/server -q

Subject: Solution Documented on the Notes/Domino Wiki

http://www-10.lotus.com/ldd/dominowiki.nsf/dx/Starting_and_Stopping_Domino_-with-_the_Server_OS_automatically_with_systemd http://www-10.lotus.com/ldd/dominowiki.nsf/dx/Starting_and_Stopping_Domino_-with-_the_Server_OS_automatically_with_systemd

Subject: domino start/stop script on linux

Hi ben,

I can suggest using the script provided by nashcom.de (Domino for Unix/Linux Start-Script http://www.nashcom.de/nshweb/pages/startscript.htm)

I am using it on many servers and it’s working very nice.

Subject: SOLVED

Thanks, Joe. I’ve been using those Daniel Nashed’s scripts for years and I agree. Very good stuff. The root issue in this case was, however, that in RHEL 7, unless you are very careful, systemd will kill Domino on OS shutdown instead of shutting it down properly according to the script.

This is the case whether you install it with chkconfig or call it from one of the new-fangled service files in systemd.

Through painstaking trial and error, I’ve stumbled upon the correct combination of directives in the systemd service file. A systemd guru could probably improve upon this, but the basic, everyday functionality is there, and most importantly, the databases will not crash and have to go through recovery when Domino starts back up again. “domino_script” comes from the Nashcom http://www.nashcom.de/nshweb/pages/startscript.htm website you mentioned earlier, but the real magic in a RHEL 7 scenario are the directives, “KillMode=process” and “RemainAfterExit=yes”:

[Unit]
Description=IBM Domino Server
Documentation=IBM Support
After=syslog.target network.target

[Service]

Type=simple
User=notes
LimitNOFILE=60000
ExecStart=/opt/ibm/domino/bin/domino_script start
ExecStop=/opt/ibm/domino/bin/domino_script stop
TimeoutSec=300
KillMode=process
RemainAfterExit=yes

[Install]

WantedBy=multi-user.target