Skip to contentSkip to conversation

determining udev running

DISCUSSION rich turner 4 participants 11 messages Dec 15, 2004

lore
Share & tools
lore
#0 lore raw

is there a consistent way to know if udev is currently running on a system?

i realize udevd will be running and will be visible through a ps listing, but i would like to check for the existence of a file or an entry in /proc or /sys.

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 6 lines · rich turner

is there a consistent way to know if udev is currently running on a system?

i realize udevd will be running and will be visible through a ps listing, but i would like to check for the existence of a file or an entry in /proc or /sys.

/dev/.udev
though it is not in /proc or /sys but in /dev ...

Stefan

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to rich turner
Quoted 2 lines · rich turner

is there a consistent way to know if udev is currently running on a system?

Debian packages use "test -e /dev/.udevdb".

Signature · 13 lines
ciao, |
Marco | [9826 sbehveE.kewNw]


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#3 lore raw
In reply to rich turner

although that may be how udev was designed, it appears fc3 does not follow that standard. there is not a /dev/.udev file.

# ls -la /dev/.udev*
-rw-r--r--  1 root root 163840 Dec 15 03:27 /dev/.udev.tdb

would the best way be to determine if /dev is mounted on tmpfs? does anyone else use /dev on tmpfs?

Quoted 14 lines · Stefan Schweizer
Quoted 6 lines · rich turner

is there a consistent way to know if udev is currently running on a system?

i realize udevd will be running and will be visible through a ps listing, but i would like to check for the existence of a file or an entry in /proc or /sys.

/dev/.udev
though it is not in /proc or /sys but in /dev ...

Stefan

Quoted 9 lines

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#4 lore raw
In reply to rich turner
Quoted 6 lines · rich turner

is there a consistent way to know if udev is currently running on a system?

i realize udevd will be running and will be visible through a ps listing, but i would like to check for the existence of a file or an entry in /proc or /sys.

As udev runs entirely in userspace, the kernel doesn't know about it.

You may check for a symlink to udevsend in /etc/hotplug.d/default/ or /proc/sys/kernel/hotplug that may be set to udev or udevsend.

Kay

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#5 lore raw
In reply to rich turner
Quoted 5 lines · rich turner

although that may be how udev was designed, it appears fc3 does not follow that standard. there is not a /dev/.udev file.

# ls -la /dev/.udev*
-rw-r--r--  1 root root 163840 Dec 15 03:27 /dev/.udev.tdb

FC3 ships an old release of udev.

Quoted 1 line

would the best way be to determine if /dev is mounted on tmpfs?

This is more complex.

Quoted 1 line

does anyone else use /dev on tmpfs?

Everybody, I think.

Signature · 13 lines
ciao, |
Marco | [9827 soIzouy3MUWTw]


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#6 lore raw
In reply to rich turner
Quoted 1 line · Kay Sievers

You may check for a symlink to udevsend in /etc/hotplug.d/default/

This will not work if udev is not active (e.g. because the init script detected a 2.4 kernel or was manually disabled).

Signature · 2 lines
ciao, |
Marco | [9828 fijBf.JNQbEbk]
#7 lore raw
In reply to rich turner
Quoted 2 lines · rich turner

although that may be how udev was designed, it appears fc3 does not follow that standard. there is not a /dev/.udev file.

There is no such standard. You can specify the location in the udev.conf file. But be aware that newer udev versions use that value to create a directory and not a single file.

Quoted 5 lines
# ls -la /dev/.udev*
-rw-r--r--  1 root root 163840 Dec 15 03:27 /dev/.udev.tdb

would the best way be to determine if /dev is mounted on tmpfs? does anyone else use /dev on tmpfs?

Allmost all users of udev use tmpfs. If /dev is on tmpfs and you find a db file/directory at the specified location, you can assume that udev maintains the directory.

Kay

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#8 lore raw
In reply to rich turner
Quoted 5 lines · Marco d'Itri
Quoted 1 line · Kay Sievers

You may check for a symlink to udevsend in /etc/hotplug.d/default/

This will not work if udev is not active (e.g. because the init script detected a 2.4 kernel or was manually disabled).

but i think this is what i need to know, if udev is active. or better yet, i only want to know whether a system booted with udev, or populated the /dev directory using udev.

isnt there anything i can check to see that udev was used to populate /dev?

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#9 lore raw
In reply to rich turner

can someone shoot any holes in my logic here. how about this:

we used udev to populate /dev if:
1. /dev is a mounted filesystem as determined by /proc/mounts
2. there is a file /dev/.udev.tdb

is there any importance for checking for udevd? doesnt it just listen for new devices detected by the kernel and create the nodes if they dont already exist?

Quoted 16 lines · rich turner
Quoted 5 lines · Marco d'Itri
Quoted 1 line · Kay Sievers

You may check for a symlink to udevsend in /etc/hotplug.d/default/

This will not work if udev is not active (e.g. because the init script detected a 2.4 kernel or was manually disabled).

but i think this is what i need to know, if udev is active. or better yet, i only want to know whether a system booted with udev, or populated the /dev directory using udev.

isnt there anything i can check to see that udev was used to populate /dev?

Quoted 9 lines

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#10 lore raw
In reply to rich turner
Quoted 4 lines · rich turner

can someone shoot any holes in my logic here. how about this:

we used udev to populate /dev if:
1. /dev is a mounted filesystem as determined by /proc/mounts

No, udev will work perfectly on any filesystem, including the root filesystem.

Quoted 1 line

2. there is a file /dev/.udev.tdb

You need to get the filename from /etc/udev/udev.conf. But if /dev is on a persistent filesystem, yo can't know if its from the current system, or an earlier run.

As said in the earlier mail: If /dev is on tmpfs and you find a udevdb at the configured location, there is a high probability that udev is manging the /dev directory.

Quoted 3 lines

is there any importance for checking for udevd? doesnt it just listen for new devices detected by the kernel and create the nodes if they dont already exist?

udevd is just an event serializer. It collect events from the kernel and forks the udev binary in the right order.

So, there in no distribution independent way to know if udev has created the device nodes. There is no single state, where you can get that information. What exact problem you need to address?

Kay

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel