Starting Unix Executable in background?

Our anti-virus application, eTrust, starts services on startup. However, they conflict with AdmitMac (I believe) and consequently the Mac takes 4-6 minutes to log in. A way around this is to use the eTrust System Preference and unselect start services at startup and then start the services, also from their System Preference, manually.

My question is, is there a way that anyone know of, to schedule a Unix Executable after login. Right now, choosing to start services via the System Preference runs a Unix Executable in the background but requires the admin password. If I run the script from a shell in the Terminal I need root access and to be logged on as an admin user. However, if it is run at startup, it runs in the background without interaction but takes 4-6 minutes as I mentioned, so this is what I’d like to delay until after login. I looked at the StartupParameters.plist file and tried to add a delay and changed the OrderPreference to “last” but this doesn’t make a difference. I cannot work out how to run this after login (I was thinking of an AppleScript).

If anyone can offer suggestions as to how I might run this after login (through delay or whatever) or point me in the right direction I would be very grateful.

You could use the “with administrator privileges” phrase in your script but it will still ask for a password every time and it doesn’t give you the opportunity to use the keychain. I think the reason for this is security. Otherwise, you could make some nasty trojans with AppleScript.

The advice I got when I had a problem similar to yours was to use a plain UNIX shell script and manipulate the set UID bit to have it run as root. I haven’t actually tried this because I found another workaround to my situation.

WARNING: Not AppleScript

If you can choose which unix executable is run, you could just write a shell script that did:

sleep 200
mycommand

It would wait 200 seconds and run the command. Chmod it to 755 or something nice and put it in place of your other command and it should work.

Michael Moore
http://stuporglue.com