linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: pgnd <pgnd@dev-mail.net>
Cc: linux-hotplug@vger.kernel.org
Subject: Re: udev rule in /etc/udev/rules.d/ FAILS to exec on boot; but OK exec @ shell after boot ?
Date: Thu, 21 Dec 2023 09:17:58 +0100	[thread overview]
Message-ID: <2023122117-outlet-generic-f184@gregkh> (raw)
In-Reply-To: <fb9f85b9-cb79-427c-862f-bd33afe2fcbf@dev-mail.net>

On Wed, Dec 20, 2023 at 07:33:06PM -0500, pgnd wrote:
> i've created a udev rule to set IPv6 params
> 
> 	cat /etc/udev/rules.d/01-enp5s0-sysctl.rules
> 		ACTION=="add|bind|change", SUBSYSTEM=="net", KERNEL=="enp5s0", \
> 		 RUN+="/sbin/sysctl -qw \
> 		  net.ipv6.conf.enp5s0.forwarding=0 \
> 		  net.ipv6.conf.enp5s0.accept_ra=1 \
> 		  net.ipv6.conf.enp5s0.use_tempaddr=1 \
> 		 "
> 
> but, immediately after boot, exec
> 
> 	sysctl \
> 	 net.ipv6.conf.enp5s0.forwarding \
> 	 net.ipv6.conf.enp5s0.accept_ra \
> 	 net.ipv6.conf.enp5s0.use_tempaddr
> 
> returns the values, unchanged,
> 
> 	net.ipv6.conf.enp5s0.forwarding = 0
> 	net.ipv6.conf.enp5s0.accept_ra = 0
> 	net.ipv6.conf.enp5s0.use_tempaddr = 0
> 
> otoh, if i exec at shell,
> 
> 	udevadm trigger
> 	sysctl \
> 	 net.ipv6.conf.enp5s0.forwarding \
> 	 net.ipv6.conf.enp5s0.accept_ra \
> 	 net.ipv6.conf.enp5s0.use_tempaddr
> 
> the values are changed
> 
> 	net.ipv6.conf.enp5s0.forwarding = 0
> 	net.ipv6.conf.enp5s0.accept_ra = 1
> 	net.ipv6.conf.enp5s0.use_tempaddr = 1
> 
> what's keeping my udev rule from setting up the interface sysctls on boot?

Are you sure that your rule is running after the interface is renamed?

Try running 'udevadm monitor' to watch the events to ensure they are
what you think they are.

Anyway, try asking on the systemd mailing list, which is where udev help
can be found, this list really isn't alive anymore at all, sorry.

good luck!

greg k-h

  reply	other threads:[~2023-12-21  8:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21  0:33 udev rule in /etc/udev/rules.d/ FAILS to exec on boot; but OK exec @ shell after boot ? pgnd
2023-12-21  8:17 ` Greg KH [this message]
2023-12-21 12:25   ` pgnd
2023-12-21 13:21     ` pgnd
2023-12-21 13:22     ` Andrei Borzenkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2023122117-outlet-generic-f184@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-hotplug@vger.kernel.org \
    --cc=pgnd@dev-mail.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).