Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

So I've been attempting to create an incredibly simple upstart script.

I started with:

console output

exec /srv/scripts/test.sh

But got this error:

start: Job failed to start

So I changed it to:

console output

script
   set -x
   echo "Hello world!"
end script

This seems to run just find and dandy, but I don't get any output anywhere, and I was told there would be something written to /var/log/upstart/test.log (my script is test.conf). There was nothing written to that log file- in fact, that log file doesn't actually exist.

What am I doing wrong? How do I get just a simple script to run?

share|improve this question
    
Where did you save the upstart job? –  Braiam Nov 2 '13 at 23:58
    
@Braiam In the /etc/init directory. –  MirroredFate Nov 3 '13 at 0:06

1 Answer 1

up vote 1 down vote accepted

Apparently Upstart lies when it says you can use console and exec. Console does not work at all an exec only works if it's inside a script stanza.

Changing what I had to:

script
    exec /srv/scripts/test.sh
end script

worked, and it logged output in the log file. Unfortunately, I still have no idea how to log output to the console.

share|improve this answer

Your Answer

 
discard

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.