How to run unix script in login screen before user logs in? I would like to have unix script run when the login screen appears when booting. It should run immediately and not when user enters username and password and logs in.

Is there any way to accomplish this?
Launchd and LoginWindow

You can use launchd to run your script when the Login Window appears. Within your launchd job ticket, include the key pair:

&lt;key&gt;LimitLoadToSessionType&lt;/key&gt;
&lt;string&gt;LoginWindow&lt;/string&gt;


Save your launchd job ticket, .plist, file in the folder: /Library/LaunchAgents/.