Last active
January 2, 2017 16:17
-
-
Save lgoldstien/55b368cf4b6a5c04b9de3df6877c1014 to your computer and use it in GitHub Desktop.
Selenium standalone server init script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### BEGIN INIT INFO | |
| # Provides: selenium | |
| # Required-Start: $local_fs $network | |
| # Required-Stop: $local_fs | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: selenium | |
| # Description: selenium standalone server acting as a hub | |
| ### END INIT INFO | |
| DESC="Selenium Standalone Server" | |
| RUN_AS=selenium | |
| JAVA_BIN=/usr/bin/java | |
| SELENIUM_DIR=/etc/selenium | |
| PID_FILE="/var/run/selenium.pid" | |
| JAR_FILE="/var/lib/selenium/selenium-server.jar" | |
| LOG_FILE="/var/log/selenium/selenium.log" | |
| DAEMON_OPTS=" -jar $JAR_FILE -log $LOG_FILE -role hub" | |
| NAME=selenium | |
| case "$1" in | |
| start) | |
| echo -n "Starting $DESC: " | |
| start-stop-daemon -c $RUN_AS --start --background --pidfile $PID_FILE --make-pidfile --exec $JAVA_BIN -- $DAEMON_OPTS | |
| echo "$NAME." | |
| ;; | |
| stop) | |
| echo -n "Stopping $DESC: " | |
| start-stop-daemon --stop --pidfile $PID_FILE | |
| echo "$NAME." | |
| ;; | |
| restart|force-reload) | |
| echo -n "Restarting $DESC: " | |
| start-stop-daemon --stop --pidfile $PID_FILE | |
| sleep 1 | |
| start-stop-daemon -c $RUN_AS --start --background --pidfile $PID_FILE --make-pidfile --exec $JAVA_BIN -- $DAEMON_OPTS | |
| echo "$NAME." | |
| ;; | |
| *) | |
| N=/etc/init.d/$NAME | |
| echo "Usage: $N {start|stop|restart|force-reload}" >&2 | |
| exit 1 | |
| ;; | |
| esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment