[systemd-devel] Permissions problems with systemd-networkd and others.

2024-02-06 Thread Murrell, Robert A.
Greetings,

I’m attempting to update one of our products from Debian Stretch with Linux 
kernel 4.14 to Debian Bullseye with Linux kernel 6.2.0.  The target system is 
an ARM iMX6QP.  I’ve managed to build the kernel from the old .config file.  
The image is built using ELBE builder and reprepro for local packages (not my 
choice).  This has been a very steep learning experience and I’m sure I have 
more tweaking to do.

I’m having a problem with systemd on startup.  System-networkd fails to run 
with the following error:

● systemd-networkd.service - Network Service
 Loaded: loaded (/lib/systemd/system/systemd-networkd.service; enabled; 
vendor preset: enabled)
 Active: failed (Result: exit-code) since Sun 2023-06-18 14:56:02 UTC; 2h 
42min ago
TriggeredBy: ● systemd-networkd.socket
   Docs: man:systemd-networkd.service(8)
Process: 233 ExecStart=/lib/systemd/systemd-networkd (code=exited, 
status=203/EXEC)
   Main PID: 233 (code=exited, status=203/EXEC)
CPU: 109ms

Jun 18 14:56:02 mspmbsat systemd[1]: systemd-networkd.service: Scheduled 
restart job, restart counter is at 5.
Jun 18 14:56:02 mspmbsat systemd[1]: Stopped Network Service.
Jun 18 14:56:02 mspmbsat systemd[1]: systemd-networkd.service: Start request 
repeated too quickly.
Jun 18 14:56:02 mspmbsat systemd[1]: systemd-networkd.service: Failed with 
result 'exit-code'.

Jun 18 14:56:02 mspmbsat systemd[1]: Failed to start Network Service.

Systemd-resolvd and named have similar problems.  Running the program manually 
(from root) gives me this error:

~# /lib/systemd/systemd-networkd
Failed to open configuration file '/etc/systemd/networkd.conf': Permission 
denied
Failed to parse configuration file: Permission denied
Enumeration completed

Networkd.conf has 644 permissions.  I have noticed that systemd-networkd now 
has its own group systemd-network.  I’ve tried doing several things like adding 
systemd-network to root group and vise-versa, setting permissions on all 
affected files and paths to 777 (undesirable), but I still can’t get it to run. 
 I get a little farther, but ultimately end up wit a Permission denied error 
somewhere.


  1.  What do I need to do to get this working?
  2.  Why didn’t apt install properly configure it?

I can supply the elbe build log if that might help.  It is 2MB long.

Robert Murrell
Embedded Software Engineer
STANLEY Assembly Technologies

2500 Meijer Dr., Troy, MI 48084
T 248-677-9740
robert.murr...@sbdinc.com | 
www.StanleyEngineeredFastening.com

