Created
June 15, 2018 17:17
-
-
Save kapb14/752912de03bba97065cfdd58bec32422 to your computer and use it in GitHub Desktop.
Selenium Standalone Server as a systemd Service
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
| # /etc/systemd/system/selenium.service | |
| [Unit] | |
| Description=Selenium Standalone Server | |
| Requires=xvfb.service | |
| After=xvfb.service | |
| [Service] | |
| Type=simple | |
| User=www-data | |
| PIDFile=/opt/selenium/selenium.pid | |
| Environment=DISPLAY=:99 | |
| # Restart=always | |
| # RestartSec=10 | |
| ExecStart=/bin/java -jar \ | |
| -Dwebdriver.chrome.bin=/bin/google-chrome \ | |
| -Dwebdriver.chrome.driver=/opt/selenium/chromedriver \ | |
| -Dwebdriver.chrome.logfile=/opt/selenium/log/chrome.log \ | |
| /opt/selenium/selenium-server.jar \ | |
| -log /opt/selenium/log/selenium.log \ | |
| -role standalone \ | |
| -port 4444 | |
| ExecStartPost=-/bin/bash -c '/bin/pgrep -u www-data -f selenium | /bin/head -n 1 > /opt/selenium/selenium.pid' | |
| ExecStop=/bin/kill $(/bin/cat /opt/selenium/selenium.pid) | |
| [Install] | |
| WantedBy=multi-user.target | |
| Alias=selenium-server |
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
| # /etc/systemd/system/xvfb.service | |
| [Unit] | |
| Description=X virtual framebuffer | |
| [Service] | |
| Type=simple | |
| User=root | |
| ExecStart=/bin/Xvfb :99 -ac | |
| [Install] | |
| WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment