We've expanded our news coverage and improved our search! Visit
oreilly.com for the latest or search for all things across O'Reilly!
Article:
 |
|
Start Me Up: Writing and Understanding OS X StartupItems
|
| Subject: |
|
/Library/StartupItems and Fink's init.sh |
| Date: |
|
2003-12-20 12:13:24 |
| From: |
|
anonymous2
|
|
|
|
printenv > somelogfile.log shows that the startup items are run in a minimalistic environment -- after rc.common is loaded, only PATH, SHLVL, and _ are defined! The problem is, this means that the if [ -z "$FOO" ] etc. clauses in fink's init.sh will fail when variable FOO isn't already defined, and so using apache2 or popfile (which I have configured to use BerkeleyDB from fink) means starting them by hand.
The solution was to copy /sw/bin/init.sh to /etc/initfink.sh (or whatever), trim down the various variable-defining conditionals in initfink.sh (such as if [ -z "$MANPATH"] ... fi) with the knowledge that $PATH exists and the rest don't, replacing them with the appropriate consequence or alternative. Then, adding ". /etc/initfink.sh" after pulling in rc.common makes everything work.
|