Daemon registration examples for SLES 12+ and RHEL 7+ (systemd)
Example #1: Register a daemon for Universal Messaging (SLES 12+, RHEL 7+, systemd)
When, for example, you installed Integration Server and Universal Messaging and during installation you have enabled the option Register Windows service/UNIX daemon for automatic startup for Integration Server and its dependent component Platform Manager. Now you also want to have a daemon registration for Universal Messaging, so you need to do this with manual steps after installation:
1. Set the PATH variable for convenient usage of daemon.sh:
# PATH=/opt/softwareag/common/bin:$PATH
2. Check the PATH variable:
# which daemon.sh
/opt/softwareag/common/bin/daemon.sh
3. Register the daemon for Universal Messaging:
# daemon.sh -f /opt/softwareag/UniversalMessaging/server/umserver/
bin/nserverdaemon
[daemon.sh] Created /usr/lib/systemd/system/sagnserverdaemon.service(ok)
[daemon.sh] chmod 644 /usr/lib/systemd/system/sagnserverdaemon.service(ok)
Created symlink from /etc/systemd/system/multi-user.target.wants/
sagnserverdaemon.service to
/usr/lib/systemd/system/sagnserverdaemon.service.
[daemon.sh] systemctl enable sagnserverdaemon.service (ok)
4. Identify the systemd service file names from the left column:
# daemon.sh -L
/usr/lib/systemd/system/sag2is1101.service /opt/softwareag/profiles/
IS_default/bin/sagis105
/usr/lib/systemd/system/sag2spm101.service /opt/softwareag/profiles/SPM/
bin/sagspm105
/usr/lib/systemd/system/sagnserverdaemon.service /opt/softwareag/
UniversalMessaging/server/umserver/bin/nserverdaemon
5. Check if the status of the Universal Messaging daemon is inactive (dead):
# systemctl status sagnserverdaemon
● sagnserverdaemon.service - sagnserverdaemon
Loaded: loaded (/usr/lib/systemd/system/sagnserverdaemon.service;
enabled; vendor preset: disabled)
Active: inactive (dead)
6. Reboot the system or activate all the new systemd services:
# systemctl start sag2spm105
# systemctl start sag2is1105
# systemctl start sagnserverdaemon
7. Check if the status of the Universal Messaging daemon is active:
# systemctl status sagnserverdaemon
● sagnserverdaemon.service - sagnserverdaemon
Loaded: loaded (/usr/lib/systemd/system/sagnserverdaemon.service;
enabled; vendor preset: disabled)
Active: active (running) since Fri 2019-03-08 13:22:18 CET; 12s ago
Process: 11439 ExecStart=/bin/su - sag -c /opt/softwareag/
UniversalMessaging/server/umserver/bin/nserverdaemon start
(code=exited, status=0/SUCCESS)
Mar 08 13:22:06 sles12 systemd[1]: Starting sagnserverdaemon...
Mar 08 13:22:06 sles12 su[11439]: (to sag) root on none
Mar 08 13:22:06 sles12 su[11439]: pam_unix(su-l:session): session opened
for user sag by (uid=0)
Mar 08 13:22:18 sles12 systemd[1]: Started sagnserverdaemon.
Example #2: Ensure that Universal Messaging starts up before Integration Server (SLES 12+, RHEL 7+, systemd)
After you installed the daemons as per Example #1, it is still undefined whether Universal Messaging will start before or after Integration Server at system boot time. To configure Universal Messaging to start before Integration Server:
1. Identify the service files and the rc-scripts for Integration Server and Universal Messaging:
# daemon.sh -L
/usr/lib/systemd/system/sag2is1105.service /opt/softwareag/profiles/
IS_default/bin/sagis105
/usr/lib/systemd/system/sag2spm105.service /opt/softwareag/profiles/SPM/
bin/sagspm105
/usr/lib/systemd/system/sagnserverdaemon.service /opt/softwareag/
UniversalMessaging/server/umserver/bin/nserverdaemon
2. Register the daemon for Integration Server and add the After=sagnserverdaemon.service property to the service definition:
# daemon.sh -f /opt/softwareag/profiles/IS_default/bin/sagis105
-A sagnserverdaemon.service
3. Register again the daemon for Universal Messaging and add the Before=sag2is1105.service property to the service definition:
# daemon.sh -f /opt/softwareag/UniversalMessaging/server/umserver/bin/
nserverdaemon -B sag2is1105.service
4. Activate both systemd services:
# systemctl start sag2is1105
# systemctl start sagnserverdaemon
Example #3: Register daemon for Universal Messaging (Solaris, initd):
When, for example, you installed Integration Server and Universal Messaging and during installation you have enabled the option Register Windows service/UNIX daemon for automatic startup for Integration Server and its dependent component Platform Manager. Now you also want to have a daemon registration for Universal Messaging, so you need to do this with manual steps after installation:
1. Set the PATH variable for faster usage of daemon.sh:
# PATH=/opt/softwareag/common/bin:$PATH
2. Check the PATH variable:
# which daemon.sh
/opt/softwareag/common/bin/daemon.sh
3. Register the daemon for Universal Messaging:
# daemon.sh -f /opt/softwareag/UniversalMessaging/server/umserver/bin/
nserverdaemon
[daemon.sh] Created /etc/init.d/sagnserverdaemon (ok)
[daemon.sh] chmod 775 /etc/init.d/sagnserverdaemon (ok)
[daemon.sh] ln -s /etc/init.d/sagnserverdaemon /etc/rc3.d/
S20sagnserverdaemon (ok)
[daemon.sh] chmod 775 /etc/rc3.d/S20sagnserverdaemon (ok)
[daemon.sh] ln -s /etc/init.d/sagnserverdaemon /etc/rc2.d/
K20sagnserverdaemon (ok)
[daemon.sh] chmod 775 /etc/rc2.d/K20sagnserverdaemon (ok)
4. List all registered daemons:
# daemon.sh -L
/etc/init.d/sag4is1105 /opt/softwareag/profiles/IS_default/bin/sagis105
/etc/init.d/sag4spm105 /opt/softwareag/profiles/SPM/bin/sagspm105
/etc/init.d/sagnserverdaemon /opt/softwareag/UniversalMessaging/server/
umserver/bin/nserverdaemon
Example #4: Ensure that Universal Messaging starts up before Integration Server (Solaris, initd)
After you installed the daemons as per Example #3, it is still undefined whether Universal Messaging will start before or after Integration Server at system boot time.
The sequence for the daemon startup depends on an order number, where each daemon gets assigned a particular start number. If you have two daemons, then the daemon with the lower number will start first. You can specify the daemon start number with daemon.sh option '-S'. The default in daemon.sh is '-S 20'. If you do not specify any number then all get the same default and the sequence is undefined. If you want Universal Messaging to start before Integration Server, just specify a lower start number like '-S 10'.
A similar handling applies for the shutdown sequence, where we have a stop (kill) number which can be specified with daemon.sh option '-K'. The following example shows how to change the start number and the kill number from default (20) to 10 for the Universal Messaging daemon, in order to make it start before and stop after Integration Server:
# daemon.sh -f /opt/softwareag/UniversalMessaging/server/umserver/bin/
nserverdaemon -S 10 -K 10
[daemon.sh] /etc/rc2.d/K20sagnserverdaemon removed (ok)
[daemon.sh] /etc/rc3.d/S20sagnserverdaemon removed (ok)
[daemon.sh] /etc/init.d/sagnserverdaemon removed (ok)
[daemon.sh] Created /etc/init.d/sagnserverdaemon (ok)
[daemon.sh] chmod 775 /etc/init.d/sagnserverdaemon (ok)
[daemon.sh] ln -s /etc/init.d/sagnserverdaemon /etc/rc3.d/S10sagnserverdaemon(ok)
[daemon.sh] chmod 775 /etc/rc3.d/S10sagnserverdaemon (ok)
[daemon.sh] ln -s /etc/init.d/sagnserverdaemon /etc/rc2.d/K10sagnserverdaemon(ok)
[daemon.sh] chmod 775 /etc/rc2.d/K20sagnserverdaemon (ok)
Note:
The command output shows all the file operations, which go along with the initd way of daemon registration. Note that the previous specification gets automatically overwritten (removed). You can see that the new start and kill numbers become part of the symbolical link names, like 'S10' in S10sagnserverdamon or 'K10' in K10sagnserverdaemon.
Example #5: Configuring Integration Server shutdown timeouts in systemd and Tanuki Service Wrapper (RHEL 7+, SLES12+, systemd)
If the regular shutdown time of Integration Server exceeds the configured timeout values for the Tanuki Service Wrapper or systemd, then its daemon will be aborted (SIGKILL, kill -9). The same can happen for any other Software AG daemon. If you identified such an issue, you need to stop the daemon and manually configure higher timeout values for Tanuki and systemd, like in the following example for Integration Server:
For Tanuki, edit the custom_wrapper.conf file for the Integration Server instance, change the property for shutdown timeout to 500 seconds:
$ vi /opt/softwareag/profiles/IS*/configuration/custom_wrapper.conf
wrapper.shutdown.timeout=500
For systemd, stop the service, identify and edit the service file, add a shutdown timeout of 500 seconds and activate the service by starting the daemon:
# systemctl stop sagis1105
# daemon.sh -L
/usr/lib/systemd/system/sag2is1105.service /opt/softwareag/profiles/
IS_default/bin/sagis105
/usr/lib/systemd/system/sag2spm105.service /opt/softwareag/profiles/SPM/
bin/sagspm105
/usr/lib/systemd/system/sagnserverdaemon.service /opt/softwareag/
UniversalMessaging/server/umserver/bin/nserverdaemon
# vi /usr/lib/systemd/system/sag2is1105.service
TimeoutStopSec=500 <<< add/change this property in the [Service] section.
# systemctl daemon-reload
# systemctl start sagis1105
Note:
If you later re-register the daemon with daemon.sh, then this manual change gets reset back to default.