Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

start-stop-daemon error (Exec format error)

This command is part of an upstart script, which used to work in ubuntu 12.04, 10.04.

sudo start-stop-daemon --start --make-pidfile --pidfile /var/run/mk_order_handler.pid --chuid ubuntu --exec /data2/src/jeapps/sites/crons_index.php workers/mk_order_handler

I just upgraded my system to 14.04 and upstart script stopped working. When I manually executed the start-stop-daemon command I get Exec format error.

The only difference I can see is, the script is placed in a separate block device. Will it cause a problem? How could I fix this error?

like image 847
robert Avatar asked Aug 07 '14 08:08

robert


2 Answers

I just now had the same issue and in my case it was due to that my script lacked the #!/bin/bash in the first row.

like image 154
javabeangrinder Avatar answered Nov 02 '22 10:11

javabeangrinder


You should separate arguments from the executable path using --.

The result would be:

start-stop-daemon --start --make-pidfile --pidfile /var/run/mk_order_handler.pid --chuid ubuntu --exec /data2/src/jeapps/sites/crons_index.php -- workers/mk_order_handler

Also, I do not know why you are using sudo. Upstart jobs are run as root, so they do not need sudo.

like image 1
CameronNemo Avatar answered Nov 02 '22 10:11

CameronNemo