From 0742a71f21b54f4d31b4b722e346c8acd1c606dc Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 24 Nov 2010 09:24:09 -0800 Subject: Use LSB log status routines correctly Need to get correct exit status from failed config (or other steps) and call log_end_msg to display that status. The load config step is run in sub-shell therefore can use exec to avoid one fork. --- etc/init.d/vyatta-router | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'etc/init.d') diff --git a/etc/init.d/vyatta-router b/etc/init.d/vyatta-router index 763471a..516672f 100755 --- a/etc/init.d/vyatta-router +++ b/etc/init.d/vyatta-router @@ -115,7 +115,6 @@ migrate_bootfile () # load the initial config load_bootfile () { - if [ -x $vyatta_sbindir/vyatta-config-loader.pl ]; then log_progress_msg configure ( if [ -f /etc/default/vyatta-load-boot ]; then @@ -124,7 +123,7 @@ load_bootfile () fi sg ${GROUP} -c "$vyatta_sbindir/vyatta-config-loader.pl $BOOTFILE" ) - fi + log_end_msg $? } @@ -216,19 +215,24 @@ start () for s in ${subinit[@]} ; do if ! disabled $s; then log_progress_msg $s - ${vyatta_sbindir}/${s}.init start || (log_end_msg $? && return) + if ! ${vyatta_sbindir}/${s}.init start + then log_end_msg $? + exit 1 + fi fi done - disabled configure || load_bootfile + if ! disabled configure; then + load_bootfile + else + log_success_msg + fi load_acpi_cpufreq cleanup_raid telinit q bind_mount_boot chmod g-w,o-w / - - log_end_msg $? } stop() -- cgit v1.2.3