<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body style="font-family: Arial; font-size: 13px;" bgcolor="#ffffff"
    text="#000000">
    <div style="font-family: Arial; font-size: 13px;">
      <div style="display: inline;">Hello there,<br>
        <br>
        Thx for the help :).<br>
        I Now have the script as followed.<br>
        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.<br>
        <br>
        Thank you very much.<br>
        <br>
        ---<br>
        description "MyApp - startup script"<br>
        <br>
        start on runlevel [345]<br>
        stop on runlevel [016]<br>
        <br>
        chdir /apps/inbox<br>
        <br>
        script<br>
                cd /apps/inbox<br>
                exec su myapps -c "screen -D -m -S MYAPP java -jar
        MyApp.jar"<br>
        end script<br>
        ---<br>
        <br>
        <br>
      </div>
      <span style="color: rgb(0, 0, 0);" class="headerSpan">On
        2011-03-22 13:05, Evan Huus wrote:</span>
      <blockquote style="font-family: serif;"
        cite="mid:AANLkTikbGG7O_LR-9X6dae54rzCCT=+O5ZvqQKGB-t22@mail.gmail.com"
        type="cite">
        <pre wrap="">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
those?

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.

Cheers,
Evan

On Tue, Mar 22, 2011 at 6:24 AM, Mathijs <a class="moz-txt-link-rfc2396E" href="mailto:mathijs@smoeltje.nl"><mathijs@smoeltje.nl></a> wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="">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 [2345]
stop on runlevel [016]

expect daemon
#expect fork
console output

script
        cd /apps/inbox
        exec su myapps -c "screen -d -m -S MYAPP java -jar MyApp.jar"
end script
---

--
upstart-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:upstart-devel@lists.ubuntu.com">upstart-devel@lists.ubuntu.com</a>
Modify settings or unsubscribe at:
<a class="moz-txt-link-freetext" href="https://lists.ubuntu.com/mailman/listinfo/upstart-devel">https://lists.ubuntu.com/mailman/listinfo/upstart-devel</a>


</pre>
        </blockquote>
      </blockquote>
      <br>
    </div>
  </body>
</html>