In recent Linux OS, Systemd services are used instead of init.d services.
Example of a configuration with Systemd service for the Automic Service Manager to autostart / autostop the Linux Agent upon system shutdown/startup.
cat /usr/lib/systemd/system/automicsm.service
#################################################
[Unit]
Description=Automic Service Manager
After=network.target
[Service]
Type=oneshot
RemainAfterExit=yes
User=uc4exe
ExecStart=/opt/Automic/automicsm start
ExecStop=/opt/Automic/automicsm stop
[Install]
WantedBy=default.target
#####################################################
#####################################################
# systemctl status automicsm
automicsm.service - Automic Service Manager
Loaded: loaded (/opt/Automic/automicsm.service; enabled; vendor preset: disabled)
Active: active (exited) since Tue 2020-09-08 14:37:00 CEST; 2 months 21 days ago
Main PID: 21347 (code=exited, status=0/SUCCESS)
Tasks: 989
CGroup: /system.slice/automicsm.service
|- 590 dw.<sap system>pf=/usr/sap/xyz/SYS/profile/<sap system/service>
|- 751 dw.<sap system>pf=/usr/sap/xyz/SYS/profile/<sap system/service>
|- 759 dw.<sap system>pf=/usr/sap/xyz/SYS/profile/<sap system/service>
|- 787 dw.<sap system>pf=/usr/sap/xyz/SYS/profile/<sap system/service>
|- 794 dw.<sap system>pf=/usr/sap/xyz/SYS/profile/<sap system/service>
|- 800 dw.<sap system>pf=/usr/sap/xyz/SYS/profile/<sap system/service>
|- 1461 dw.<sap system>pf=/usr/sap/xyz/SYS/profile/<sap system/service>
|- 2340 /usr/sap/xyz/sap_system/exe/jstart -appTrc -nodeId=3 pf=/usr/sap/xyz/SYS/profile/<sap system/service>-DSAPINFO=xyz>
|- 2341 /usr/sap/xyz/sap_system/exe/jstart -appTrc -nodeId=2 pf=/usr/sap/xyz/SYS/profile/<sap system/service>-DSAPINFO=xyz>
|- 2481 dw.<sap system>pf=/usr/sap/xyz/SYS/profile/<sap system/service>
When we stop this service using systemctl, all the subprocesses (running Jobs) are also stopped.
How can we change this behavior?
Release : 12.3
Component : AUTOMATION ENGINE
Not Automic related, systemd service configuration related.