Skip to contentSkip to conversation

automatic init.d script installation

DISCUSSION Robert Love 5 participants 13 messages Mar 2, 2004

lore
Share & tools
lore
#0 lore raw

Looking at this TODO item:

- install the proper init.d script based on the distro we are running on.

We can do this with something like:

if [ -f /etc/redhat-release ]; then
install redhat init script to redhat spot
elif [ -f /etc/SuSE-release ]; then
install LSB init script to suse spot
elif [ -f ... ]; then
...
fi

Is that cool? Such hard coding is not really my cup of tea, but it is a Makefile and there is not much better way to do it. We have similar logic in the D-BUS configure script and Makefile.

If it is cool, maybe Kay can swoop in and do it for me (KIDDING, KAY! YOU ROCK!) ;-)

Robert Love

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
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 1 line · Robert Love

Looking at this TODO item:

Cool, I'm no longer alone :)

Quoted 13 lines

- install the proper init.d script based on the distro we are running on.

We can do this with something like:

if [ -f /etc/redhat-release ]; then
install redhat init script to redhat spot
elif [ -f /etc/SuSE-release ]; then
install LSB init script to suse spot
elif [ -f ... ]; then
...
fi

Quoted 3 lines

Is that cool? Such hard coding is not really my cup of tea, but it is a Makefile and there is not much better way to do it. We have similar logic in the D-BUS configure script and Makefile.

It's cool! Here is more:

if [ -f /etc/debian_version ]; then

Quoted 2 lines

If it is cool, maybe Kay can swoop in and do it for me (KIDDING, KAY! YOU ROCK!) ;-)

Bastard! :)
Thanks, I enjoy it.

Kay

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
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 Robert Love
Quoted 2 lines · Robert Love

Is that cool? Such hard coding is not really my cup of tea, but it is a Makefile and there is not much better way to do it. We have similar

Letting this kind of things to distributions packagers maybe?

Signature · 13 lines
ciao, |
Marco | [4843 vi8rhJ54vSmHI]


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
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 Robert Love
Quoted 1 line · Kay Sievers

if [ -f /etc/debian_version ]; then

Does it use LSB init files in /etc/init.d ?

Are we even keeping the initscript? When I wrote it, it was just because we lacked initramfs so we missed everything generated during early boot. When we get initramfs, do we still need the initscript?

Robert Love

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
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 Robert Love
Quoted 5 lines · Marco d'Itri
Quoted 2 lines · Robert Love

Is that cool? Such hard coding is not really my cup of tea, but it is a Makefile and there is not much better way to do it. We have similar

Letting this kind of things to distributions packagers maybe?

I don't think I will use any package in the near future of udev, so it would be nice for us, the developers, to have a working copy in the tree.
But I'm the 19th who told so. Whats your point to be so closed? That a few entries may be out of sync? I don't really care.

Kay

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
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 Robert Love
Quoted 2 lines · Kay Sievers

But I'm the 19th who told so. Whats your point to be so closed? That a few entries may be out of sync? I don't really care.

In my experience, the problem is that the official package can never be as complete and as up to date as the distribution package (at least for distributions which have continuously updated packages like debian). Then it happens that somebody writes to the upstream author complaining about the distro packaging in the package being broken or out of date, while it will have been fixed since a long time in the distribution package.
This is not a big deal now while there are almost-weekly udev releases, but look at the hotplug package and compare it with the packages from distributions.

Signature · 13 lines
ciao, |
Marco | [4844 otZUipgM/tsfk]


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
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 Robert Love
Quoted 2 lines · Robert Love
Quoted 1 line

if [ -f /etc/debian_version ]; then

Does it use LSB init files in /etc/init.d ?

It could, except that it will not be a "real" debian package anymore.

Quoted 3 lines

Are we even keeping the initscript? When I wrote it, it was just because we lacked initramfs so we missed everything generated during early boot. When we get initramfs, do we still need the initscript?

OK, but /when/ will we get initramfs? :-) So far everybody has been talking about 2.7 time...

Signature · 13 lines
ciao, |
Marco | [4845 prrRV8HEy.ReE]


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#7 lore raw
In reply to Robert Love

