From 2ffc7dc3cf1f37403bfc66e0bd4a15424bfa9a51 Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 11 Nov 2013 16:27:35 -0500 Subject: Rework the usage of the shell i/o during stop_packages(), fixes the "Syntax error: bad fd number" for the remaining people who still saw it on shutdown --- etc/inc/pkg-utils.inc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'etc/inc/pkg-utils.inc') diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index 25339eb..9f3296a 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -1336,9 +1336,9 @@ function stop_packages() { } } - $shell = @popen("/bin/sh", "w"); - if ($shell) { - foreach ($rcfiles as $rcfile => $number) { + foreach ($rcfiles as $rcfile => $number) { + $shell = @popen("/bin/sh", "w"); + if ($shell) { echo " Stopping {$rcfile}..."; if (!@fwrite($shell, "{$rcfile} stop >>/tmp/bootup_messages 2>&1")) { if ($shell) @@ -1346,9 +1346,8 @@ function stop_packages() { $shell = @popen("/bin/sh", "w"); } echo "done.\n"; + pclose($shell); } - - pclose($shell); } } -- cgit v1.1