Skip to content

Instantly share code, notes, and snippets.

@thefotios
Created September 28, 2011 14:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thefotios/1248075 to your computer and use it in GitHub Desktop.
Save thefotios/1248075 to your computer and use it in GitHub Desktop.
/etc/init.d/selenium script
#!/bin/bash
#
# Service for selenium (from http://www.thelinuxblog.com/adding-a-service-on-fedora/)
#
# Author: Fotios Lindiakos (fotios@redhat.com)
#
# chkconfig: 2345 55 45
#
# description: This is the selenium service
# processname: selenium
#
RETVAL=0;
start() {
echo "Starting selenium"
/usr/local/bin/ephemeral-x java -jar /var/lib/selenium/selenium-server.jar -role webdriver -hub http://ec2-107-20-156-96.compute-1.amazonaws.com:4444 -nodeConfig /var/lib/selenium/config.json -log /var/log/selenium.log &> /dev/null &
}
stop() {
echo "Stopping selenium"
pkill -f '-role webdriver'
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment