mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] Shouldn't /etc/init.d/udev call udevadm trigger with --action=all ?
@ 2016-08-24 14:52 Guillermo Rodriguez Garcia
  2016-08-25 11:42 ` Michael Olbrich
  0 siblings, 1 reply; 4+ messages in thread
From: Guillermo Rodriguez Garcia @ 2016-08-24 14:52 UTC (permalink / raw)
  To: ptxdist

Hello all,

I was just playing with some udev rules for automounting USB drives,
and noticed that the rules were working fine when the USB drive was
hot plugged, but not when it was already plugged at boot time.

After some investigation I found that the reason: At boot time, the
default udev init script in ptxdist (from projectroot/etc/init.d/udev)
calls udevadm trigger in order to "coldplug" devices that have already
been discovered by the time the udev daemon is started. However
udevadm trigger is called without arguments, which is equivalent to
--action=change. Thus udev rules for the "add" action are not
triggered.

Shouldn't this be changed to udevadm trigger --action=add ? I believe
most Linux distributions out there are using --action=add in their
udev init scripts.

Best,

Guillermo Rodriguez Garcia
guille.rodriguez@gmail.com

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] Shouldn't /etc/init.d/udev call udevadm trigger with --action=all ?
  2016-08-24 14:52 [ptxdist] Shouldn't /etc/init.d/udev call udevadm trigger with --action=all ? Guillermo Rodriguez Garcia
@ 2016-08-25 11:42 ` Michael Olbrich
  2016-08-25 13:27   ` [ptxdist] [PATCH] udev init script should pass --action=add to udevadm trigger Guillermo Rodriguez
  2016-08-25 13:30   ` [ptxdist] Shouldn't /etc/init.d/udev call udevadm trigger with --action=all ? Guillermo Rodriguez Garcia
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Olbrich @ 2016-08-25 11:42 UTC (permalink / raw)
  To: ptxdist

Hi,

On Wed, Aug 24, 2016 at 04:52:44PM +0200, Guillermo Rodriguez Garcia wrote:
> I was just playing with some udev rules for automounting USB drives,
> and noticed that the rules were working fine when the USB drive was
> hot plugged, but not when it was already plugged at boot time.
> 
> After some investigation I found that the reason: At boot time, the
> default udev init script in ptxdist (from projectroot/etc/init.d/udev)
> calls udevadm trigger in order to "coldplug" devices that have already
> been discovered by the time the udev daemon is started. However
> udevadm trigger is called without arguments, which is equivalent to
> --action=change. Thus udev rules for the "add" action are not
> triggered.
> 
> Shouldn't this be changed to udevadm trigger --action=add ? I believe
> most Linux distributions out there are using --action=add in their
> udev init scripts.

Correct. I never noticed because I've been using systemd exclusively for
years now. It would be great if you could send a patch for this.

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ptxdist] [PATCH] udev init script should pass --action=add to udevadm trigger
  2016-08-25 11:42 ` Michael Olbrich
@ 2016-08-25 13:27   ` Guillermo Rodriguez
  2016-08-25 13:30   ` [ptxdist] Shouldn't /etc/init.d/udev call udevadm trigger with --action=all ? Guillermo Rodriguez Garcia
  1 sibling, 0 replies; 4+ messages in thread
From: Guillermo Rodriguez @ 2016-08-25 13:27 UTC (permalink / raw)
  To: ptxdist; +Cc: Guillermo Rodriguez

'udevadm trigger' was being called without parameters in the
udev init script. This is equivalent to --action=change, which
means that udev rules for the "add" action would not be
triggered. Fix this by explicitly passing --action=add to
udevadm trigger.

Signed-off-by: Guillermo Rodriguez <guille.rodriguez@gmail.com>
---
 projectroot/etc/init.d/udev |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/projectroot/etc/init.d/udev b/projectroot/etc/init.d/udev
index 5c1bf42..a38dc73 100644
--- a/projectroot/etc/init.d/udev
+++ b/projectroot/etc/init.d/udev
@@ -69,7 +69,7 @@ start)
 
 	# Now traverse sys/ in order to "coldplug"
 	# devices that have already been discovered
-	udevadm trigger
+	udevadm trigger --action=add
 	# Now wait for udevd to process
 	# the uevents we triggered
 	echo -n "waiting for devices..."
-- 
1.7.9.5


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] Shouldn't /etc/init.d/udev call udevadm trigger with --action=all ?
  2016-08-25 11:42 ` Michael Olbrich
  2016-08-25 13:27   ` [ptxdist] [PATCH] udev init script should pass --action=add to udevadm trigger Guillermo Rodriguez
@ 2016-08-25 13:30   ` Guillermo Rodriguez Garcia
  1 sibling, 0 replies; 4+ messages in thread
From: Guillermo Rodriguez Garcia @ 2016-08-25 13:30 UTC (permalink / raw)
  To: ptxdist

Hi Michael,

2016-08-25 13:42 GMT+02:00 Michael Olbrich <m.olbrich@pengutronix.de>:
[...]
>> Shouldn't this be changed to udevadm trigger --action=add ? I believe
>> most Linux distributions out there are using --action=add in their
>> udev init scripts.
>
> Correct. I never noticed because I've been using systemd exclusively for
> years now. It would be great if you could send a patch for this.

Done.

Best regards,

Guillermo Rodriguez Garcia
guille.rodriguez@gmail.com

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-25 13:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-24 14:52 [ptxdist] Shouldn't /etc/init.d/udev call udevadm trigger with --action=all ? Guillermo Rodriguez Garcia
2016-08-25 11:42 ` Michael Olbrich
2016-08-25 13:27   ` [ptxdist] [PATCH] udev init script should pass --action=add to udevadm trigger Guillermo Rodriguez
2016-08-25 13:30   ` [ptxdist] Shouldn't /etc/init.d/udev call udevadm trigger with --action=all ? Guillermo Rodriguez Garcia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox