Friday, October 28, 2016

systemd: Create a service

Example of the service configuration file `selenium_hub.service`:
Description=Selenium hub

ExecStart=/bin/bash -c 'java -jar /opt/selenium/selenium-server-standalone.jar -role hub'

Place this file to /etc/systemd/system/ (symlinking won't work) and refresh available services:
sudo systemctl daemon-reload
Now it is possible to start the service with command:
sudo service selenium_hub status
You can also make it start when a system starts by executing one of the following commands:
sudo chkconfig selenium_hub on
sudo systemctl enable selenium_hub.service

No comments:

Post a Comment