Home > Blockchain >  Systemd service with multiple execStart and watchdog for each execStart
Systemd service with multiple execStart and watchdog for each execStart

Time:02-13

I would know if it's possible to create service with multiple execStart where I can monitor each execStart with a watchdog such as:

[Unit]
Description="test service"

[Service]
Type=oneshot
ExecStart=/home/program1
ExecStart=/home/program2
WatchdogSec= 2
Restart=on-failure
RestartSec= 1


[Install]
WantedBy=default.target

Or it's better if I use template service for example [email protected] with this syntax:

[Unit]
Description="test service %i"

[Service]
ExecStart=/home/%i
WatchdogSec= 2
Restart=on-failure
RestartSec= 1

[Install]
WantedBy=default.target

Thanks in advance.

CodePudding user response:

I found that using the template service is the better solution and covers what I need. Thanks to you all.

  • Related