LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Are /sbin/hotplug script and scripts under /etc/hotplug.d/ directory not used now? (https://www.linuxquestions.org/questions/linux-general-1/are-sbin-hotplug-script-and-scripts-under-etc-hotplug-d-directory-not-used-now-4175677726/)

ayyasprings 06-27-2020 05:19 AM

Are /sbin/hotplug script and scripts under /etc/hotplug.d/ directory not used now?
 
Hi,

In the Linux Device Driver 3rd edition book by Jonathan Corbet, Allessandro Rubini and Greg Kroah-Hartman I see like on any kobject event and after some filtering and environment information stuff added as argument to /sbin/hotplug script which will again invoke the required scripts under /etc/hotplug.d/ directory based on the environment data passed as arguments previously for hot plug mechanism.

But I could not see both /sbin/hotplug or /etc/hotplug.d/ directory in my laptop.
Are those not used now and replaced with some other mechanisms?

I am using ubuntu 14.04 LTS.

Please reply.

Thanks,
Ayyappan

ferrari 06-28-2020 12:01 AM

Quote:

Are those not used now and replaced with some other mechanisms?
Yes, udev supplanted it years ago, and has continued to evolve substantially from what is likely described in the book you're reading

Refer
https://en.wikipedia.org/wiki/Udev

Quote:

Overview

Unlike traditional Unix systems, where the device nodes in the /dev directory have been a static set of files, the Linux udev device manager dynamically provides only the nodes for the devices actually present on a system. Although devfs used to provide similar functionality, Greg Kroah-Hartman cited a number of reasons[4] for preferring udev over devfs:

udev supports persistent device naming, which does not depend on, for example, the order in which the devices are plugged into the system. The default udev setup provides persistent names for storage devices. Any hard disk is recognized by its unique filesystem id, the name of the disk and the physical location on the hardware it is connected to.
udev executes entirely in user space, as opposed to devfs's kernel space. One consequence is that udev moved the naming policy out of the kernel and can run arbitrary programs to compose a name for the device from the device's properties, before the node is created; there, the whole process is also interruptible and it runs with a lower priority.

The udev, as a whole, is divided into three parts:

Library libudev that allows access to device information; it was incorporated into the systemd 183 software bundle.[5]
User space daemon udevd that manages the virtual /dev.
Administrative command-line utility udevadm for diagnostics.

The system gets calls from the kernel via netlink socket. Earlier versions used hotplug, adding a link to themselves in /etc/hotplug.d/default with this purpose.

ayyasprings 06-29-2020 01:49 AM

Hi Ferrari,

After exploring with udev, I came to know mdev, another light weight utility used in embedded systems.

Please let me know any other alternatives currently in use for embedded systems as well as desktops/high end servers like that.

Thanks a lot in advance.

ferrari 06-29-2020 02:22 AM

Google might be your friend here. I have no need to use anything other than udev.

A quick search turned out these...
https://core.suckless.org/smdev/
https://core.suckless.org/nldev/

Gentoo and friends offer eudev which is a fork of udev for those using alternative init systems.
https://wiki.gentoo.org/wiki/Eudev

YMMV.


All times are GMT -5. The time now is 04:19 PM.