I would like to have systemd start up a number of processing servers for a RabbitMQ RPC queue. I tried to follow the example in [Have SystemD spawn N processes?](https://unix.stackexchange.com/questions/288236/have-systemd-spawn-n-processes) to have a single
systemctl
command to start/stop the servers.
Here are my unit file and template file.
ansiblepbserver@.service:
[Unit]
Description=RabbitMQ rpc queue server instance %i for ansiblePB_rpc_queue
Requires=rabbitmq-server.servic
After=multi-user.target rabbitmq-server.service
StopWhenUnneeded=yes
[Service]
PermissionsStartOnly=true
Type=idle
User=secretuser
ExecStart=/usr/bin/python /app/bin/ansibleplaybookserver.py
Restart=always
RestartSec=10
[Install]
WantedBy=ansiblePB.servers.service
ansiblePB.servers.service
:
[Unit]
Description=Controlling service for the multiple ansiblePB servers
[Install]
WantedBy=multi-user.target
Workflow:
1. Enable servers:
sudo systemctl enable ansibleserver@{1..2}.service
2. Start everything for the first time
sudo systemctl start ansiblePB.servers.service
It fails with:
Failed to start ansiblePB.servers.service: Unit is not loaded properly: Invalid argument.
See system logs and 'systemctl status ansiblePB.servers.service' for details.
Status gives me:
ansiblePB.servers.service lacks both ExecStart= and ExecStop= setting. Refusing.
The docs say have to have at least ExecStart
or ExecStop
, but the example in the weblink above does not include either and I don't know what I would set them to.
Any ideas?
Asked by bldrchphd
(1 rep)
Mar 4, 2020, 10:10 PM
Last activity: Mar 5, 2020, 12:07 PM
Last activity: Mar 5, 2020, 12:07 PM