>>> Reindl Harald <h.reindl@xxxxxxxxxxxxx> schrieb am 10.06.2020 um 12:27 in Nachricht <2556aec7-0a35-ef09-ff05-e33cba1f1a0f@xxxxxxxxxxxxx>: > > Am 10.06.20 um 11:46 schrieb Ulrich Windl: >>>>> Reindl Harald <h.reindl@xxxxxxxxxxxxx> schrieb am 10.06.2020 um 08:57 in >> Nachricht >> <24655_1591772239_5EE0844E_24655_111_1_4d778c1b‑9150‑c64e‑574b‑e5beb1b68d6a@thel >> unge.net>: >> >>> >>> Am 10.06.20 um 05:27 schrieb Baskaran, Vinothkumar: >>>> Hi Reindal, >>>> >>>> Thanks for the inputs. >>>> >>>> In my case, the service is successfully started. The pre‑script's return >>> status is also success. Please find the output below. Still, ExecStop > doesn't >>> get invoked. I tried replacing it with ExecStopPost, it gets invoked >>> successfully. But, ExecStopPost cannot be used, since it gets invoked on >>> failed cases too. >>> >>> your subject "ExecStop doesn't get called when service crashes" simply >>> makes no sense at all then because that's what a failed case is >> >> Interesting case: Would FailureAction= be called then? > > when the main prcoess crashes surely, that's what it's all about but > none of the actions are appealing for most services :‑) Sorry, I missed to recognize that the actions are not user-difinable, but from a set of pre-configured actions. Maybe a ExecFailurePost= (Action to perform _after_ a failure (unexpected end of service) was detected) is needed ;-) > > FailureAction=, SuccessAction= > Configure the action to take when the unit stops and enters a failed > state or inactive state. Takes one of none, reboot, reboot‑force, > reboot‑immediate, poweroff, poweroff‑force, poweroff‑immediate, exit, > and exit‑force. In system mode, all options are allowed. In user mode, > only none, exit, and exit‑force are allowed. Both options default to none. > > If none is set, no action will be triggered. reboot causes a reboot > following the normal shutdown procedure (i.e. equivalent to systemctl > reboot). reboot‑force causes a forced reboot which will terminate all > processes forcibly but should cause no dirty file systems on reboot > (i.e. equivalent to systemctl reboot ‑f) and reboot‑immediate causes > immediate execution of the reboot(2) system call, which might result in > data loss (i.e. equivalent to systemctl reboot ‑ff). Similarly, > poweroff, poweroff‑force, poweroff‑immediate have the effect of powering > down the system with similar semantics. exit causes the manager to exit > following the normal shutdown procedure, and exit‑force causes it > terminate without shutting down services. When exit or exit‑force is > used by default the exit status of the main process of the unit (if this > applies) is returned from the service manager. However, this may be > overridden with FailureActionExitStatus=/SuccessActionExitStatus=, see > below. > _______________________________________________ > systemd‑devel mailing list > systemd‑devel@xxxxxxxxxxxxxxxxxxxxx > https://lists.freedesktop.org/mailman/listinfo/systemd‑devel _______________________________________________ systemd-devel mailing list systemd-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/systemd-devel