Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 01 Jul 2011 01:08:27 -0700
Subject:   Re: Question about NIC link state initialization
Message-ID:  <>
In-Reply-To: <>
References:  <> <> <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
Steve Polyack <> wrote:

> I was able to "fix" the single-user mode behavior (which I agree,
> isn't necessarily broken) and get it to bring up the links by
> simply patching init(8) to call system("/sbin/ifconfig") before
> prompting for the single-user shell.  It works, but I feel dirty.

I see no particular objection to adding a way of running "something"
ahead of the single-user shell, but system(3) is not necessarily the
best mechanism to use for the purpose because it invokes a shell.
It would be both more efficient and more robust to call fork(2) and
exec(3) (or execve(2)) directly.

It would be more general to fork/exec "/etc/rc.single" instead of
"/sbin/ifconfig", expecting "/etc/rc.single" to be an executable
script (with an appropriate shebang line) and ignoring the failure
which would occur if it did not exist.  (In your case, instead of
a script, you could make /etc/rc.single a link to /sbin/ifconfig.)

Want to link to this message? Use this URL: <>