From: Willy Tarreau Date: Mon, 1 Jun 2009 23:20:06 +0000 (+0200) Subject: * functions: fix bug when enumerating sections with an "autostart" statement X-Git-Url: http://git.formilux.org/?p=dist%2Fsrc%2Finit-scripts.git;a=commitdiff_plain;h=a6d0b0cd1c64c3c85027d0a53bcceafdc429a7c0 * functions: fix bug when enumerating sections with an "autostart" statement A few occurrences of "A=B" instead of "A==B" in an awk script caused services marked "autostart" not to start at boot time. --- diff --git a/sbin/init.d/functions b/sbin/init.d/functions index 29ac437..d50c1eb 100755 --- a/sbin/init.d/functions +++ b/sbin/init.d/functions @@ -148,13 +148,13 @@ if [ $LIST_SECTIONS = 1 ]; then awk -v onlyauto=$SVC_AUTO_START \ 'BEGIN{svc="";auto=1} \ /^[[:blank:]]*service/ {if (svc!="" && (auto || !onlyauto)) print svc;svc=$2 ($3?" "$3:"");auto=1} \ - /^[[:blank:]]*(no|)[[:blank:]]*autostart/ {if ($1="no" && $2="autostart") auto=0;else if ($1=="autostart") auto=1} \ + /^[[:blank:]]*(no|)[[:blank:]]*autostart/ {if ($1=="no" && $2=="autostart") auto=0;else if ($1=="autostart") auto=1} \ END{if (svc!="" && (auto || !onlyauto)) print svc}' $CONFIG exit 0 elif [ $LIST_BOOT_STATUS = 1 ]; then awk -v onlyauto=$SVC_AUTO_START 'BEGIN{svc="";auto="A"} /^[[:blank:]]*service/ {if (svc!="" && (auto=="A" || !onlyauto)) print auto " " svc;svc=$2 ($3?" " $3:"");auto="A"} - /^[[:blank:]]*(no|)[[:blank:]]*autostart/ {if ($1="no" && $2="autostart") auto="M";else if ($1=="autostart") auto="A"} + /^[[:blank:]]*(no|)[[:blank:]]*autostart/ {if ($1=="no" && $2=="autostart") auto="M";else if ($1=="autostart") auto="A"} END{if (svc!="" && (auto=="A" || !onlyauto)) print auto " " svc}' $CONFIG exit 0 fi