Installer 10.7 | Complete Installation and Upgrade Information for Software AG Products | Installing Software AG Products On Premises | Registering Daemons to Automatically Start and Shut Down Products on UNIX Systems | Daemon Registration Examples for SLES 12+ and RHEL 7+ (systemd)
 
Daemon Registration Examples for SLES 12+ and RHEL 7+ (systemd)
Register a daemon for Universal Messaging (SLES 12+, RHEL 7+, systemd) and Specify Startup Order
Suppose you installed Integration Server and Universal Messaging and during installation you selected Register Windows service/UNIX daemon for automatic startup for Integration Server and its dependent component Platform Manager. To have a daemon registration for Universal Messaging you would perform these steps:
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.
Suppose you want Universal Messaging to start before Integration Server at system boot time. You would perform these steps:
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
Register Daemon for Universal Messaging (Solaris, initd) and Specify Startup Order
Suppose you installed Integration Server and Universal Messaging and during installation you selected Register Windows service/UNIX daemon for automatic startup for Integration Server and its dependent component Platform Manager. To have a daemon registration for Universal Messaging you would perform these steps:
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
After installing the daemons, 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 the 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, specify a lower start number like '-S 10'.
A similar handling applies for the shutdown sequence, where we have a stop (kill) number that can be specified with the 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)

The command output shows all the file operations that 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.