...

Quoted 9 lines

if [ -f /etc/redhat-release ]; then
install redhat init script to redhat spot
elif [ -f /etc/SuSE-release ]; then
install LSB init script to suse spot
elif [ -f ... ]; then
...
fi

Is that cool? Such hard coding is not really my cup of tea, ...

Good question.
I had to throw together a shell script for our products (the non GPL kind of stuff) to handle the various distros.
LSB helps, but we're not always there. So ... yeah ... I think
that for now we have to hard-code some of it. Yuck.

It occurs to me that
I might be able to pry that script out of corporate IP and make it available (as if any of a bazillion others
could not come up with a similar solution). Better still
might be to add the logic it contains to the GNU config suite.

<rambling>

The evolution of the script was
that I use 'uname' to identify all platforms, where possible. (Works even on many non-Unix legacy systems, even Windows occasionally.) But with the distro differences, I couldn't just go with (eg)

	Linux-2.4-s390

I had to go with

	SuSE-7.3-i386
	RedHat-7.2-s390

(You get the idea.) Really bugs me to fragment our code
along distro lines, but there are enough differences that we were
forced into it. Other examples in the above sequence would be

	Solaris-5.8-sparc	# for Solaris 8
	AIX-5.2-powerpc
	HPUX-11-hppa64

Obviously, vendor Unix don't fragment like Linux does. :-S

</rambling>

-- R;

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
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 Robert Love
Quoted 3 lines

Are we even keeping the initscript? When I wrote it, it was just because we lacked initramfs so we missed everything generated during early boot. When we get initramfs, do we still need the initscript?

Yes!

-- R;

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
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 Robert Love
Quoted 1 line · Richard Troth

Yes!

... why? :>

Right now, it just rebuilds udev by walking sysfs. If we do not _need_ udev to be rebuilt, then why have the initscript?

Robert Love

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
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 Robert Love
Quoted 8 lines · Robert Love
Quoted 1 line · Richard Troth

Yes!

... why? :>

Right now, it just rebuilds udev by walking sysfs. If we do not _need_ udev to be rebuilt, then why have the initscript?

I agree. I don't think it's needed.

Actually I don't use it today at all anyway, I just use that start_udev script...

Or you can use the udevstart binary I just added to the udev bk tree :)

thanks,

greg k-h

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#11 lore raw
In reply to Robert Love
Quoted 10 lines · Marco d'Itri
Quoted 2 lines · Robert Love
Quoted 1 line

if [ -f /etc/debian_version ]; then

Does it use LSB init files in /etc/init.d ?

It could, except that it will not be a "real" debian package anymore.

Quoted 3 lines

Are we even keeping the initscript? When I wrote it, it was just because we lacked initramfs so we missed everything generated during early boot. When we get initramfs, do we still need the initscript?

OK, but /when/ will we get initramfs? :-)

You have it today, 2.6 boots with it every time.

Quoted 1 line

So far everybody has been talking about 2.7 time...

True, but who knows when 2.7 will start, and then we can backport it to 2.6 :)

Actually the start of some "real" initramfs code is already in the -mm tree, so we are not that far away...

thanks,

greg k-h

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#12 lore raw
In reply to Robert Love

Robert Love asked if we should keep the init script.

Quoted 1 line · I said:

Yes!

He then asked:

Quoted 5 lines

... why? :>

Right now, it just rebuilds udev by walking sysfs. If we do not _need_
udev to be rebuilt, then why have the initscript?

And Greg added:

Quoted 4 lines

I agree. I don't think it's needed.

Actually I don't use it today at all anyway, I just use that start_udev script...

To answer,
I guess I was thinking of udev as a "startable subsystem". I'm a bit of a purist, and my head is presently stuck in several dozen other packages with their own init scripts,
so I'm grasping for sanity! (No heckling from the peanut gallery!)

Whatever goes into init.d (ie: a script, an executable) should handle the commands: start, stop, restart, ... they're
listed in LSB. Don't remove the ability to issue them manually,
outside the scope of other INIT logic. I can't imagine that we
would actually *do* that (remove the manual capability), so maybe I've misunderstood.

-- R;

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel