diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-11-24 09:24:09 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-11-24 11:51:46 -0800 |
commit | 0742a71f21b54f4d31b4b722e346c8acd1c606dc (patch) | |
tree | 9b93e6274b0eb5bc78022347c1b3a97f0fe578fb /etc | |
parent | 36a92e3fe4241a6cc51319d7d78f2e732afa5bfc (diff) | |
download | vyatta-cfg-0742a71f21b54f4d31b4b722e346c8acd1c606dc.tar.gz vyatta-cfg-0742a71f21b54f4d31b4b722e346c8acd1c606dc.zip |
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.
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/init.d/vyatta-router | 16 |
1 files changed, 10 insertions, 6 deletions
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() |