Skip to content

Instantly share code, notes, and snippets.

@OliPelz
Last active April 21, 2016 08:47
Show Gist options
  • Save OliPelz/1f57ac940b408bc1e31a7da74343575d to your computer and use it in GitHub Desktop.
Save OliPelz/1f57ac940b408bc1e31a7da74343575d to your computer and use it in GitHub Desktop.
minoTour mt_control.pl systemd startup script and configuration of CentOS 7 system
# log in as root, create log file destination
$ touch /var/log/mT_control.log
$ useradd minion
$ passwd minion
# check out minoTour repo into some dir e.g. /opt
$ cd /opt
$ git clone https://github.com/minoTour/minoTour.git
# change permissions to system user minion so we can run it as systemd user process
$ chown minion:minion /opt/minoTour/nefario -R
# put the following content into /etc/systemd/system/minoTour-control.service
[Unit]
Description=minoTour control script mT_control
[Service]
TimeoutStartSec=10
User=minion
ExecStart=/opt/minoTour/nefario/mT_control.pl > /var/log/mT_control.log 2>&1'
WorkingDirectory=/opt/minoTour/nefario
[Install]
WantedBy=multi-user.target
# reload systemd services (do only once)
$ systemctl daemon-reload
# to start, stop restart the service
$ systemctl start minotour-control.service
$ systemctl stop minotour-control.service
$ systemctl restart minotour-control.service
# enable on system boot (do only once)
$ systemctl enable minotour-control.service
# to view log files and get information
$ systemctl status minotour-control.service
$ tail -f /var/log/mT_control.log
journalctl --unit=minotour-control
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment