Re: RfD: Policy of .sh boot scripts
Miquel van Smoorenburg wrote:
> In article <cistron.19981021122618.C23145@kuolema.Infodrom.North.DE>,
> Martin Schulze <joey@infodrom.north.de> wrote:
> >So regular *.sh scripts must not contain any "exit" statement.
> >(which is the case e.g. for keymap.sh)
>
> Ah, now I remember. This has been solved quite some time ago.
> *.sh scripts may contain an "exit" statement, because they are run
> in a subshell. Fragment from /etc/init.d/rcS
They don't need to be run in a subshell.
When they would have to run in a subshell I don't see a reason for
not making them work standalone. (Calling the user an idiot and
preventing him from executing them manually is not a reason.)
Btw. when we discuss boot scripts you should not always depend on
sysvinit owning the one and only method of booting the system.
Please always keep in mind that there is also file-rc. There might
be r2d2 in the future as third method.
> Now, an exit in a subshell [ in ()] will just exit that subshell. Proof:
Proof for this being not the one and only is one of the latest
bugs agains kbd.
> So there is no problem with exit in *.sh scripts. You can even press
Yes there is.
Regards,
Joey
--
We all know Linux is great... it does infinite loops in 5 seconds.
- Linus Torvalds
Reply to: