7

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?

tshepang
  • 12,111
  • 21
  • 91
  • 136
robert
  • 8,459
  • 9
  • 45
  • 70

2 Answers2

17

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.

javabeangrinder
  • 6,939
  • 6
  • 35
  • 38
1

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.

tshepang
  • 12,111
  • 21
  • 91
  • 136
CameronNemo
  • 616
  • 3
  • 10