Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unable to read from/redirect to /dev/null on startup



Hi,

I have troubles getting an application (Gridengine queueing system) properly
autolaunched on system startup. I have created a custom item in /Library/StartupItems
to call the startup script, which works fine, but one of the daemons fails to
start when launched at boot time:

execd: critical error: can't redirect file descriptor #0

This occurs when first stdin is probed and then,

if (fstat(0, &buf)) {
if ((open("/dev/null",O_RDONLY,0))!=0) {
DEXIT;
return 0;
}
}

(where buf is a struct stat)
If fd 0 is NOT open (fstat() fails), open it and
redirect it to /dev/null. So this code is only executed if fstat() fails.


If the StartupItem script is called manually after the system has fully booted,
the same operation succeeds. I think it also used to work before 10.2.

Currently the StartupParameters.plist contains the following

Requires = ("NFS", "Resolver", "NIS", "Disks");
OrderPreference = "Late";

Is there anything else that needs to be be launched first, or how else could one get
this to work at that point in the startup process?

Thanks,
Derek

--
------------------------------------------------------------------------ -
Derek Homeier
Department of Physics & Astronomy and Center for Simulational Physics
University of Georgia Phone: ++1 (706) 583 8226
Athens, GA 30602-2451, USA Fax: ++1 (706) 542 2492
http://dilbert.physast.uga.edu/~derek/ Email: email@hidden
------------------------------------------------------------------------ -
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.