Anyone know how to get a perl script to run on startup as root? It runs indefinately. I tried using:
Code:
#!/bin/sh
#
# *********************************************************************
# ** /Library/StartupItems/PerlScript/Script **
# *********************************************************************
# ** **
# ** To configure script to launch: as root, edit the file **
# ** /etc/hostconfig After the SCRIPT entry, add this line: **
# ** SCRIPT=-YES- You can easily change this entry to enable **
# ** or disable the Script whenever you like. **
# ** **
# ** **
# *********************************************************************
#
# ---------------------------------------------------------------------
# Include system wide configuration options
# ---------------------------------------------------------------------
. /etc/rc.common
# ---------------------------------------------------------------------
# Start script
# ---------------------------------------------------------------------
if [ "${SCRIPT:=-NO-}" = "-YES-" ]; then
ConsoleMessage "Starting SCRIPT"
/usr/bin/perl /path/to/script.pl -option
fi
then for StartupParameters.plist
Code:
{
Description = "script loader";
Provides = ("script");
Requires = ("Resolver");
OrderPreference = "None";
Messages =
{
start = "Starting Script";
stop = "Stopping Script";
};
}
But this all resulted in the system hanging indefinately on startup.
The script never ends, it runs with no output as a process. it should do that... but the system should just leave it running in the background to do it's work.
Any ideas?