Re: [systemd-devel] networkd D-Bus API for link up/down?
On Thu, Sep 22, 2022 at 9:45 AM Lennart Poettering wrote: > > On Mi, 21.09.22 06:48, Kevin P. Fleming (ke...@km6g.us) wrote: > > > When the D-Bus API for systemd-networkd was added there were > > indications that it could be used for bringing links up and down. > > However, when I review the API docs at: > > > > https://www.freedesktop.org/software/systemd/man/org.freedesktop.network1.html# > > > > I don't see any methods for doing those operations. networkctl uses > > netlink messages for these operations as well. > > > > I want to create a cluster resource agent for Pacemaker which can > > manage networkd links, and using D-Bus would be easier than using > > netlink since there is already D-Bus support in the resource agent for > > systemd units. > > This is currently not available. But do note that you can use > ActivationPolicy= in a .network file and then simply toggle the IFF_UP flag > on the net device, and networkd is happy. > > If you don#t want to bother with rtnetlink for that you could even use > the old BSD ioctls, i.e. SIOCSIFFLAGS. Thanks! I'm already using ActivationPolicy=manual in the .network file since networkd can't know when the interface should be up or down. For now I will use an OCF-style resource agent (fancy shell script) which uses 'networkctl' to do the work, but later I'll consider making something more 'native'. My primary motivation for having a 'native' RA is reducing the cost (time and CPU) of the regular monitoring operations; launching a shell script which sources many files of functions and has to parse 'networkctl --json' output is much more costly than using an ioctl to check the status of the interface directly. It's possible that using 'ip link' instead of 'networkctl' will be more efficient, so I may pursue that option too.
[systemd-devel] Automatic boot assessment -- Overwriting behaviour
Dear list, This is describing how boot counting is implemented in sd-boot: https://systemd.io/AUTOMATIC_BOOT_ASSESSMENT Consider a machine with boot configurations like this: $EFI/loader/entries/default+1.conf $EFI/loader/entries/default.conf Questions: 1. Will the boot-counted entry be loaded before the already-"good" one? 2. If so, will `systemd-bless-boot` move`default+1.conf` onto `default.conf` (thus overwriting it)? If both answers are "yes", would it be possible to mention it in the specs so that it is formally defined and unlikely to break in the future? Best, Gaël signature.asc Description: OpenPGP digital signature
Re: [systemd-devel] networkd D-Bus API for link up/down?
On Mi, 21.09.22 06:48, Kevin P. Fleming (ke...@km6g.us) wrote: > When the D-Bus API for systemd-networkd was added there were > indications that it could be used for bringing links up and down. > However, when I review the API docs at: > > https://www.freedesktop.org/software/systemd/man/org.freedesktop.network1.html# > > I don't see any methods for doing those operations. networkctl uses > netlink messages for these operations as well. > > I want to create a cluster resource agent for Pacemaker which can > manage networkd links, and using D-Bus would be easier than using > netlink since there is already D-Bus support in the resource agent for > systemd units. This is currently not available. But do note that you can use ActivationPolicy= in a .network file and then simply toggle the IFF_UP flag on the net device, and networkd is happy. If you don#t want to bother with rtnetlink for that you could even use the old BSD ioctls, i.e. SIOCSIFFLAGS. Lennart -- Lennart Poettering, Berlin
Re: [systemd-devel] path service ExecStart arguments
On Mi, 21.09.22 08:54, Ted Toth (txt...@gmail.com) wrote: > Is info about what changed (i.e. the name of the file created in the > directory) available to a path service ExecStart process? If so, how > does a service access the info? This is is generally not available on released versions of systemd. Current git main added some limited support for passing this in via env var, but this is useful for debugging only really, since multiple events can result in a single service invocation, and thus you lose events. Usually if you want this information for anything more than debugging, then things should be implemented differently, i.e. you get called and then scan yourself what is in the directory you watch. That makes things robust towards lost events. Lennart -- Lennart Poettering, Berlin
Re: [systemd-devel] Compile Standalone binaries
On Mi, 21.09.22 20:27, Caleb M. Hurley (hurleymca...@protonmail.com) wrote: > Having trouble compiling the standalone binaries for systemd; setup > a question at > https://unix.stackexchange.com/questions/718163/trouble-compiling-systemd-standalone-binaries Binaries of what precisely? Lennart -- Lennart Poettering, Berlin
[systemd-devel] Antw: [EXT] Re: Q: "Loaded: not-found (Reason: No such file or directory)"
>>> Michael Chapman schrieb am 22.09.2022 um 08:50 in Nachricht : > On Thu, 22 Sep 2022, Ulrich Windl wrote: >> Hi! >> >> I wonder: >> # systemctl status i* >> ● inst-sys.service >>Loaded: not-found (Reason: No such file or directory) >>Active: inactive (dead) >> >> ● iptables.service >>Loaded: not-found (Reason: No such file or directory) >>Active: inactive (dead) >> >> So I ttied to find out what's the problem with these servicres, but they > don't >> seem to exist actually: >> # systemctl cat iptables.service >> No files found for iptables.service. >> >> This is SLES12 SP5 (systemd-228). >> >> What can I do to resolve this (remove obsolete files, maybe)? >> >> Regards, >> Ulrich > > There is no problem here. systemd knows about those units because they are > referenced by other units, such as in Wants= directives. Actually it turned out to be a stupid error of myself: I had two directories in the CWD: inst-sys and iptables The correct command to use would have been # systemctl status i\* ;-) Ulrich > > - Michael
Re: [systemd-devel] Q: "Loaded: not-found (Reason: No such file or directory)"
On Thu, 22 Sep 2022, Ulrich Windl wrote: > Hi! > > I wonder: > # systemctl status i* > ● inst-sys.service >Loaded: not-found (Reason: No such file or directory) >Active: inactive (dead) > > ● iptables.service >Loaded: not-found (Reason: No such file or directory) >Active: inactive (dead) > > So I ttied to find out what's the problem with these servicres, but they don't > seem to exist actually: > # systemctl cat iptables.service > No files found for iptables.service. > > This is SLES12 SP5 (systemd-228). > > What can I do to resolve this (remove obsolete files, maybe)? > > Regards, > Ulrich There is no problem here. systemd knows about those units because they are referenced by other units, such as in Wants= directives. - Michael
[systemd-devel] Antw: [EXT] networkd D-Bus API for link up/down?
>>> "Kevin P. Fleming" schrieb am 21.09.2022 um 12:48 in >>> Nachricht : > When the D-Bus API for systemd-networkd was added there were > indications that it could be used for bringing links up and down. > However, when I review the API docs at: > > https://www.freedesktop.org/software/systemd/man/org.freedesktop.network1.ht > ml# > > I don't see any methods for doing those operations. networkctl uses > netlink messages for these operations as well. > > I want to create a cluster resource agent for Pacemaker which can > manage networkd links, and using D-Bus would be easier than using > netlink since there is already D-Bus support in the resource agent for > systemd units. Personally I think it's preferable to write a true OCF resource agent rather than using systemd unit in pacemaker. Pacemaker adds a lot of complexity, and things are much harder to debug. Regards, Ulrich
[systemd-devel] Q: "Loaded: not-found (Reason: No such file or directory)"
Hi! I wonder: # systemctl status i* ● inst-sys.service Loaded: not-found (Reason: No such file or directory) Active: inactive (dead) ● iptables.service Loaded: not-found (Reason: No such file or directory) Active: inactive (dead) So I ttied to find out what's the problem with these servicres, but they don't seem to exist actually: # systemctl cat iptables.service No files found for iptables.service. This is SLES12 SP5 (systemd-228). What can I do to resolve this (remove obsolete files, maybe)? Regards, Ulrich