LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Creating a systemd unit for gcr (https://www.linuxquestions.org/questions/linux-newbie-8/creating-a-systemd-unit-for-gcr-4175525229/)

raisdead 11-12-2014 04:38 PM

Creating a systemd unit for gcr
 
I am trying to create a systemd unit file to run gcr. gcr runs in the foreground and polls an http server at a regular interval reporting activity to stdout. I created a unit file at /etc/systemd/system/gitlab-ci-runner with these contents.

Code:

[Unit]
Description=GitLab CI Runner supervision process
After=gitlab-runsvdir.service

[Service]
Type=simple
User=gitlab-ci-runner
ExecStart=/root/.nvm/current/bin/gcr -u http://ci.clipped.com -t a84b<clipped>25db
Restart=always

When I run `systemctl start gitlab-ci-runner`. I get the following with `systemctl status gitlab-ci-runner`

Code:

Loaded: loaded (/etc/systemd/system/gitlab-ci-runner.service; static)
  Active: active (exited) since Mon 2014-11-10 10:45:46 CST; 2 days ago

Nov 12 16:27:19 host systemd[1]: Started GitLab CI Runner supervision process.

It looks like it terminated, but it should not. How can I debug this further? I an new to systemd so any pointers are appreciated. Running `su - gitlab-ci-runner -c "/root/.nvm/current/bin/gcr -u http://ci.clipped.com -t a84b<clipped>25db"` produces something like the following.

Code:

gcr info [client] checking for builds...
gcr http 404 http://ci.clipped.com/api/v1/builds/register.json
gcr info [client] checking for builds...
gcr http 404 http://ci.clipped.com/api/v1/builds/register.json


unSpawn 11-12-2014 05:32 PM

If you look at the .service files in /usr/lib/systemd/system/ I think systemd expects either one shot applications or daemons or at least applications that can be told they should run headless, implying they close stdout/stderr themselves?..


All times are GMT -5. The time now is 02:02 AM.