Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: patrikg on September 08, 2021, 05:07:55 AM

Title: 3 x /sbin/udevd ?
Post by: patrikg on September 08, 2021, 05:07:55 AM
Is there some reason that udevd is running 3 daemons ?

Code: (bash) [Select]
tc@box:~$ ps | grep udev                                                       
  111 root     /sbin/udevd --daemon                                             
 1448 root     /sbin/udevd --daemon                                             
 1449 root     /sbin/udevd --daemon                                             
 1652 tc       grep udev                                                       
tc@box:~$

I trying to optimize picore as much as possible.
One or more boot scripts calling udevd 3 times ??

That can just run something like this to reload itself.
Sorry for bad spelling but this forum has lots of problem with some characters and words :)

Code: (bash) [Select]
s_u_d_o kill -hup dollarsign(pidof udevd)
Title: Re: 3 x /sbin/udevd ?
Post by: curaga on September 08, 2021, 10:57:58 AM
They are spawned helpers and expected. Most likely they are waiting for an event, or for modprobe to complete, or some other thing.
Title: Re: 3 x /sbin/udevd ?
Post by: Rich on September 08, 2021, 11:43:26 AM
Hi patrikg
I just checked under x86 TC9 and TC10 and see the same thing. The daemon with the low PID number was launched by
/etc/init.d/tc-config. The others as curaga mentioned are helpers launched later on. On TC4 I see a total of 8 processes.

See if this reduces the daemon count to one:
Code: [Select]
sudo udevadm control --children-max=0
Code: [Select]
sudo udevadm control --reload-rules
Title: Re: 3 x /sbin/udevd ?
Post by: curaga on September 08, 2021, 12:25:32 PM
0 is probably unlimited?
Title: Re: 3 x /sbin/udevd ?
Post by: patrikg on September 08, 2021, 12:26:39 PM
Hi Rich
thanks for reply, and curaga that's it. The father/mother daemon spawns children daemons.

Code: (bash) [Select]
tc@box:/etc$ sudo udevadm control --children-max=0                             
invalid number '0'

Code: (bash) [Select]
tc@box:/etc$ sudo udevadm control --children-max=1                             
tc@box:/etc$

But the father/mother daemon wouldn't you to set that he/she have no children. :)




Title: Re: 3 x /sbin/udevd ?
Post by: Rich on September 08, 2021, 12:41:36 PM
Hi patrikg
... But the father/mother daemon wouldn't you to set that he/she have no children. :)
That's what I thought too. Rereading the man page suggests they count the parent as a child:
Quote
       -m, --children-max=value
           Set the maximum number of events, systemd-udevd will handle
           at the same time.

Found here:
https://man7.org/linux/man-pages/man8/udevadm.8.html

So I guess the parent is chosen first to handle events, and if busy, a child is called  to handle the task