I have a system composed of about 15 services. They have no inter-dependencies (i.e. no service require another to start) and they notify systemd when there start-up is finished (i.e. Type=notify
).
The problem is that if I start them all at the same time my system is overloaded and processes are killed due to systemd timeout.
What I want to do is "group" my services so they start one after the other is no particular order. Is this possible with systemd service file?
BTW: here is a template of my service file:
[Unit]
Description=Template service file
After=network.target
[Service]
Type=notify
User=1000
Group=1000
# Set the working directory and the binary to start
WorkingDirectory=/home/user/
ExecStart=/path/to/some/process
# The standard input and output are useless (i.e. unused by the process)
StandardInput=null
StandardOutput=null
# Disable the standard error because all logs are already saved in a specific directory
StandardError=null
# Send SIGTERM then SIGKILL after TimeoutStopSec seconds (default: 2)
KillMode=mixed
TimeoutStopSec=2
# Setup a start timeout
TimeoutStartSec=30
# On abnormal (i.e. non 0 exit code or killed by a signal) termination restart the process after RestartSec seconds (default: 5)
Restart=on-failure
RestartSec=5
# Authorise process restart only 5 times maximum in a 120 seconds interval
StartLimitBurst=5
StartLimitInterval=120
# Set watchdog timeout (default: 10)
WatchdogSec=10
NotifyAccess=main
# Set security options
NoNewPrivileges=yes
[Install]
WantedBy=custom.target
Thank you for your help
After=
to daisy chain the groupings...