Need help with upstart/init conf selecting wrong PID.
mathijs at smoeltje.nl
Tue Mar 22 12:29:58 UTC 2011
Thx for the help :).
I Now have the script as followed.
This seems to work, i can start/stop it via service, and if i kill or
stop the script from within the screen, service also see this.
Thank you very much.
description "MyApp - startup script"
start on runlevel 
stop on runlevel 
exec su myapps -c "screen -D -m -S MYAPP java -jar MyApp.jar"
On 2011-03-22 13:05, Evan Huus wrote:
> I'm not 100% sure of this, but I think it's because you have 'exec su'
> and 'screen', both of which do process manipulation (exec, fork, etc.)
> which is confusing it. I don't think it can handle two layers of
> It's worth trying to change your screen arguments to "-D -m -S etc"
> because according to man screen, the capital D argument is the same as
> the lower-case d argument except that it stops screen from forking.
> If this doesn't work, then I'm really not sure what the problem is,
> sorry. Maybe somebody else on the list will know.
> On Tue, Mar 22, 2011 at 6:24 AM, Mathijs <mathijs at smoeltje.nl> wrote:
>> Hello there,
>> I don't know where to go with this question, so i hope i can try it here.
>> I have created an upstart config to start an application via screen.
>> This way that application can be entered via screen when needed.
>> The application starts correctly via the init conf, but it doesn't have the
>> correct PID.
>> I tried expect daemon, fork, and non, but this doesn't work.
>> With daemon and fork it starts, but not the correct PID, and status myapp,
>> thinks it is still running.
>> With no expect, it also starts, but then i thinks it isn't running anymore.
>> What can i do to fix/track this problem?
>> Here is the conf:
>> description "MyApp - startup script"
>> start on runlevel 
>> stop on runlevel 
>> expect daemon
>> #expect fork
>> console output
>> cd /apps/inbox
>> exec su myapps -c "screen -d -m -S MYAPP java -jar MyApp.jar"
>> end script
>> upstart-devel mailing list
>> upstart-devel at lists.ubuntu.com
>> Modify settings or unsubscribe at:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the upstart-devel