[http://esignature.stanleyblackanddecker.com/images/stanleyengineeredfastening.png]

This email, including any attached files, is intended only for the person to 
whom or the entity to which it is addressed and may contain confidential and/or 
privileged material. Any review, retransmission, dissemination or other use of, 
or taking of any action in reliance upon, this information by persons or 
entities other than the intended recipient is prohibited. If you received this 
in error, please contact the sender and delete the material from any computer.



This message and any attachments may contain Stanley Black & Decker 
confidential information. Any unauthorized review, use, disclosure or 
distribution of any such information is prohibited. If you are not the intended 
recipient, please contact the sender and delete all copies.

Este mensaje y los archivos adjuntos pueden contener informacion confidencial 
de Stanley Black & Decker. Se prohibe cualquier revision, uso, divulgacion o 
distribucion no autorizados de dicha informacion. Si no es el destinatario 
previsto, comuniquese con el remitente y elimine todas las copias.

本?件及其附件可能包含史丹利百得公司的保密信息。非?授?,任何人不得??、使用、披露或?播??信息。若?不是收件人,???系?件人并?除所有内容。??。


Re: [systemd-devel] Submitting a service activation to remote mounts success

2024-02-06 Thread Demi Marie Obenour
On Tue, Feb 06, 2024 at 05:06:02PM +0100, Silvio Knizek wrote:
> Am Dienstag, dem 06.02.2024 um 16:15 +0100 schrieb Thomas HUMMEL:
> > Hello,
> >=20
> > I'm using systemd-239-74 on RHEL 8.8 EUS.
> >=20
> > I was wondering if one can express the following :
> >=20
> > start some service *only and only if/when* all remote mounts (ex: nfs,=
> =20
> > some parallel fs) has *succeeded*, taking into account it may take some=
> =20
> > time for some mount (some fs clients just live curl | sh themselves at=
> =20
> > start !) to finish (which seems to exlude usage of=20
> > AssertPathIsMountPoint for instance, as it would not wait, or would it ?)
> >=20
> > I have no auto option in the fstab for those fs and they use the _netdev=
> =20
> > option
> >=20
> > Obvisouly I could statically list all the mounts units as an ordering=20
> > dependency but this is not what I was looking for as there are namy (and=
> =20
> > I'm not even sure - see below - it it would be enough)
> >=20
> > Exploring this question I stumbled upon the following points :
> >=20
> > my understanding is that:
> >=20
> > 1. remote-fs.target special target is pulled in by multi-user.target and=
> =20
> > is added by systemd-fstab-generator as a Before=3D ordering dep to all=
> =20
> > remote .mount units
> >=20
> > -> I also see a remote-fs.target has a Requires=3D=20
> > activation dep : I probably missed it in the doc but I don't see this=20
> > listed in neither implicit nor default dep : where does it come from ?
> >=20
> > 2. Before=3D/After=3D refer, in the case of service units, to when the un=
> it=20
> > has "finished starting up", this being defined by "when it returns=20
> > failed or success", which is dependent of the Type=3D of the service
> >=20
> > Is this understanding correct ?
> >=20
> > But when the unit is of type mount : what's the semantic of Before/After=
> =20
> > ? (I don't think I saw it in the doc neither)
> >=20
> > What's the meaning/use of Type=3Dnone in a .mount unit ?
> >=20
> > My experience is that the mount may fail and remote-fs.target will still=
> =20
> > be reached, even if one replace Requires with BindsTo, correct ?
> >=20
> > So success or failure of the mount process does not seem to be involved=
> =20
> > in the ordering dep, or does it ?
> >=20
> > Thanks for your help
> 
> Hi Thomas,
> 
> RequiresMountsFor=3D should be your friend. It just takes a space-
> separated list of paths and does all the other stuff by itself.
> 
> Another options would be to switch to x-systemd.automount in fstab for
> the network shares, so they will be mounted on first access, not
> necessary during early boot when there is no network.

FYI, it looks like your mailer used quoted-printable encoding, but
didn’t set the appropriate headers to indicate that this encoding is in
use.
-- 
Sincerely,
Demi Marie Obenour (she/her/hers)
Invisible Things Lab


signature.asc
Description: PGP signature


Re: [systemd-devel] Submitting a service activation to remote mounts success

2024-02-06 Thread Silvio Knizek
Am Dienstag, dem 06.02.2024 um 16:15 +0100 schrieb Thomas HUMMEL:
> Hello,
>=20
> I'm using systemd-239-74 on RHEL 8.8 EUS.
>=20
> I was wondering if one can express the following :
>=20
> start some service *only and only if/when* all remote mounts (ex: nfs,=
=20
> some parallel fs) has *succeeded*, taking into account it may take some=
=20
> time for some mount (some fs clients just live curl | sh themselves at=
=20
> start !) to finish (which seems to exlude usage of=20
> AssertPathIsMountPoint for instance, as it would not wait, or would it ?)
>=20
> I have no auto option in the fstab for those fs and they use the _netdev=
=20
> option
>=20
> Obvisouly I could statically list all the mounts units as an ordering=20
> dependency but this is not what I was looking for as there are namy (and=
=20
> I'm not even sure - see below - it it would be enough)
>=20
> Exploring this question I stumbled upon the following points :
>=20
> my understanding is that:
>=20
> 1. remote-fs.target special target is pulled in by multi-user.target and=
=20
> is added by systemd-fstab-generator as a Before=3D ordering dep to all=
=20
> remote .mount units
>=20
> -> I also see a remote-fs.target has a Requires=3D=20
> activation dep : I probably missed it in the doc but I don't see this=20
> listed in neither implicit nor default dep : where does it come from ?
>=20
> 2. Before=3D/After=3D refer, in the case of service units, to when the un=
it=20
> has "finished starting up", this being defined by "when it returns=20
> failed or success", which is dependent of the Type=3D of the service
>=20
> Is this understanding correct ?
>=20
> But when the unit is of type mount : what's the semantic of Before/After=
=20
> ? (I don't think I saw it in the doc neither)
>=20
> What's the meaning/use of Type=3Dnone in a .mount unit ?
>=20
> My experience is that the mount may fail and remote-fs.target will still=
=20
> be reached, even if one replace Requires with BindsTo, correct ?
>=20
> So success or failure of the mount process does not seem to be involved=
=20
> in the ordering dep, or does it ?
>=20
> Thanks for your help

Hi Thomas,

RequiresMountsFor=3D should be your friend. It just takes a space-
separated list of paths and does all the other stuff by itself.

Another options would be to switch to x-systemd.automount in fstab for
the network shares, so they will be mounted on first access, not
necessary during early boot when there is no network.

BR
Silvio


[systemd-devel] Submitting a service activation to remote mounts success

2024-02-06 Thread Thomas HUMMEL

Hello,

I'm using systemd-239-74 on RHEL 8.8 EUS.

I was wondering if one can express the following :

start some service *only and only if/when* all remote mounts (ex: nfs, 
some parallel fs) has *succeeded*, taking into account it may take some 
time for some mount (some fs clients just live curl | sh themselves at 
start !) to finish (which seems to exlude usage of 
AssertPathIsMountPoint for instance, as it would not wait, or would it ?)


I have no auto option in the fstab for those fs and they use the _netdev 
option


Obvisouly I could statically list all the mounts units as an ordering 
dependency but this is not what I was looking for as there are namy (and 
I'm not even sure - see below - it it would be enough)


Exploring this question I stumbled upon the following points :

my understanding is that:

1. remote-fs.target special target is pulled in by multi-user.target and 
is added by systemd-fstab-generator as a Before= ordering dep to all 
remote .mount units


-> I also see a remote-fs.target has a Requires= 
activation dep : I probably missed it in the doc but I don't see this 
listed in neither implicit nor default dep : where does it come from ?


2. Before=/After= refer, in the case of service units, to when the unit 
has "finished starting up", this being defined by "when it returns 
failed or success", which is dependent of the Type= of the service


Is this understanding correct ?

But when the unit is of type mount : what's the semantic of Before/After 
? (I don't think I saw it in the doc neither)


What's the meaning/use of Type=none in a .mount unit ?

My experience is that the mount may fail and remote-fs.target will still 
be reached, even if one replace Requires with BindsTo, correct ?


So success or failure of the mount process does not seem to be involved 
in the ordering dep, or does it ?


Thanks for your help

--
Thomas HUMMEL


Re: [systemd-devel] network signals

2024-02-06 Thread ashok athukuri
Hello Mantas,

Thanks for the quick response, Here is what I get for GetLinkByName

//busctl call org.freedesktop.network1 /org/freedesktop/network1
org.freedesktop.network1.Manager GetLinkByName s wlan0
//io 4 "/org/freedesktop/network1/link/_34"

1. I am subscribing to signal like below, Does that work?
2. how can I add another like link "eth0" for signals? subscribe separately?


g_dbus_connection_signal_subscribe (connection,// GDBusConnection

/*"org.freedesktop.network1"*/ NULL,//sender name to match on (unique or
well-known name) or NULL to listen from all senders

"org.freedesktop.DBus.Properties",//D-Bus interface name to match on or
NULL to match on all interfaces

"PropertiesChanged",//D-Bus signal name to match on or NULL to match on all
signals

"*/org/freedesktop**/network1/link/_34*",//object path to match on or NULL
to match on all object paths

NULL,//contents of first string argument to match on or NULL to match on
all kinds of arguments

G_DBUS_SIGNAL_FLAGS_NONE,//GDBusSignalFlags describing how arg0 is used in
subscribing to the signal

linkStatusMonitorCallBack,//callback to invoke when there is a signal
matching the requested data

nullptr,//user data to pass to callback

NULL);//function to free user_data with when subscription is removed or
NULL

Thanks,

Ashok

On Tue, Feb 6, 2024 at 5:11 PM Mantas Mikulėnas  wrote:

> /org/freedesktop/network1 is the toplevel object that represents the
> networkd daemon as a whole. Interface-specific signals would be sent for
> the object paths of the individual interfaces, so you need to either:
>
> a) call *GetLinkByName()* on the toplevel object to find the interface
> object, and then subscribe for signals on that;
>
> or b) instead of filtering by path='/xx', filter by *path_namespace='/xx'
> *so that it will also match child objects.
>
> On Tue, Feb 6, 2024 at 10:30 AM ashok athukuri 
> wrote:
>
>> Hello All,
>>
>>
>> I'm trying to use DBUS signal "PropertiesChanged" of
>> org.freedesktop.network1 /org/freedesktop/network1 *to detect network
>> interface is up or down OR the speed of the interface is changed.*
>>
>> Is it possible? using a subscription to "PropertiesChanged" signal via
>> the below interface or PATH ?
>> If yes, how to test those, Currently I don't see any anything on my
>> dbus-monitor.
>>
>> Here is how I am testing :
>>
>> *# dbus-monitor --system "type='signal',path='/org/freede*
>>
>>
>> *sktop/network1'"#ifconfig wlan0 down*
>>
>> # busctl introspect org.freedesktop.network1 /org/freedesktop/network1
>> NAMETYPE  SIGNATURE RESULT/VALUE FLAGS
>> org.freedesktop.DBus.Introspectable interface - --
>> .Introspect method- s-
>> org.freedesktop.DBus.Peer   interface - --
>> .GetMachineId   method- s-
>> .Ping   method- --
>> org.freedesktop.DBus.Properties interface - --
>> .Getmethodssv-
>> .GetAll methods a{sv}-
>> .Setmethodssv   --
>> .PropertiesChanged  signalsa{sv}as  --
>> org.freedesktop.network1.Managerinterface - --
>> .Describe   method- s-
>> .DescribeLink   methodi s-
>> .ForceRenewLink methodi --
>> .GetLinkByIndex methodi so   -
>> .GetLinkByName  methods io   -
>> .ListLinks  method- a(iso)   -
>> .ReconfigureLinkmethodi --
>> .Reload method- --
>> .RenewLink  methodi --
>> .RevertLinkDNS  methodi --
>> .RevertLinkNTP  methodi --
>> .SetLinkDNS methodia(iay)   --
>> .SetLinkDNSEx   methodia(iayqs) --
>> .SetLinkDNSOverTLS  methodis--
>> .SetLinkDNSSEC  methodis--
>> .SetLinkDNSSECNegativeTrustAnchors  methodias   --
>> .SetLinkDefaultRoutemethodib--
>> .SetLinkDomains methodia(sb)--
>> .SetLinkLLMNR   methodis--
>> .SetLinkMulticastDNSmethodis--
>> .SetLinkNTP methodias   --
>> .AddressState

Re: [systemd-devel] network signals

2024-02-06 Thread Mantas Mikulėnas
/org/freedesktop/network1 is the toplevel object that represents the
networkd daemon as a whole. Interface-specific signals would be sent for
the object paths of the individual interfaces, so you need to either:

a) call *GetLinkByName()* on the toplevel object to find the interface
object, and then subscribe for signals on that;

or b) instead of filtering by path='/xx', filter by *path_namespace='/xx' *so
that it will also match child objects.

On Tue, Feb 6, 2024 at 10:30 AM ashok athukuri 
wrote:

> Hello All,
>
>
> I'm trying to use DBUS signal "PropertiesChanged" of
> org.freedesktop.network1 /org/freedesktop/network1 *to detect network
> interface is up or down OR the speed of the interface is changed.*
>
> Is it possible? using a subscription to "PropertiesChanged" signal via the
> below interface or PATH ?
> If yes, how to test those, Currently I don't see any anything on my
> dbus-monitor.
>
> Here is how I am testing :
>
> *# dbus-monitor --system "type='signal',path='/org/freede*
>
>
> *sktop/network1'"#ifconfig wlan0 down*
>
> # busctl introspect org.freedesktop.network1 /org/freedesktop/network1
> NAMETYPE  SIGNATURE RESULT/VALUE FLAGS
> org.freedesktop.DBus.Introspectable interface - --
> .Introspect method- s-
> org.freedesktop.DBus.Peer   interface - --
> .GetMachineId   method- s-
> .Ping   method- --
> org.freedesktop.DBus.Properties interface - --
> .Getmethodssv-
> .GetAll methods a{sv}-
> .Setmethodssv   --
> .PropertiesChanged  signalsa{sv}as  --
> org.freedesktop.network1.Managerinterface - --
> .Describe   method- s-
> .DescribeLink   methodi s-
> .ForceRenewLink methodi --
> .GetLinkByIndex methodi so   -
> .GetLinkByName  methods io   -
> .ListLinks  method- a(iso)   -
> .ReconfigureLinkmethodi --
> .Reload method- --
> .RenewLink  methodi --
> .RevertLinkDNS  methodi --
> .RevertLinkNTP  methodi --
> .SetLinkDNS methodia(iay)   --
> .SetLinkDNSEx   methodia(iayqs) --
> .SetLinkDNSOverTLS  methodis--
> .SetLinkDNSSEC  methodis--
> .SetLinkDNSSECNegativeTrustAnchors  methodias   --
> .SetLinkDefaultRoutemethodib--
> .SetLinkDomains methodia(sb)--
> .SetLinkLLMNR   methodis--
> .SetLinkMulticastDNSmethodis--
> .SetLinkNTP methodias   --
> .AddressState   property  s "routable"
> emits-change
> .CarrierState   property  s "carrier"
>  emits-change
> .IPv4AddressState   property  s "routable"
> emits-change
> .IPv6AddressState   property  s "routable"
> emits-change
> .NamespaceIdproperty  t 4026531840   const
> .OnlineStateproperty  s "partial"
>  emits-change
> .OperationalState   property  s "routable"
> emits-change
> root@MK3AC-WS100269:/var/lib/evse/cache#
>
> Thanks,
> Ashok
>
>

-- 
Mantas Mikulėnas


[systemd-devel] network signals

2024-02-06 Thread ashok athukuri
Hello All,


I'm trying to use DBUS signal "PropertiesChanged" of
org.freedesktop.network1 /org/freedesktop/network1 *to detect network
interface is up or down OR the speed of the interface is changed.*

Is it possible? using a subscription to "PropertiesChanged" signal via the
below interface or PATH ?
If yes, how to test those, Currently I don't see any anything on my
dbus-monitor.

Here is how I am testing :

*# dbus-monitor --system "type='signal',path='/org/freede*


*sktop/network1'"#ifconfig wlan0 down*

# busctl introspect org.freedesktop.network1 /org/freedesktop/network1
NAMETYPE  SIGNATURE RESULT/VALUE FLAGS
org.freedesktop.DBus.Introspectable interface - --
.Introspect method- s-
org.freedesktop.DBus.Peer   interface - --
.GetMachineId   method- s-
.Ping   method- --
org.freedesktop.DBus.Properties interface - --
.Getmethodssv-
.GetAll methods a{sv}-
.Setmethodssv   --
.PropertiesChanged  signalsa{sv}as  --
org.freedesktop.network1.Managerinterface - --
.Describe   method- s-
.DescribeLink   methodi s-
.ForceRenewLink methodi --
.GetLinkByIndex methodi so   -
.GetLinkByName  methods io   -
.ListLinks  method- a(iso)   -
.ReconfigureLinkmethodi --
.Reload method- --
.RenewLink  methodi --
.RevertLinkDNS  methodi --
.RevertLinkNTP  methodi --
.SetLinkDNS methodia(iay)   --
.SetLinkDNSEx   methodia(iayqs) --
.SetLinkDNSOverTLS  methodis--
.SetLinkDNSSEC  methodis--
.SetLinkDNSSECNegativeTrustAnchors  methodias   --
.SetLinkDefaultRoutemethodib--
.SetLinkDomains methodia(sb)--
.SetLinkLLMNR   methodis--
.SetLinkMulticastDNSmethodis--
.SetLinkNTP methodias   --
.AddressState   property  s "routable"
emits-change
.CarrierState   property  s "carrier"
 emits-change
.IPv4AddressState   property  s "routable"
emits-change
.IPv6AddressState   property  s "routable"
emits-change
.NamespaceIdproperty  t 4026531840   const
.OnlineStateproperty  s "partial"
 emits-change
.OperationalState   property  s "routable"
emits-change
root@MK3AC-WS100269:/var/lib/evse/cache#

Thanks,
Ashok