com.user.loginscript[ ]): Exited with code: 1

0

Whenever we restart our server it changes our DNS and apache settings. I haven't been able to figure out why, so I wrote a quick script to restore these to safe settings on login to fix Mac OS X Server's presumptuousness.

So I wrote a script:

#!/bin/sh                                                                                                                                 
cp /Users/takp/Safe/apachesites/*.* /Library/Server/Web/Config/apache2/sites
cp /Users/takp/Safe/named/*.*  /Library/Server/named
apachectl restart

And added a launchctl plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>Label</key>
   <string>com.user.loginscript</string>
   <key>Program</key>
   <string>/Users/takp/Safe/loginscript.sh</string>
   <key>RunAtLoad</key>
   <true/>
</dict>
</plist>

And made it executable

But whenever I try to run it I get the error:

com.user.loginscript[87776]): Exited with code: 1

How can I get this login script to run happily?

glenstorey

Posted 2014-04-15T21:10:53.817

Reputation: 101

What version of OSX? – Canadian Luke – 2014-04-15T22:08:16.853

Sorry - 10.9.2 all software updates applied. – glenstorey – 2014-04-16T01:04:55.113

No answers