Search code examples
ubuntuupstart

upstart: echo in script


in my upstart script (Ubuntu 12.04.2) I have the following:

exec touch /tmp/000
exec echo "ds1307 0x68" >  /sys/class/i2c-dev/i2c-3/device/new_device
exec touch /tmp/111
exec hwclock --rtc=/dev/rtc1 --hctosys  
exec touch /tmp/222

The problem is that /tmp/000 is there but none of the other files in /tmp. So it seems after the echo the script stops.

How to rewrite the line with the echo so the script does not stop?

Thanks!


Solution

  • The command exec replaces the current process with, in your case, the touch command in line 1. Afterwards there is no shell any more to return.

    Answer: explaining the exec command.

    Try your script without the exec's.