# coldplug or hotplug?

## alwyn

Hi,

The latest hotplug ebuild says that the hotplug script has been removed and that one must use coldplug, but

I read all over of people using both.

So which is it, coldplug or hotplug or both?

----------

## BeastOfBurden

coldplug is for autodetecting hardware and auto-loading modules at boot only.

```
emerge coldplug && rc-update add coldplug boot
```

hotplug is for monitoring the system for new hardware  so it can auto-load the appropriate modules in the default runlevel.

```
emerge hotplug && rc-update add hotplug default
```

I use both.  Some may want to use only one or the other, or neither.  It's up to you.

----------

## transienteagle

alwyn,

If you take a look at the current hotplug script, it does absolutely nothing (apart from a check to make sure that hotplug is configured in the kernel). coldplug is all that needs to be run now.

rgds

TE

----------

## toralf

 *BeastOfBurden wrote:*   

> 
> 
> I use both

 

?!?And how do you use the hotplug script which is empty since it was replaced by coldplug ?

----------

## rush_ad

so which one would be better for my external usb dvd-rw? i may turn it on and off while computer is running.

----------

## toralf

 *rush_ad wrote:*   

> so which one would be better for my external usb dvd-rw? i may turn it on and off while computer is running.

 

use coldplug for init devices during boot process, while running the system hotplug is used automatically - in conjunction with udev - by the kernel.

----------

## larand54

I think I go nut!

If I want to have my USB-camera/harddrive/Cardreader aumatically mounted - Do I need to have Hotplug emerged and added to the boot-level or default level or can I remove it compleatly?

I always had it installed into the default-level but now I have been interested in udev and have read som articles around. But I think you easy could go crazy! Sometimes the articles speak totally different about certain things.

Sometimes they say that you only need hotplug if you want devices to mount automatically, who won't? Sometimes they say that you should add it to the boot-level. Sometimes they say that you don't need it at all!!???

Heres a snap from the Gentoo udev-guide:

 *Quote:*   

> Requirements
> 
> udev is meant to be used in combination with a 2.6 kernel (like development-sources or gentoo-dev-sources). If you're using such a kernel then you just have to make sure that you have a recent sys-apps/baselayout version. That's all you need.
> 
> Code Listing 2.1: Installing udev
> ...

 

Is this correct? In that case I need it - but at default or boot-level?

By the way, after I emerged udev and rebooted, didn't changed any thing else, I got the /dev filled up with devices. Before I didn't had any sd-devices but now I got 60! sda1-sdd15.

It looks more like the time before devfs

Why? Should it be like that or is something wrong?

----------

## toralf

Add the init script 'coldplug' to your default run level.

Do not add the init script 'hotplug' to any run level because it is only a place holder.

There is a difference between 'hotplug' as the init script and hotplug as the binary located under /sbin. The later does the job of hotplugging devices and used during runtime and in the init script 'coldplug'.

Last edited by toralf on Tue Mar 15, 2005 10:43 am; edited 1 time in total

----------

## larand54

Hmm coldplug at the default level, that's a new one. Why? Why do they otherwise recommend that it should be in the boot-level?

Do you have any comment to why I got all theses devices in /dev after I emerged udev?

----------

## toralf

 *larand54 wrote:*   

> Hmm coldplug at the default level, that's a new one. Why? Why do they otherwise recommend that it should be in the boot-level?

 

So you can boot with parameter 'init 2' at the grub boot loader level without getting a situation where a wrong module stops the system boot process. The init script coldplug is started early enough eg alsasound needs it.

 *larand54 wrote:*   

> 
> 
> Do you have any comment to why I got all theses devices in /dev after I emerged udev?

  No I have no clue.

----------

## VinzC

 *toralf wrote:*   

> 
> 
> Add the init script coldplug to your default run level.
> 
> Do not add the init script hotplug to any run level because it is only a place holder.
> ...

 

May I suggest, since coldplug and hotplug are generally (or always) present both on a system, that the package be renamed to something like plugnplay or whatever? There is a great deal of confusion in here about cold and hot.

I understand it sounds clear after a bit of explanation as I also asked myself the question (i.e. why install hotplug as there is nothing anymore in that script). Now that I've understood, IMHO the *plug pair would be renamed and merged into a single package that there would never be any question anymore. And since everything relates to plug 'n play...

Start a new poll?  :Wink: 

And if you want to start a new semantic thread: why calling coldplug that way given that - first - it calls hotplug - second - the PC is not quite cold as it has already booted (e.g. comparing against warm/cold reset). Let's call it bootplug instead?

Just kidding for the pleasure of it  :Wink: 

----------

