Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Run with upstart #901

Open
dnd opened this issue Oct 20, 2015 · 6 comments
Open

Run with upstart #901

dnd opened this issue Oct 20, 2015 · 6 comments

Comments

@dnd
Copy link

dnd commented Oct 20, 2015

What's the recommended way to run Flapjack with Upstart? Using the regular init script that comes with Flapjack I find it periodically crashing. I have tried multiple forms of flapjack server start with the upstart script(exec, script, expect fork/daemon, etc...), but it usually just hangs and doesn't come back. The only thing that seems to work is just straight exec flapjack server start with no fork expectations, but then upstart just continually tries to start the server process. Any help would be appreciated.

@ghost
Copy link

ghost commented Oct 20, 2015

server start in flapjack v1 is daemonized, you'd need to run it with --no-daemonize I think. (v2 just runs in the foreground, but not knowing much about this stuff I've used start-stop-daemon: e.g. https://github.com/flapjack/omnibus-flapjack/blob/master/dist/etc/init.d/v2/deb/flapjack )

If you do come up with working Upstart scripts, we can integrate them into the packages via https://github.com/flapjack/omnibus-flapjack/tree/master/dist/etc/init.d/ , either v1 or v2 or both.

@ghost
Copy link

ghost commented Oct 20, 2015

If the crashes are logged, can you open separate issues for those?

@dnd
Copy link
Author

dnd commented Oct 20, 2015

I'm running 1.6, and I tried --no-daemonize. It works great running straight from the command line, but when run inside an upstart script it never starts. Issuing service flapjack start just hangs there and never returns.

@dnd
Copy link
Author

dnd commented Oct 20, 2015

It looks like I may have been running into a bug with upstart. I tried a workaround to rename the upstart file since I couldn't restart, and for now at least it appears to be working.

This is tentatively what I have

description "flapjack"

start on runlevel [2345]
stop on runlevel [016]

respawn

env PATH=/opt/flapjack/bin:$PATH

exec flapjack server start --no-daemonize

@dnd
Copy link
Author

dnd commented Oct 20, 2015

Also, just to make sure. Is it perfectly safe to run flapjack on multiple machines at the same time?

@ghost
Copy link

ghost commented Oct 20, 2015

As long as they're pointing to the same Redis instance, yes. In the future it'd be nice to move to a more easily distributed data store, but for now that's the limiting factor.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant