Hello community, here is the log from the commit of package aaa_base checked in at Fri Jul 18 21:54:12 CEST 2008. -------- --- aaa_base/aaa_base.changes 2008-07-16 15:51:12.000000000 +0200 +++ aaa_base/aaa_base.changes 2008-07-18 17:11:18.156131000 +0200 @@ -1,0 +2,5 @@ +Fri Jul 18 17:10:46 CEST 2008 - werner@suse.de + +- Make boot scripts know about new upcoming startpar and insserv + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ aaa_base.spec ++++++ --- /var/tmp/diff_new_pack.gn7138/_old 2008-07-18 21:53:27.000000000 +0200 +++ /var/tmp/diff_new_pack.gn7138/_new 2008-07-18 21:53:27.000000000 +0200 @@ -21,7 +21,7 @@ PreReq: /usr/bin/sed /usr/bin/grep /bin/mv /bin/cat /bin/ls /bin/date /usr/bin/cmp /bin/fillup /sbin/insserv udev net-tools AutoReqProv: on Version: 11.0.42 -Release: 6 +Release: 8 Summary: SUSE Linux Base Package BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: aaa_base.tar.bz2 @@ -143,6 +143,8 @@ %defattr(-,root,root) %changelog +* Fri Jul 18 2008 werner@suse.de +- Make boot scripts know about new upcoming startpar and insserv * Wed Jul 16 2008 ro@suse.de - compile get_kernel_version with largefile support (bnc#398593) * Fri Jul 04 2008 werner@suse.de ++++++ aaa_base.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/aaa_base/etc/init.d/boot new/aaa_base/etc/init.d/boot --- old/aaa_base/etc/init.d/boot 2008-07-04 16:11:33.000000000 +0200 +++ new/aaa_base/etc/init.d/boot 2008-07-18 16:56:50.000000000 +0200 @@ -206,7 +206,7 @@ B=${B%$script} if test "$DO_CONFIRM" = "yes" ; then - rc_confirm -t $CONFIRM_PROMPT_TIMEOUT "Start bootup script ${script}" < $REDIRECT > $REDIRECT 2>&1 + rc_confirm -t $CONFIRM_PROMPT_TIMEOUT "Start bootup script ${script}" 0<>$REDIRECT 1>&0 2>&0 case "$?" in 0) true ;; 1) continue ;; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/aaa_base/etc/init.d/halt new/aaa_base/etc/init.d/halt --- old/aaa_base/etc/init.d/halt 2008-07-03 18:28:43.000000000 +0200 +++ new/aaa_base/etc/init.d/halt 2008-07-18 16:51:38.000000000 +0200 @@ -11,7 +11,7 @@ # . /etc/rc.status -. /etc/sysconfig/clock +. /etc/sysconfig/boot . /etc/sysconfig/shutdown test -s /etc/sysconfig/bootsplash && . /etc/sysconfig/bootsplash @@ -105,15 +105,12 @@ rc_status -v1 -r fi -# Write to wtmp file before unmounting /var +# write to wtmp file before unmounting /var $command -w -# Set a flag that we had success upto this point +# set a flag that we had success upto this point test -w / && > /success -# Stop blogd before umounting /var -test -x /sbin/blogd && killproc -QUIT /sbin/blogd - # give processes in front a chance to quit hupon="" for tty in tty1 tty2 tty3 tty4 tty5 tty6; do @@ -124,73 +121,51 @@ done test -z "$hupon" || fuser -sk -HUP $hupon -echo "Sending all processes the TERM signal..." -killall5 -15 -echo -e "$rc_done_up" - -# Wait between last SIGTERM and the next SIGKILL -declare -i etime=$SECONDS -if test -f /fastboot ; then - etime=$((etime+2)) -else - etime=$((etime+6)) -fi - -ppid=$$ -parent_processes="$ppid" -while test $ppid -ne 0; do - read -t 1 pid comm state ppid rest < /proc/$ppid/stat - parent_processes="${parent_processes:+$parent_processes }${ppid}" -done -for comm in /sbin/splash /sbin/blogd; do - ppid="$(/sbin/pidofproc $comm)" || continue - parent_processes="${parent_processes:+$parent_processes }${ppid}" -done -unset comm state ppid rest +test -s /etc/init.d/.depend.halt || RUN_PARALLEL="no" +type -p startpar &> /dev/null || RUN_PARALLEL="no" +startpar -v &> /dev/null || RUN_PARALLEL="no" -while test $SECONDS -lt $etime; do - left_processes="" - for proc in /proc/[0-9]* ; do - pid=${proc##*/} - case "${parent_processes// /:}" in - *:${pid}:*) continue - esac - /bin/ls -L ${proc}/exe > /dev/null 2>&1 || continue - left_processes="${left_processes:+$left_processes }${pid}" - done - test -n "${left_processes}" || break - usleep 500000 -done -unset pid proc etime parent_processes left_processes +# +# set back system boot configuration +# +if test "$RUN_PARALLEL" = "yes" ; then -echo "Sending all processes the KILL signal..." -killall5 -9 -echo -e "$rc_done_up" + startopt="-p4 -t 30 -T 3" + eval $(startpar $startopt -M halt) + unset failed_service skipped_service -# Redirect our mesages to default console -test -n "$REDIRECT" && exec 0<> $REDIRECT 1>&0 2>&0 +elif -d /etc/init.d/boot.d/ ; then -# -# call modules in boot.d via K* symlinks -# (reverse sequence) -# + # + # call modules in boot.d via K* symlinks + # -if test -d /etc/init.d/boot.d/ ; then - for i in /etc/init.d/boot.d/K*; do - test -f $i || continue - if test -x "$i" ; then - # Active boot scripts, should have their own messages - $i stop - else - # Old boot scripts, may not have any message - echo Skipping $i, not executable - fi + for link in /etc/init.d/boot.d/K[0-9][0-9]*; do + test -x $link || continue + $link stop done + unset link + fi # kill splash animation test "$SPLASH" = yes && /sbin/splash -q +echo "Sending all processes the TERM signal..." +killall5 -15 +echo -e "$rc_done_up" + +# wait between last SIGTERM and the next SIGKILL +rc_wait /sbin/blogd /sbin/splash + +echo "Sending all processes the KILL signal..." +killall5 -9 +echo -e "$rc_done_up" + +if test -n "$REDIRECT" && /sbin/checkproc /sbin/blogd ; then + # redirect our famous last messages to default console + exec 0<> $REDIRECT 1>&0 2>&0 +fi # on umsdos fs this would lead to an error message, so direct errors to # /dev/null diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/aaa_base/etc/init.d/rc new/aaa_base/etc/init.d/rc --- old/aaa_base/etc/init.d/rc 2008-06-13 14:38:57.000000000 +0200 +++ new/aaa_base/etc/init.d/rc 2008-07-18 16:56:57.000000000 +0200 @@ -209,47 +209,50 @@ type -p startpar &> /dev/null || RUN_PARALLEL="no" startpar -v &> /dev/null || RUN_PARALLEL="no" +checklink() +{ + if test $# -gt 1 ; then + local service=${1#*[SK]$rex} + echo -e "$attn${1%/*}/: more than one link for service $service$norm" + fi + test -x $1 +} + # -# Stop/Start services to enter new runlevel +# Stop running services not enabled in new runlevel # if test "$RUN_PARALLEL" = "yes" ; then + startopt="-p4 -t 30 -T 3 $(splashmake)" + # - # Stop/Start services in parallel with make behaviour of startpar + # Stop services in parallel with make behaviour of startpar # - startopt="-p4 -t 30 -T 3 $(splashmake)" eval $(startpar $startopt -M stop -P $PREVLEVEL -R $RUNLEVEL) failed="${failed:+$failed }$failed_service" skipped="${skipped:+$skipped }$skipped_service" - eval $(startpar $startopt -M start -P $PREVLEVEL -R $RUNLEVEL) - failed="${failed:+$failed }$failed_service" - skipped="${skipped:+$skipped }$skipped_service" - - unset failed_service skipped_service startopt + unset failed_service skipped_service -else +elif test -d ${prerc}/ ; then # # First check and test services of previous and current (new) runlevel. # - for i in $prerc/K${rex}*; do - test -x "$i" || continue + for link in $prerc/K${rex}* ; do + + test -x "$link" || continue # # Don't stop service if the new runlevel requires the service. # - K=${i##*/} - service=${K#*K$rex} - K=${K%$service} - set -- $runrc/S$rex$service - test $# -gt 1 && echo -e "$attn$runrc/: more than one link for service $service$norm" - test -x "$1" && continue + service=${link##*/K$rex} + checklink $runrc/S$rex$service && continue blogger "$service stop" - $i stop; status=$? + $link stop; status=$? echo -en "$rc_reset" splashprogress "$service stop" @@ -262,26 +265,52 @@ blogger "'$service stop' exits with status $status" done + unset link service - for i in $runrc/S${rex}*; do +fi - test -x "$i" || continue +# +# Do never call startpar for single, halt or reboot script +# +case "$RUNLEVEL" in + S|0|1|6) + DO_CONFIRM=no + RUN_PARALLEL=no + test -x /sbin/blogd && killproc -QUIT /sbin/blogd +esac + +# +# Start services required to enter new runlevel +# +if test "$RUN_PARALLEL" = "yes" ; then + + # + # Start services in parallel with make behaviour of startpar + # + + eval $(startpar $startopt -M start -P $PREVLEVEL -R $RUNLEVEL) + failed="${failed:+$failed }$failed_service" + skipped="${skipped:+$skipped }$skipped_service" + + unset failed_service skipped_service startopt + +elif test -d ${runrc}/ ; then + + for link in $runrc/S${rex}*; do + + test -x "$link" || continue # # Don't start service if previous runlevel includes the service. # - S=${i##*/} - service=${S#*S$rex} - S=${S%$service} - set -- $prerc/K$rex$service - test $# -gt 1 && echo -e "$attn$prerc/: more than one link for service $service$norm" - test -x "$1" && continue + service=${link##*/S$rex} + checklink $prerc/K$rex$${service} && continue # # Ask the user if wanted # if test "$DO_CONFIRM" = "yes" ; then - rc_confirm -t $CONFIRM_PROMPT_TIMEOUT "Start service $service" + rc_confirm -t $CONFIRM_PROMPT_TIMEOUT "Start service $service" 0<>$REDIRECT 1>&0 2>&0 case "$?" in 0) true ;; 1) continue ;; @@ -290,7 +319,7 @@ fi blogger "$service start" - $i start; status=$? + $link start; status=$? echo -en "$rc_reset" splashprogress "$service start" @@ -302,6 +331,8 @@ blogger "'$service start' exits with status $status" done + unset link service + fi # diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/aaa_base/etc/init.d/single new/aaa_base/etc/init.d/single --- old/aaa_base/etc/init.d/single 2003-09-01 13:11:23.000000000 +0200 +++ new/aaa_base/etc/init.d/single 2008-07-18 16:47:46.000000000 +0200 @@ -30,10 +30,19 @@ echo "Sending all processes the TERM signal..." killall5 -15 echo -e "$rc_done_up" - sleep 3 + + # Wait between last SIGTERM and the next SIGKILL + rc_wait /sbin/blogd /sbin/splash + echo "Sending all processes the KILL signal..." killall5 -9 echo -e "$rc_done_up" + + if test -n "$REDIRECT" && /sbin/checkproc /sbin/blogd ; then + # redirect our famous last messages to default console + exec 0<> $REDIRECT 1>&0 2>&0 + fi + # # If we're not in single user mode we should go down there. # diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/aaa_base/etc/rc.status new/aaa_base/etc/rc.status --- old/aaa_base/etc/rc.status 2008-06-13 14:41:13.000000000 +0200 +++ new/aaa_base/etc/rc.status 2008-07-18 17:10:13.000000000 +0200 @@ -308,9 +308,9 @@ rc_active () { - local x - for x in /etc/init.d/*.d/S[0-9][0-9]${1} ; do - test -e $x || break + local link + for link in /etc/init.d/*.d/S[0-9][0-9]${1} ; do + test -e $link || break return 0 done return 1 @@ -321,3 +321,57 @@ return 0 } +# Wait between last SIGTERM and the next SIGKILL +# any argument specify a *path* of a process which +# process identity should *not* be checked. +rc_wait() +{ + local -i etime=$SECONDS + + if test -f /fastboot ; then + let etime+=2 + else + let etime+=6 + fi + + local -i pid + local -i ppid=$$ + local comm state rest + local parent_processes="$ppid" + + while test $ppid -gt 1; do + read -t 1 pid comm state ppid rest < /proc/$ppid/stat + parent_processes="${parent_processes:+$parent_processes:}${ppid}" + done + for comm ; do + ppid="$(/sbin/pidofproc $comm)" || continue + parent_processes="${parent_processes:+$parent_processes:}${ppid}" + done + unset comm state ppid rest + + local -i busy + while test $SECONDS -lt $etime; do + let busy=0 + for proc in /proc/[0-9]* ; do + test -e $proc/exe || continue + let pid=${proc##*/} + case ":${parent_processes}:" in + *:${pid}:*) continue + esac + let busy=pid + break + done + test $busy -ne 0 || return 0 + usleep 500000 + done +} + +rc_runlevel() +{ + test -z "$RUNLEVEL" || return + set -- $(/sbin/runlevel) + PREVLEVEL=$1 + RUNLEVEL=$2 + export PREVLEVEL RUNLEVEL +} + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org