Hey,

Starting with 0.6.25, Avahi now has a LFS initscript, thanks to me.
(Yes, look in the bootscript itself and you'll see. And also, Avahi
installs it automacilly.) But, there are a few oversights I have made
when I did this (mainly in the Makefile.am):

1. I forgot to put in a sed/cat in the Makefile.am to redict the
bootscript.in file to the bootscript itself. This causes chmod to fail
when it makes the bootscript excuable. I fixed this in the patch with
a 'cat avahi.in > avahi' command (since there was nothing to sed, but
other distros have to do that for Avahi), but Lennhart (the Avahi
creator) did not like it, and asked me to just use plan old 'avahi'
and use that. But, other scripts will plobary have to use the same
order (just 'avahi', no .in), and that is a mess. So, for consity,
this patch uses the command.

2. No symlinks to the bootscript are created. LFS uses symlinks to
keep the initscript in /etc/rc.d/init.d and put symlinks in the
rc{0,1,2,3,4,5,6,sysinit}.d dirs. It would be a hassle to create them
manualy. So, in the patch, I overiden the 'install' produce in the
Makefile.am to create the symlinks automaticly, avoding the need for
manual creation. But, again, Lennhart dissagress, saying that a 'tool'
that is part of any other distro will create them automaticly, but no
such tool exists. Also, he dissagres with our bootscript idea, saying
it's a 'link farm'. What a *expictive deleted* insult to us.

3. In the bootscript itself, (before the patch), I had to call
'avahi-daemon -k' and then eveluate_retrevial, because killproc won't
work with avahi. So, I eplained that in the patch.

This patch is pretty useful in case we are including avahi in the
book. Please, take note of it.

William
diff --git a/initscript/lfs/Makefile.am b/initscript/lfs/Makefile.am
index d5e33f8..a4ca075 100644
--- a/initscript/lfs/Makefile.am
+++ b/initscript/lfs/Makefile.am
@@ -26,4 +26,14 @@ initd_SCRIPTS = avahi
 CLEANFILES = avahi
 
 avahi: avahi.in
+	cat avahi.in > avahi       
 	chmod +x $@
+
+install: install-am
+	ln -sfv ../init.d/avahi /etc/rc.d/rc0.d/K28avahi
+	ln -sfv ../init.d/avahi /etc/rc.d/rc1.d/K28avahi
+	ln -sfv ../init.d/avahi /etc/rc.d/rc2.d/K49avahi
+	ln -sfv ../init.d/avahi /etc/rc.d/rc3.d/S21avahi
+	ln -sfv ../init.d/avahi /etc/rc.d/rc4.d/S21avahi
+	ln -sfv ../init.d/avahi /etc/rc.d/rc5.d/S21avahi
+	ln -sfv ../init.d/avahi /etc/rc.d/rc6.d/K28avahi
diff --git a/initscript/lfs/avahi.in b/initscript/lfs/avahi.in
index ba3672a..fd76be1 100644
--- a/initscript/lfs/avahi.in
+++ b/initscript/lfs/avahi.in
@@ -24,6 +24,7 @@ case "${1}" in
 	stop)
 		boot_mesg "Stopping the Avahi daemon..."
 		avahi-daemon -k
+		# This call to eveluate_retval (a function from the LFS initscripts, it displays a OK or a FAIL message depending on whenther it suceeded or not) is a workaround because I can't use killproc for the avahi daemon.
 		evaluate_retval
 		;;
 
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to