Last active
April 21, 2016 08:47
-
-
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
This file contains 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
# 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 |
This file contains 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
# 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 |
This file contains 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
# 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