Understanding /etc/inittab
Denys Vlasenko
vda.linux at googlemail.com
Sat Dec 25 22:57:17 UTC 2010
On Saturday 25 December 2010 19:43, Sameer Naik wrote:
> Hi,
>
> I have been going through the inittab script for various filesystems.
> I have noticed that quite a few of them specify the sysint line as
> follows:
>
> ::sysinit:-/etc/init.d/rcS
>
> I would like to know what the '-' character before the action is for.
>
> I imagined it was to specify a login environment. I am not sure
> though. Earlier when i was trying to launch an application in the
> background through an init.d script, the application would just not
> launch. When i removed the '-' character from the above line, i was
> able to do so.
>
> Today i found that if i keep the '-' character and launch the
> application in the background using start-stop-daemon, it works fine.
It makes init try to acquire a controlling tty for the command before
running it. If "acquire ctty" doesn't work, init runs the command
anyway.
> Lastly, the PATH i have specified in the /etc/profile does not seem to
> be available in the rcS scripts, including mdev hotplug scripts. I
> have to specify the additional paths in rcS and hotplug scripts.
/etc/profile is loaded by login shell only.
Login shell is one which has '-' as a first char of its argv[0],
or one started with -l option.
--
vda
More information about the busybox
mailing list