commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew January <>
Subject [daemon] Upstart integration (removing checkuser)
Date Tue, 13 Oct 2015 13:34:18 GMT

I'm trying to get upstart to launch a a java program daemonized using jsvc.

Upstart (annoyingly) doesn't have any support for pid files, but instead
monitors system calls to detect forks. You can control whether it's
expecting 1 or 2 forks using the "expect fork" and "expect daemon"
respectively (

If I don't pass the -user flag to jsvc, I can get upstart to detect the
controller process using "expect fork". However, if I _do_ pass the -user
flag (because the java program needs to read some root-owned files on
startup, then drop to a non-privileged user) it doesn't pick up the correct
process because jsvc has extra forks to check the user passed in is valid (
You actually get two extra forks, because the process restarts with the
given procname.

Looking through the code, the only reason I can see for it to fork and
check the user is as a fail-early strategy and not create the controller
process if it's never going to be able to switch the user. I am thinking of
submitting a patch to add a "-disableusercheck" flag which would skip the
checkuser call. Is there another reason for the checkuser fork that means
removing it would lead to issues? If I submitted such a patch is it likely
to be considered?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message