Ask Your Question

Own service - 'command not found...'

asked 2013-05-22 05:42:12 -0500

lciura gravatar image

updated 2013-06-04 22:59:02 -0500


I have problem with created service.

My scripts:

File: /usr/lib/systemd/system/own.service

Description=service web

ExecStart=/bin/sh /home/lciura/Projects/website/service_helper


File: /home/lciura/Projects/website/service_helper

# service_helper - for starting ukpower page


cd /home/lciura/Projects/website passenger start > /home/lciura/Projects/website/log/passenger/log_test 2>&1 & 
exit $?

I use this command to start service:

[lciura@localhost system]$ sudo systemctl start ukpower.service

Service status give me:

Loaded: loaded (/usr/lib/systemd/system/own.service; disabled)
          Active: inactive (dead)

And log file has:

/home/lciura/Projects/website/service_helper: line 9: passenger: command not found

Any idea why this isn't work? I use Fedora 18.

Thanks for your time! :)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-05-23 17:19:22 -0500

updated 2013-05-23 17:20:12 -0500

cd /home/lciura/Projects/website passenger start

You either need to change directories and execute the application as seperate commands:

cd /home/lciura/Projects/website; ./passenger start

Or simply call the executable directly:

/home/lciura/Projects/website/passenger start

Note that you could probably just do this in the .service file without the intermediary bash script.

edit flag offensive delete link more

answered 2013-05-23 14:43:17 -0500

sergiomb gravatar image

cd /home/lciura/Projects/website passenger start > /home/lciura/Projects/website/log/passenger/log_test 2>&1 &

try: cd /home/lciura/Projects/website ./passenger start > /home/lciura/Projects/website/log/passenger/log_test 2>&1 &

edit flag offensive delete link more


No. You're still passing two different commands on one line.

randomuser gravatar imagerandomuser ( 2013-07-02 22:54:12 -0500 )edit

Question Tools


Asked: 2013-05-22 05:42:12 -0500

Seen: 356 times

Last updated: Jun 04 '13