Can We Use SystenD Instead of InitD to Manage System start/stop?
search cancel

Can We Use SystenD Instead of InitD to Manage System start/stop?

book

Article ID: 215387

calendar_today

Updated On:

Products

Workload Automation Agent

Issue/Introduction

We have been asked if the Linux agent can be configured to use systemd rather than initD? As the installer configures Initd.

Environment

Release : All Supporte System Agents

Component : CA WORKLOAD AUTOMATION AGENT 

Resolution

You can use systemd to control the agent. The init.d scripts are automatically wrapped by systemd. The normal systemctl command will work.


For running agent

# systemctl status waae_agent-WA_AGENT
● waae_agent-WA_AGENT.service - LSB: Workload Automation System Agent
   Loaded: loaded (/etc/rc.d/init.d/waae_agent-WA_AGENT; bad; vendor preset: disabled)
   Active: active (running) since Fri 2021-04-16 17:40:25 EDT; 1 months 1 days ago
     Docs: man:systemd-sysv-generator(8)
  Process: 52229 ExecStop=/etc/rc.d/init.d/waae_agent-WA_AGENT stop (code=exited, status=0/SUCCESS)
  Process: 57517 ExecStart=/etc/rc.d/init.d/waae_agent-WA_AGENT start (code=exited, status=0/SUCCESS)
    Tasks: 60
   CGroup: /system.slice/waae_agent-WA_AGENT.service
           └─57530 ./cybAgent.bin -a

Apr 16 17:40:21 XXXXXXXXX.XXX.XXXX.XXX systemd[1]: Starting LSB: Workload Automation System Agent...
Apr 16 17:40:21 XXXXXXXXX.XXX.XXXX.XXX waae_agent-WA_AGENT[57517]: WAAE Agent (WA_AGENT) Agent service is starting...
Apr 16 17:40:25 XXXXXXXXX.XXX.XXXX.XXX waae_agent-WA_AGENT[57517]: Agent service has been started
Apr 16 17:40:25 XXXXXXXXX.XXX.XXXX.XXX waae_agent-WA_AGENT[57517]: [  OK  ]
Apr 16 17:40:25 XXXXXXXXX.XXX.XXXX.XXX systemd[1]: Started LSB: Workload Automation System Agent.


If we stop Agent

# systemctl stop waae_agent-WA_AGENT
# systemctl status waae_agent-WA_AGENT
● waae_agent-WA_AGENT.service - LSB: Workload Automation System Agent
   Loaded: loaded (/etc/rc.d/init.d/waae_agent-WA_AGENT; bad; vendor preset: disabled)
   Active: inactive (dead) since Tue 2021-05-18 21:44:05 EDT; 12s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 201231 ExecStop=/etc/rc.d/init.d/waae_agent-WA_AGENT stop (code=exited, status=0/SUCCESS)
  Process: 57517 ExecStart=/etc/rc.d/init.d/waae_agent-WA_AGENT start (code=exited, status=0/SUCCESS)

Apr 16 17:40:21 XXXXXXXXX.XXX.XXXX.XXX systemd[1]: Starting LSB: Workload Automation System Agent...
Apr 16 17:40:21 XXXXXXXXX.XXX.XXXX.XXX waae_agent-WA_AGENT[57517]: WAAE Agent (WA_AGENT) Agent service is starting...
Apr 16 17:40:25 XXXXXXXXX.XXX.XXXX.XXX waae_agent-WA_AGENT[57517]: Agent service has been started
Apr 16 17:40:25 XXXXXXXXX.XXX.XXXX.XXX waae_agent-WA_AGENT[57517]: [  OK  ]
Apr 16 17:40:25 XXXXXXXXX.XXX.XXXX.XXX systemd[1]: Started LSB: Workload Automation System Agent.
May 18 21:44:02 XXXXXXXXX.XXX.XXXX.XXX systemd[1]: Stopping LSB: Workload Automation System Agent...
May 18 21:44:05 XXXXXXXXX.XXX.XXXX.XXX waae_agent-WA_AGENT[201231]: WAAE Agent (WA_AGENT) Agent service is stopping...
May 18 21:44:05 XXXXXXXXX.XXX.XXXX.XXX waae_agent-WA_AGENT[201231]: Agent service has been stopped
May 18 21:44:05 XXXXXXXXX.XXX.XXXX.XXX waae_agent-WA_AGENT[201231]: stopped.
May 18 21:44:05 XXXXXXXXX.XXX.XXXX.XXX systemd[1]: Stopped LSB: Workload Automation System Agent.

start Agent

# systemctl start waae_agent-WA_AGENT
# systemctl status waae_agent-WA_AGENT
● waae_agent-WA_AGENT.service - LSB: Workload Automation System Agent
   Loaded: loaded (/etc/rc.d/init.d/waae_agent-WA_AGENT; bad; vendor preset: disabled)
   Active: active (running) since Tue 2021-05-18 21:44:51 EDT; 11s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 201231 ExecStop=/etc/rc.d/init.d/waae_agent-WA_AGENT stop (code=exited, status=0/SUCCESS)
  Process: 201639 ExecStart=/etc/rc.d/init.d/waae_agent-WA_AGENT start (code=exited, status=0/SUCCESS)
    Tasks: 58
   CGroup: /system.slice/waae_agent-WA_AGENT.service
           └─201651 ./cybAgent.bin -a

May 18 21:44:47 XXXXXXXXX.XXX.XXXX.XXX systemd[1]: Starting LSB: Workload Automation System Agent...
May 18 21:44:48 XXXXXXXXX.XXX.XXXX.XXX waae_agent-WA_AGENT[201639]: WAAE Agent (WA_AGENT) Agent service is starting...
May 18 21:44:51 XXXXXXXXX.XXX.XXXX.XXX waae_agent-WA_AGENT[201639]: Agent service has been started
May 18 21:44:51 XXXXXXXXX.XXX.XXXX.XXX waae_agent-WA_AGENT[201639]: [  OK  ]
May 18 21:44:51 XXXXXXXXX.XXX.XXXX.XXX systemd[1]: Started LSB: Workload Automation System Agent.