Re: Leopard and scripts on startup
Re: Leopard and scripts on startup
- Subject: Re: Leopard and scripts on startup
- From: Terry Lambert <email@hidden>
- Date: Wed, 19 Mar 2008 14:03:26 -0700
On Mar 19, 2008, at 10:48 AM, Geoff Lee wrote:
On 19 Mar 2008, at 17:15, Dave Zarzycki wrote:
Any hints as to where to look for more information would be
appreciated. I've scoured the Boot process documentation on
Apple's site but the possibility of running without the window
server doesn't really seem to be covered.
Geoff,
As of Leopard, the console tty is no longer used or even setup
during boot. You're going to have to do that yourself. Please also
keep in mind that manipulating /dev/console is not a supported
feature of the operating system.
Thanks for your reply. So if I want to boot into a non-gui
environment where I can take user input, what's the best way of
going about it? I can now get the output from my script to display
on the console using <StandardOutPath> /dev/console, but (presumably
for the reasons you mention) I can't take any input (from a bash
'read').
Do I need to initialise the console with getty? Just being able to
spawn a shell would be pretty useful at this point!
I realise this is not going to be a supported configuration, but any
insight/reading pointers would be gratefully received.
Many thanks,
/dev/console is a pseudo device which gets aliased to a pty when
someone calls TIOCCONS on the master side of it to take over the
console (this is how the "Console" program works).
The frame buffer driver is actualy accessed through the "km" tty
driver, and there isn't a device node published in /dev for that.
It'd be more correct to start a getty up on that devices (major # 12,
minor number 0, subject to change in the future).
Typically, this won't do what you expect, though, because the getty
and login programs do not contain the complete logic for establishing
a controlling tty and doing session management.
Dave's little program in his other reply is enough to get one program
up, and semi-logged in on a sesion, assuming it's compiled in the
POSIX compilation environment so that the lack of the O_NOCTTY lets
the console become the controlling tty for your process.
Note that someone else can, if they choose, simply rip the console out
from under you with TIOCCONS, since you are talking to the alias
device (/dev/console) rather than the real device (/dev/km, which does
not have a device node assigned to it).
-- Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden