Re: Leopard and scripts on startup
Re: Leopard and scripts on startup
- Subject: Re: Leopard and scripts on startup
- From: Dave Zarzycki <email@hidden>
- Date: Wed, 19 Mar 2008 10:53:48 -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.
Geoff,
The following unsupported code would let one (and only one) launchd
job own/use /dev/console and run a shell.
int r, fd;
revoke(_PATH_CONSOLE);
fd = open(_PATH_CONSOLE, O_RDWR);
assert(fd != -1);
r = login_tty(fd);
assert(r != -1);
execl(_PATH_BSHELL, "-sh", NULL);
_exit(EXIT_FAILURE);
davez
_______________________________________________
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