On Saturday 14 July 2007 12:55, Alexander Kriegisch wrote:
> I hope not to be off-topic or ask a question the anwer of which should
> be obvious.
>
> I noticed that my embedded system (WLAN/DSL router) stops booting if any
> uncaught error occurs in my 'ash' init scripts. Is this the expected
> behaviour for scripts running in a process not connected to a console
> (no serial cable here, I can connect only later via telnet on pts)? It
> seems to be as if I run "sh -e" or "set -e" within an interactive shell.
When reporting stuff like this, try to present a testcase.
If it doesn't work on some non-i386 arch, try to reproduce on i386
as many people are sitting on this arch.
I tried to construct a testcase. z.sh:
echo first
false
echo second
Works when run "normally":
$ ./busybox ash z.sh
first
second
Works when run daemonized:
$ daemon ./busybox ash z.sh
Closing file descriptors 8192-3... done.
$ cat /tmp/daemon.3427.log
Date: Sat Jul 14 16:12:58 IST 2007
Directory: /home/vda/srcdev/bbox/fix/busybox.t2
Command: ./busybox ash z.sh
========
first
second
FYI: "daemon" is a script shown below:
$ cat ~/bin/daemon
#!/bin/sh
i=`ulimit -n`
echo -n "Closing file descriptors $i-3... "
while test "$i" -ge 3; do
eval "exec $i>&-"
i=$(($i-1))
done
echo "done."
>/tmp/daemon.$$.log
>>/tmp/daemon.$$.log echo "Date: `date`"
>>/tmp/daemon.$$.log echo "Directory: `pwd`"
>>/tmp/daemon.$$.log echo "Command: $@"
>>/tmp/daemon.$$.log echo "========"
>>/tmp/daemon.$$.log 2>&1 </dev/null setsid "$@" &
IOW: I cannot reproduce it.
> but nonetheless I am curious and would like to know if this behaviour is
> to be expected. Would it be a problem to set +x globally in an init
> script or is it kind of mandatory for it to fail (sounds crazy, but I am
> asking anyway)?
I think generally we try to make ash behave similar to bash.
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox