From 15052c100e148a94553ee155d7384b67e6537675 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 9 Jul 2002 13:23:49 +0000 Subject: fix boot freeze on hw change: initscript was running us with stdout redirected to /dev/null; just use a small sh wrapper to fix it --- perl-install/Makefile.drakxtools | 7 ++-- perl-install/drakxtools.spec | 21 +++++----- perl-install/harddrake/TODO | 1 - perl-install/standalone/service_harddrake | 14 +------ perl-install/standalone/service_harddrake.sh | 57 ++++++++++++++++++++++++++++ 5 files changed, 74 insertions(+), 26 deletions(-) create mode 100644 perl-install/standalone/service_harddrake.sh diff --git a/perl-install/Makefile.drakxtools b/perl-install/Makefile.drakxtools index e5e7f4ae8..bae306025 100644 --- a/perl-install/Makefile.drakxtools +++ b/perl-install/Makefile.drakxtools @@ -26,7 +26,7 @@ $(DIRS): [ ! -e $@/Makefile ] || $(MAKE) -C $@ install: - mkdir -p $(BINDEST) $(ETCDEST) $(SBINDEST) $(DATADIR)/pixmaps $(LIBDEST)/{network,security,harddrake} $(BINX11DEST) $(LIBX11DEST) $(PIXDIR) $(INITDIR) + mkdir -p $(BINDEST) $(ETCDEST) $(SBINDEST) $(DATADIR)/{harddrake,pixmaps} $(LIBDEST)/{network,security,harddrake} $(BINX11DEST) $(LIBX11DEST) $(PIXDIR) $(INITDIR) install -d $(INLIBDEST_DIRS:%=$(LIBDEST)/%) install $(STANDALONEPMS) $(SBINDEST) install -s rpcinfo-flushed ddcprobe/ddcxinfos serial_probe/serial_probe $(SBINDEST) @@ -50,7 +50,7 @@ install: install -d $(LIBDEST)/diskdrake install -m 644 diskdrake/*.pm $(LIBDEST)/diskdrake - find $(LIBDEST) -name "*.pm" | xargs perl -pi -e '$$_ = "\n" if /\s*use\s+(diagnostics|vars|strict)/' + find $(LIBDEST) -name "*.pm" | xargs perl -pi -e 's/\s*use\s+(diagnostics|vars|strict)//g' for i in $(HAVEINST_DIRS); do \ $(MAKE) -C $$i install PREFIX=$(PREFIX) DATADIR=$(DATADIR) NAME=$(NAME) ; \ @@ -59,4 +59,5 @@ install: find auto -follow -name .exists -o -name "*.bs" | xargs rm -f cp -rfL auto standalone/icons $(LIBDEST) mv $(LIBDEST)/icons/harddrake2/ $(DATADIR)/pixmaps/ - mv $(SBINDEST)/service_harddrake $(INITDIR)/harddrake + mv $(SBINDEST)/service_harddrake.sh $(INITDIR)/harddrake + mv $(SBINDEST)/service_harddrake $(DATADIR)/harddrake/ diff --git a/perl-install/drakxtools.spec b/perl-install/drakxtools.spec index d59cc4514..9c24a9f51 100644 --- a/perl-install/drakxtools.spec +++ b/perl-install/drakxtools.spec @@ -85,10 +85,10 @@ It autodetects both monitor and video card if possible. %description newt This add the capability to be runned behind a web server to the drakx tools. -See package %{name} +See package %name %description http -See package %{name} +See package %name %description -n harddrake The harddrake service is a hardware probing tool run at system boot @@ -118,12 +118,12 @@ rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/{%_initrddir,etc/sysconfig/harddrake2} touch $RPM_BUILD_ROOT/etc/sysconfig/harddrake2/previous_hw -mv ${RPM_BUILD_ROOT}%{_sbindir}/net_monitor \ - ${RPM_BUILD_ROOT}%{_sbindir}/net_monitor.real -ln -sf %{_bindir}/consolehelper ${RPM_BUILD_ROOT}%{_sbindir}/net_monitor -mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/{pam.d,security/console.apps} -cp pam.net_monitor $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/net_monitor -cp apps.net_monitor $RPM_BUILD_ROOT%{_sysconfdir}/security/console.apps/net_monitor +mv $RPM_BUILD_ROOT%_sbindir/net_monitor \ + $RPM_BUILD_ROOT%_sbindir/net_monitor.real +ln -sf %_bindir/consolehelper $RPM_BUILD_ROOT%_sbindir/net_monitor +mkdir -p $RPM_BUILD_ROOT%_sysconfdir/{pam.d,security/console.apps} +cp pam.net_monitor $RPM_BUILD_ROOT%_sysconfdir/pam.d/net_monitor +cp apps.net_monitor $RPM_BUILD_ROOT%_sysconfdir/security/console.apps/net_monitor dirs1="usr/lib/libDrakX usr/share/libDrakX" (cd $RPM_BUILD_ROOT ; find $dirs1 usr/bin usr/sbin ! -type d -printf "/%%p\n")|egrep -v 'bin/.*harddrake' > %{name}.list @@ -204,7 +204,7 @@ done %files http -f %{name}-http.list %defattr(-,root,root) -%dir %{_sysconfdir}/drakxtools_http +%dir %_sysconfdir/drakxtools_http %config(noreplace) %_sysconfdir/pam.d/miniserv %config(noreplace) %_sysconfdir/init.d/drakxtools_http %config(noreplace) %_sysconfdir/drakxtools_http/conf @@ -215,6 +215,9 @@ done * Mon Jul 8 2002 Thierry Vignaud 1.1.8-3mdk - harddrake2: o no need to 'use strict' in "binary" => remove warnings + o fix boot freeze on hw change: initscript was running us with + stdout redirected to /dev/null; just use a small sh wrapper to + fix it - spec: o reorder entries in description diff --git a/perl-install/harddrake/TODO b/perl-install/harddrake/TODO index fb923790d..324b4b2d1 100644 --- a/perl-install/harddrake/TODO +++ b/perl-install/harddrake/TODO @@ -5,7 +5,6 @@ *** IDE, SCSI: bus => bus_id, bus="IDE/SCSI" => move into DrakX *** SCSI: get vendor string *** timeout on dialogs in service -*** initscript run harddrake service redirected to /dev/null :-( *** mouse.pm: only probe serial if : **** serial mouse previously detected **** no non-serial mouse found diff --git a/perl-install/standalone/service_harddrake b/perl-install/standalone/service_harddrake index 56fbfdbb5..09f86ad7c 100755 --- a/perl-install/standalone/service_harddrake +++ b/perl-install/standalone/service_harddrake @@ -1,23 +1,11 @@ #!/usr/bin/perl -w # harddrake2 This service runs the HardDrake hardware probe. -# -# chkconfig: 345 05 95 -# description: This runs the hardware probe, and optionally configures \ -# changed hardware. - - -# TODO: start/stop/status/ use lib qw(/usr/lib/libDrakX); -use strict; +#use strict; use standalone; #- warning, standalone must be loaded very first, for 'explanations' -if ($ARGV[0] !~ /^start$/) { - print "service harddrake [start|stop]\n"; - exit 0; -} - use MDK::Common; use POSIX; diff --git a/perl-install/standalone/service_harddrake.sh b/perl-install/standalone/service_harddrake.sh new file mode 100644 index 000000000..1f5541954 --- /dev/null +++ b/perl-install/standalone/service_harddrake.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# +# harddrake This scripts runs the harddrake hardware probe. +# +# chkconfig: 345 05 95 +# description: This runs the hardware probe, and optionally configures \ +# changed hardware. + +# This is an interactive program, we need the current locale + +[[ -f /etc/profile.d/lang.sh ]] && . /etc/profile.d/lang.sh + +# Source function library. +. /etc/rc.d/init.d/functions + + +SUBSYS=/var/lock/subsys/harddrake + +case "$1" in + start) +# We (mdk) don't support updfstab (yet) +# action "Updating /etc/fstab" /usr/sbin/updfstab + + gprintf "Checking for new hardware" + rm -f /var/run/Xconfig + rm -f /var/run/Xconfig-failed + + # Have a 30 second timeout. + /usr/share/harddrake/service_harddrake + RETVAL=$? + if [ "$RETVAL" -eq 0 ]; then + action "" /bin/true + else + action "" /bin/false + fi + # We don't want to run this on random runlevel changes. + touch $SUBSYS +# [ /etc/modules.conf -nt /lib/modules/$(uname -r)/modules.dep ] && touch /lib/modules/$(uname -r)/modules.dep 2>/dev/null >/dev/null || : & + exit $RETVAL + ;; + status) + if [ -f $SUBSYS ]; then + gprintf "Harddrake service was runned at boot time" + else gprintf "Harddrake service was not runned at boot time" + fi + ;; + reload) + ;; + stop) + # dummy + rm -f $SUBSYS + ;; + *) + gprintf "Usage: %s {start|stop}\n" "$0" + exit 1 + ;; +esac -- cgit v1.2.1