Re: [systemd-devel] How can I simply check that a service has been restarted ?

2020-11-10 Thread Arian Van Putten
I think what you might want is `Type=exec` instead of `Type=simple` in your unit file. It was recently added to systemd. then `systemctl restart` will return a failure when the main process fails to start. I hope that helps. On Tue, Nov 10, 2020 at 11:50 AM Francis Moreau wrote: > On Tue,

[systemd-devel] systemd-rfkill.service: Failed to set up special execution directory in /var/lib: Read-only file system

2020-11-10 Thread Mark Rogers
I have a Raspberry Pi-based development kiosk system which has been working fine for ages. But without having made any changes that I can relate to the boot sequence, it now errors on startup with multiple: [FAILED] Failed to start Load/Save RF Kill Switch Status errors, and also a single

[systemd-devel] How can I simply check that a service has been restarted ?

2020-11-10 Thread Francis Moreau
Hello, After restarting a service with "systemctl try-restart ..." I want to verify that the service has been restarted. How can I reliably do this without using the dbus API ? Thank you -- Francis ___ systemd-devel mailing list

Re: [systemd-devel] How can I simply check that a service has been restarted ?

2020-11-10 Thread Lennart Poettering
On Di, 10.11.20 10:28, Francis Moreau (francis.m...@gmail.com) wrote: > Hello, > > After restarting a service with "systemctl try-restart ..." I want to > verify that the service has been restarted. > > How can I reliably do this without using the dbus API ? D-Bus is how systemd exposes its

Re: [systemd-devel] How can I simply check that a service has been restarted ?

2020-11-10 Thread Francis Moreau
On Tue, Nov 10, 2020 at 11:30 AM Lennart Poettering wrote: > > On Di, 10.11.20 10:28, Francis Moreau (francis.m...@gmail.com) wrote: > > > Hello, > > > > After restarting a service with "systemctl try-restart ..." I want to > > verify that the service has been restarted. > > > > How can I

Re: [systemd-devel] How can I simply check that a service has been restarted ?

2020-11-10 Thread Francis Moreau
On Tue, Nov 10, 2020 at 12:47 PM Arian Van Putten wrote: > > I think what you might want is `Type=exec` instead of `Type=simple` in your > unit file. It was recently added to systemd. > > then `systemctl restart` will return a failure when the main process fails to > start. I hope that helps.

Re: [systemd-devel] How can I simply check that a service has been restarted ?

2020-11-10 Thread Luca Boccassi
On Tue, 2020-11-10 at 11:50 +0100, Francis Moreau wrote: > On Tue, Nov 10, 2020 at 11:30 AM Lennart Poettering > wrote: > > On Di, 10.11.20 10:28, Francis Moreau (francis.m...@gmail.com) wrote: > > > > > Hello, > > > > > > After restarting a service with "systemctl try-restart ..." I want to >

Re: [systemd-devel] How to dynamically retrieve my service name?

2020-11-10 Thread Etienne Doms
Ok it seems /org/freedesktop/systemd1/unit/self is exactly what I was looking for. Thank you for your fast response. Le mar. 10 nov. 2020 à 18:23, Mantas Mikulėnas a écrit : > > You can call org.freedesktop.systemd1.Manager.GetUnitByPID() to directly get > the D-Bus object path based on your

Re: [systemd-devel] Query currently active journald configuration option

2020-11-10 Thread Andrei Borzenkov
09.11.2020 19:09, Lennart Poettering пишет: > On Mo, 09.11.20 08:48, Andrei Borzenkov (arvidj...@gmail.com) wrote: > >> Is it possible to query configuration options in effect in running >> journald instance? > > Besides the brief log output it does itself, no there's currently no > way. > > We

[systemd-devel] sd_bus. Message refrence count between sd_bus_call_async callback and sd_bus_process.

2020-11-10 Thread igo95862
Calling sd_bus_process with second parameter as sd_bus_message** will put a new message in to that pointer. The man page says that the caller should unref it ,however, I found out that if you do that it will get garbage collected before a callback registed with sd_bus_call_async will get a

Re: [systemd-devel] How to dynamically retrieve my service name?

2020-11-10 Thread Mantas Mikulėnas
You can call org.freedesktop.systemd1.Manager.GetUnitByPID() to directly get the D-Bus object path based on your PID. There is also the magic path "/org/freedesktop/systemd1/unit/self" which always gives properties of the same service (or scope) that you're in. Finally, it is possible to call

Re: [systemd-devel] How can I simply check that a service has been restarted ?

2020-11-10 Thread Luca Boccassi
On Tue, 2020-11-10 at 17:22 +, Luca Boccassi wrote: > On Tue, 2020-11-10 at 18:12 +0100, Francis Moreau wrote: > > On Tue, Nov 10, 2020 at 2:43 PM Luca Boccassi wrote: > > > On Tue, 2020-11-10 at 11:50 +0100, Francis Moreau wrote: > > > > On Tue, Nov 10, 2020 at 11:30 AM Lennart Poettering >

[systemd-devel] How to dynamically retrieve my service name?

2020-11-10 Thread Etienne Doms
Hello, My service needs to behave a bit differently when it has been automatically because of a software fault. I use the "Restart=on-failure", and I understand that I can read the "NRestarts" property which is incremented whenever the service is restarted. The thing is, inside my service, I

Re: [systemd-devel] How can I simply check that a service has been restarted ?

2020-11-10 Thread Francis Moreau
On Tue, Nov 10, 2020 at 2:43 PM Luca Boccassi wrote: > > On Tue, 2020-11-10 at 11:50 +0100, Francis Moreau wrote: > > On Tue, Nov 10, 2020 at 11:30 AM Lennart Poettering > > wrote: > > > On Di, 10.11.20 10:28, Francis Moreau (francis.m...@gmail.com) wrote: > > > > > > > Hello, > > > > > > > >

Re: [systemd-devel] How can I simply check that a service has been restarted ?

2020-11-10 Thread Luca Boccassi
On Tue, 2020-11-10 at 18:12 +0100, Francis Moreau wrote: > On Tue, Nov 10, 2020 at 2:43 PM Luca Boccassi wrote: > > On Tue, 2020-11-10 at 11:50 +0100, Francis Moreau wrote: > > > On Tue, Nov 10, 2020 at 11:30 AM Lennart Poettering > > > wrote: > > > > On Di, 10.11.20 10:28, Francis Moreau