yammer upstart script

755 views
Skip to first unread message

Ryan Pendergast

unread,
Apr 23, 2013, 5:58:09 PM4/23/13
to dropwiz...@googlegroups.com
Was wondering if someone from yammer would be willing to share their upstart script (or at least a skeleton if not comfortable).  I've seen a few examples in this group and on the web, but all seem to have some errors.  I'm going to write my own, but wondering if I can save some time by learning from gotcha's that yammer may have already run into.

Specifically, I want to avoid downtime when swapping in a new uber jar on my production env. From what I can tell there is no hot swappable feature - so I would at least like to leverage the ctrl+c graceful shutdown.  Also wondering what/if any dw. specific JVM options you use - or other JVM options for that matter.

thanks in advance.

Ryan Kennedy

unread,
Apr 24, 2013, 4:52:27 PM4/24/13
to dropwiz...@googlegroups.com
Here's the upstart configuration and the JVM configuration for one of the Yammer internal services (artie).


The first file is the upstart script, which references artie.jvm.conf (the second file). There's a bit of `sed` in the upstart script. That's stripping the comments from the jvm.conf file before passing them to JVM as arguments.

Ryan


--
You received this message because you are subscribed to the Google Groups "dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dropwizard-us...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ryan Pendergast

unread,
Apr 25, 2013, 11:30:20 AM4/25/13
to dropwiz...@googlegroups.com
Thanks Ryan. Exactly what I was looking for.

-Ryan

Sargun Dhillon

unread,
Jun 2, 2013, 7:08:52 AM6/2/13
to dropwiz...@googlegroups.com
If you're on a modern version of upstart / Ubuntu - please don't use this upstart script. It will cause a variety of problems because of PID tracking issues. 

What happens when you run it this way, is that upstart will run su, which will then run bash, which will then run Java. This obviously causes problems when you're trying to use upstart to stop your service, or monitor your service. Additionally, this can cause problems when bash dies (because, say an OOM), but the JVM is okay -- this scenario -- which has happened here at Yammer before, can cause problems.

A slightly modified version of this script lies here: https://gist.github.com/sargun/5693318

Ryan Pendergast

unread,
Jun 11, 2013, 4:58:34 PM6/11/13
to dropwiz...@googlegroups.com
I'm trying to use your script and running into problems. If i run 'start <service>' i get an error: "Error: Unable to access jarfile <path to my jar>.jar.  If I /bin/su to the user i specify in setuid/setgid and run the commands inside of 'script' things work just fine. dmesg doesnt have anything helpful.

Any idea what I may be doing wrong here? Its gotta be something simple I'm missing.

Ryan Pendergast

unread,
Jun 13, 2013, 11:37:52 AM6/13/13
to dropwiz...@googlegroups.com
turned out to be a missing +X on a dir in the chain, for the group that the system user that is running the JVM is in.  Thx for the example, works well.
Reply all
Reply to author
Forward
0 new messages