3

I want to run upstart job. I've created upstart file and put it to /etc/init folder

#/etc/init/myjob.conf

description "test job"

start on runlevel [2345]

exec /home/megas/test.sh

and then created script in home directory

#/home/megas/test.sh

#!/bin/sh
echo "test job, reporting..."

Then I'm trying to run

sudo start myjob

but got message

start: Job failed to start

What I'm doing wrong? How to create upstart job?

1
  • There should be a log file in /var/log/upstart/myjob.log. Check it's contents and post said contents if you don't understand. Jan 15, 2014 at 18:34

1 Answer 1

0

I did some testing on lubuntu 12.04 and the problem is due to wrong permission of test.sh, so try:

 $ chmod +x /home/megas/test.sh

When you start the job:

 $ sudo start myjob
 myjob stop/waiting

This is normal behavior for task job and echo output is stored in:

/var/log/upstart/myjob.log

According to upstart manual:

When a Task Job starts, its goal will be start and once the task in question has completed, Upstart will change its goal to stop.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .