Ticket #249 (new enhancement)

Opened 8 years ago

Last modified 8 years ago

upstart startup script for ubuntu

Reported by: philip Owned by: somebody
Priority: major Milestone:
Component: startstop Version:
Keywords: Cc:

Description

I am working on getting my earthworm running on ubuntu 12.04. It looks like ubuntu is moving from sysv init.d style startup scripts to upstart. http://upstart.ubuntu.com/cookbook/

I managed to get things working, with more effort than would seem required by such a short script. My attempt is attached. If you are making progress with the earthworm as ubuntu/debian package you might want to include this startup script (as /etc/init/earthworm). Obviously feel free to change it if you think of improvements (but also let me know so I can fix mine!!! :)

One issue I ran into that was a bit painful to track down was ubuntu startup scripts use dash instead of bash. This means that the default ew_linux.bash script to get the environment set up correctly doesn't work. These were the two offending lines:

export CFLAGS=$GLOBALFLAGS export CPPFLAGS=$GLOBALFLAGS

This fails with an error about "-Dlinux" not being recognized, which is a bit cryptic. Eventually I figured out that because GLOBALFLAGS was "-m32 -Dlinux -Di386 ..., then dash was breaking on the space, setting CFLAGS to be just the first "-m32" and then trying to run the second "-Dlinux". The solution is to quote like so:

export CFLAGS="$GLOBALFLAGS" export CPPFLAGS="$GLOBALFLAGS"

More info on bash/dash issues in ubuntu is here: https://wiki.ubuntu.com/DashAsBinSh

It would probably be a good thing to make ew_linux.bash actually be dash compatible. I might even go so far to say that perhaps we should separate the "run" environment from the "compile" environment. There isn't any real need to have things like CFLAGS defined for just running.

Might work on this more later, but the basics seem to be there. Philip

Attachments

earthworm.conf (1.0 KB) - added by philip 8 years ago.
upstart startup script for ubuntu

Change History

Changed 8 years ago by philip

upstart startup script for ubuntu

comment:1 Changed 8 years ago by philip

Updates the script to use

# eventually it would be better to depend on actual upstart events, but use # runlevel for now... start on runlevel [2345]

stop on runlevel [016]

Note: See TracTickets for help on using tickets.