From 75359ecb9dc01dc5f2486e13c792a85c3807cfb1 Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Sun, 4 Nov 2012 22:05:44 +0100 Subject: Don't fail on no recorded profile It is important that systemd considers a netcfg-daemon startup succesfull, even if there is no recorded state to restore and /etc/conf.d/netcfg contains NETWORKS=(last). If it doesn't, it will never call `netcfg-daemon stop`, preventing the state file to get created. FS#32429 --- scripts/netcfg-daemon | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts/netcfg-daemon') diff --git a/scripts/netcfg-daemon b/scripts/netcfg-daemon index 98f96d6..b3111da 100755 --- a/scripts/netcfg-daemon +++ b/scripts/netcfg-daemon @@ -16,7 +16,12 @@ case "$1" in if [[ ${#NETWORKS[@]} -eq 1 ]]; then case $NETWORKS in last) - [[ -e $LAST_STATE ]] || exit_err "No recorded netcfg state to restore" + if [[ ! -e $LAST_STATE ]]; then + report_err "No recorded netcfg state to restore" + # This counts as successful startup since the daemon + # should be stopped on shutdown. + exit 0 + fi # The order in LAST_STATE is meaningless so we can just as # well start the profiles in parallel. -- cgit v1.2.3-24-g4f1b