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.

I'm writing an upstart script that has to issue several utilities to manipulate files, ls, rm, etc. Some of these commands are not being executed. If I put a timer and make the script wait, they work.

Is there a upstart variable that I can use to ensures command line utilities are fully loaded and available when my script executes?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Well the proper way of doing things is to use events. Other Upstart scripts emit signals when they are doing things, this way you can have:

start on (local-filesystems and net-device-up IFACE!=lo)

... and your script won't start until the filesystem and local networking are ready for business.

This still might not work for you (I'm not sure what level you need to wait until) but have a play around, listening to different events.

You can read more about start-on in the cookbook.

share|improve this answer
    
Ok. I'll give it try. The commands I use are all in core utilities. It would be nice to know what event makes cp or ls available. –  bambuntu Feb 29 '12 at 22:40
    
I'd expect them to be available very early on but they're useless if you don't have a filesystem for them to work on. –  Oli Feb 29 '12 at 23:10

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.