Skip to content

Instantly share code, notes, and snippets.

@imeredith
Last active August 29, 2015 14:00
Show Gist options
  • Save imeredith/d9134ff8fc04641f6fb6 to your computer and use it in GitHub Desktop.
Save imeredith/d9134ff8fc04641f6fb6 to your computer and use it in GitHub Desktop.
Upstart script for opes.
# send output to /var/log/upstart/
console log
description "Jenkins slave"
exec java -jar /path/to/jenkins-cli.jar -i /path/to/key -s https://<jenkins url> on-premise-executors -name ...
respawn
# user you want to
setuid {username}
start on runlevel [2345]
stop on runlevel [016]
# To install
# Use sudo, or sudo su - to change to root user
# copy file into /etc/init/ope.conf
# ln -s /lib/init/upstart-job /etc/init.d/ope
# initctl start ope
# This is from https://github.com/jenkinsci/upstart-slave-installer-module/blob/master/src/main/java/org/jenkinsci/modules/upstart_slave_installer/UpstartSlaveInstaller.java#L59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment