I'd like to know if there's a way with Systemd to restart A.service (After) when B.service get started or reloaded (reload config only), if possible without editing B.service which is installed and upgraded by the system.A.service should start even if B.service is not installed, disabled or stopped.A.service:[Unit]After = B.service network-online.targetWants = B.service[Service]Type=oneshotExecStart = /script.sh startExecStop = /script.sh stopRemainAfterExit=yes[Install]WantedBy = network-online.targetB.service:[Unit]After=syslog.target network.target[Service]Type=forkingExecStart=/cmd startExecStop=/cmd stopExecReload=/cmd reloadPIDFile=/var/run/cmd.pid[Install]WantedBy=multi-user.target
Systemd Unit service restart if another service start or reload
systemd