Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I am trying to set up some application background processes to start on boot using systemd. It always gives me 127 exit code and I am not sure why. I thought that ExecStart command is being executed in a wrong directory. So I added ExecStartPre to output the current directory but it was not executed as well.

Here is my service file:

Description=Background processes

ExecStartPre=/bin/pwd > /home/epic/test.sys
ExecStart=/usr/local/rvm/gems/ruby-1.9.3-p194/bin/rake jobs:work

And the messages log shows when I execute systemctl start epic.service:

Apr 24 05:13:01 application systemd[1]: epic.service: main process exited, code=exited, status=127
Apr 24 05:13:01 application systemd[1]: Unit epic.service entered failed state.

How can I know what is going wrong! I tried to execute the command in shell and it works (if it was in the right directory). The server is running on Fedora 15.

share|improve this question

systemd does not support arbitrary shell commands with its Exec* statements, thus the redirection you're trying will not work. You could write a quick script and call that:


/bin/pwd > /home/epic/test.sys


Also you may want to read up on rvm wrappers to see if that would be better than calling rake directly from the rvm installation path,

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.