Systemd prevent ExecStop upon systemctl restart <service>

30 Views Asked by At

Here is my sample service config, I want to only execute the ExecStop upon systemctl stop and skip that when systemctl restart, how is that possible ?

[Unit]
Description=Service Watchdog
After=network.target

[Service]
Type=simple
KillMode=process
ExecStart=/opt/watchdog/bin/monit -I
ExecStop=/opt/bin/monit stop all
ExecStop=/opt/watchdog/bin/monit quit
ExecReload=/opt/bin/monit reload
Restart=always
StandardOutput=null

[Install]
WantedBy=multi-user.target
0

There are 0 best solutions below