Labels

continuous integration (9) jenkins (9) hudson (7) mac os x (5) maven (5) git (4) android (3) charles (3) launchd (3) scm (3) bitbucket (2) dvcs (2) jnlp (2) mercurial (2) python (2) ant (1) apple (1) basex (1) chrome (1) cloud server (1) cobertura (1) css (1) cvs (1) firefox (1) general (1) hardy (1) http (1) iptables (1) java (1) javascript (1) linux (1) lucid (1) stresstest (1) subversion (1) svn (1) ubuntu (1) xen (1) xml (1) xpath (1) yui2 (1)

2010/07/06

Really using launchctl to restart a Hudson Mac OS X build slave connected via JNLP automatically

In my last posting I wrote commands put into $HOME/.launchd.conf would be launched automatically after a login as stated by the man page for launchtctl. However this is false! After a reboot or relogin the commands will not be picked up! Stating man 5 launchd.conf:
$HOME/.launchd.conf  Your launchd configuration file (currently unsupported).
Pulling my ear: always try and test what you write about, sorry :-(. However using the following .plist file put into
$HOME/Library/LaunchAgents/org.hudson-ci.jnlpslave.plist really starts the slave:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>KeepAlive</key>
        <true/>
        <key>Label</key>
        <string>org.hudson-ci.jnlpslave</string>
        <key>ProgramArguments</key>
        <array>
                <string>/usr/bin/java</string>
                <string>-jar</string>
                <string>/home/hudson/bin/slave.jar</string>
                <string>-jnlpUrl</string>
                <string>http://SERVER/hudson/computer/NODE/slave-agent.jnlp</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
</dict>
</plist>
Of course you have to adapt the path to your slave.jar as well as the URL to your Hudson-master.

0 comments:

Post a Comment