Re: [systemd-devel] Help with running a script at shutdown and make it run first before other services

2024-12-06 Thread Andrei Borzenkov
07.12.2024 01:16, David Elie-Dit-Cosaque wrote: Hi All, I am trying to create a systemd service that would execute a script at shutdown before any other services start receiving shutdown notifications. You could try mkdir -p /etc/systemd/system/-.service.d cat > /etc/systemd/system/-.service.

Re: [systemd-devel] Help with running a script at shutdown and make it run first before other services

2024-12-06 Thread David Elie-Dit-Cosaque
Thanks for your reply, I tried this before but could not make it work as I wanted to. If I remember well, the service kept starting during boot instead of shutdown. After struggling with it I found this page: https://unix.stackexchange.com/questions/39226/how-to-run-a-script-with-systemd-right-befo

Re: [systemd-devel] Help with running a script at shutdown and make it run first before other services

2024-12-06 Thread Nils Kattenbeck
You should probably just use an ExecStart= (not with the stop you are currently using), have it WantedBy=shutdown.target, and Before= any service which you depend on to still be available On Sat, Dec 7, 2024, 00:30 David Elie-Dit-Cosaque wrote: > Hi All, > > I am trying to create a systemd servi

[systemd-devel] Help with running a script at shutdown and make it run first before other services

2024-12-06 Thread David Elie-Dit-Cosaque
Hi All, I am trying to create a systemd service that would execute a script at shutdown before any other services start receiving shutdown notifications. I came up with this: [Service] Type=oneshot RemainAfterExit=true ExecStart=/usr/bin/true ExecStop=/usr/local/bin/myscript.sh [Install] WantedBy

[systemd-devel] First? non-systemd app using sd-varlink

2024-12-06 Thread Thorsten Kukuk
Hi, in the last days I rewrote openSUSEs rebootmgr to only use sd-varlink, sd-json and sd-event. It was still based on original libdbus, pthreads, timers and other stuff not really fitting together. Using sd-varlink was really simple, even with the missing documentation. I struggled much more wit