Mailing List Archive

Aegis - Upstart script not working in Harmattan
Hi,

I am trying to launch my application daemon on boot by deploying a script,
shake2skip-daemon [1] to /etc/event.d/ folder. The script is deployed using
qmake project file
syntax (INSTALLS = target launch, with launch.files=data/shake2skip-daemon
and launch.path=/etc/event.d/).


Initially I didn't include any manifest file, and aegis didn't allow the
launch script to be executed. The error from syslog without manifest was:


*Jul 28 21:09:22 (none) DSME: Got Validator message [. Fail: 1 (source origin
check) Method: 3 Process: sh File: /etc/event.d/shake2skip-daemon ]*
*Jul 28 21:09:22 (none) DSME: OK, not a mandatory file:
/etc/event.d/shake2skip-daemon*
*Jul 28 21:09:22 (none) kernel: [ 330.523223] Aegis: credp_kcheck failed
9990004 shake2skip-daemon*
*Jul 28 21:09:22 (none) kernel: [ 330.523254] Aegis: shake2skip-daemon
verification failed (source origin check)*


I created the aegis manifest file [2] in debian folder but was not sure what
credential should I request to run the launch script. I tried "credential
name="UID::root"".
However, the warning below was displayed during package installation.

*Package shake2skip: <for> refers to '/etc/event.d/shake2skip-daemon', not
installed by that package -- ignored*

Installation completed successfully and syslog does not have any aegis/credp
errors but the daemon is still not started on reboot. What I am doing wrong
here? Or, is there any other way to start scripts on boot?


~Sudheer

[1] - http://pastebin.com/BnBwP6tv
[2] - http://pastebin.com/JpZZwXEZ
Re: Aegis - Upstart script not working in Harmattan [ In reply to ]
(Posting from mobile, excuse top post)

Hi,

Harmatran has Upstart 1.2 and since 0.5 the init job directory has been /etc/init/ . /etc/event.d/ is not used. This is the main reason for your failure.

Secondly, in SDK docs (dunno URL) it is suggested that 3rd party apps are installed to /etc/init/apps/ which is dedicated for this purpose and which imposes couple limitatations to jobs in it. There has been changes in those since n950 sw version and latest internal builds.

I think Aegis might prevent your job to be run from /etc/init/ so you should install to /etc/init/apps/. Most notably, jobs launched from there cannot have "start on" stanza, but they're executed at end of boot sequence.

Hope this helps.

Cheers, Tumi

On 2.8.2011, at 10.26, "Sudheer K." <scifi1947@gmail.com> wrote:

> Hi,
>
> I am trying to launch my application daemon on boot by deploying a script, shake2skip-daemon [1] to /etc/event.d/ folder. The script is deployed using qmake project file
> syntax (INSTALLS = target launch, with launch.files=data/shake2skip-daemon and launch.path=/etc/event.d/).
>
>
> Initially I didn't include any manifest file, and aegis didn't allow the launch script to be executed. The error from syslog without manifest was:
>
>
> Jul 28 21:09:22 (none) DSME: Got Validator message [. Fail: 1 (source origin check) Method: 3 Process: sh File: /etc/event.d/shake2skip-daemon ]
> Jul 28 21:09:22 (none) DSME: OK, not a mandatory file: /etc/event.d/shake2skip-daemon
> Jul 28 21:09:22 (none) kernel: [ 330.523223] Aegis: credp_kcheck failed 9990004 shake2skip-daemon
> Jul 28 21:09:22 (none) kernel: [ 330.523254] Aegis: shake2skip-daemon verification failed (source origin check)
>
>
> I created the aegis manifest file [2] in debian folder but was not sure what credential should I request to run the launch script. I tried "credential name="UID::root"".
> However, the warning below was displayed during package installation.
>
> Package shake2skip: <for> refers to '/etc/event.d/shake2skip-daemon', not installed by that package -- ignored
>
> Installation completed successfully and syslog does not have any aegis/credp errors but the daemon is still not started on reboot. What I am doing wrong here? Or, is there any other way to start scripts on boot?
>
>
> ~Sudheer
>
> [1] - http://pastebin.com/BnBwP6tv
> [2] - http://pastebin.com/JpZZwXEZ
> _______________________________________________
> maemo-developers mailing list
> maemo-developers@maemo.org
> https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Aegis - Upstart script not working in Harmattan [ In reply to ]
On Tue, Aug 2, 2011 at 2:29 AM, Tuomo Tanskanen <tumi@tumi.fi> wrote:

> (Posting from mobile, excuse top post)
>
> Hi,
>
> Harmatran has Upstart 1.2 and since 0.5 the init job directory has been
> /etc/init/ . /etc/event.d/ is not used. This is the main reason for your
> failure.
>
> Secondly, in SDK docs (dunno URL) it is suggested that 3rd party apps are
> installed to /etc/init/apps/ which is dedicated for this purpose and which
> imposes couple limitatations to jobs in it. There has been changes in those
> since n950 sw version and latest internal builds.
>
> I think Aegis might prevent your job to be run from /etc/init/ so you
> should install to /etc/init/apps/. Most notably, jobs launched from there
> cannot have "start on" stanza, but they're executed at end of boot sequence.
>
> Hope this helps.
>
> Cheers, Tumi
>

Hi Tumi,

Thanks for your response. I changed my upstart file and deployed the file to
/etc/init/apps. This time there are no errors while deploying or in the
syslog, but the job is not started. I am using build
1.2011.22-6_PR_RM680. Is there a way to troubleshoot or solve this?

I tried to start the job manually by using "start shake2skip-daemon" command
but it fails with error "Unknown job". Here is the job configuration [1].
Any thoughts?

~Sudheer

[1] - http://pastebin.com/zbfBtt5f
Re: Aegis - Upstart script not working in Harmattan [ In reply to ]
Hi,

Like I said, there is restrictions. In week 22 build, any violation causes outright reject. IIRC (cannot verify right now) there is script called /etc/init/xsession/app-precheck.sh that checks the job validity. Run that and it'll let you know whars wrong. (that script is gone in later builds, btw and no job is rejected but just sanitized.)

Most likely your error is in using script stanza, which in week 22 was restricted (no longer in later). Workaround would be avoiding script in job, but using exec stanza and doing scripty things in separate scripts (like "exec /usr/bin/start-daemon.sh" and "pre-start exec /usr/bin/prestart-daemon.sh" etc) Its clumsy, but luckily fixed already.

Initctl commands identify jobs by path, excluding leading /etc/init/ and trailing . conf so in 3rd party app case start and stop commands look like: start apps/<jobname>

Hope this helps. Writing long answers on mobile+vkb isn't that handy :-)

Cheers, Tumi

On 3.8.2011, at 7.54, "Sudheer K." <scifi1947@gmail.com> wrote:

>
>
> On Tue, Aug 2, 2011 at 2:29 AM, Tuomo Tanskanen <tumi@tumi.fi> wrote:
> (Posting from mobile, excuse top post)
>
> Hi,
>
> Harmatran has Upstart 1.2 and since 0.5 the init job directory has been /etc/init/ . /etc/event.d/ is not used. This is the main reason for your failure.
>
> Secondly, in SDK docs (dunno URL) it is suggested that 3rd party apps are installed to /etc/init/apps/ which is dedicated for this purpose and which imposes couple limitatations to jobs in it. There has been changes in those since n950 sw version and latest internal builds.
>
> I think Aegis might prevent your job to be run from /etc/init/ so you should install to /etc/init/apps/. Most notably, jobs launched from there cannot have "start on" stanza, but they're executed at end of boot sequence.
>
> Hope this helps.
>
> Cheers, Tumi
>
> Hi Tumi,
>
> Thanks for your response. I changed my upstart file and deployed the file to /etc/init/apps. This time there are no errors while deploying or in the syslog, but the job is not started. I am using build 1.2011.22-6_PR_RM680. Is there a way to troubleshoot or solve this?
>
> I tried to start the job manually by using "start shake2skip-daemon" command but it fails with error "Unknown job". Here is the job configuration [1]. Any thoughts?
>
> ~Sudheer
>
> [1] - http://pastebin.com/zbfBtt5f
Re: Aegis - Upstart script not working in Harmattan [ In reply to ]
Thanks a lot Tumi. The upstart script is finally working.

I ran /etc/init/xsession/app-precheck.sh and it gave errors on script, if,
fi and end stanzas. I removed all of them and just called another shell
script using exec. Here [1] is the final upstart script that worked. Thanks
again for your help.

Just a note for others creating custom upstart scripts, the upstart script
in /etc/init/apps folder is started almost 1 minute (or more) after device
is booted and applications become ready for use. This made me think lot of
times that the syntax in upstart script is incorrect (even though it is
perfectly fine).

~Sudheer

[1] - http://pastebin.com/sYrq4ss6



On Wed, Aug 3, 2011 at 12:15 AM, Tuomo Tanskanen <tumi@tumi.fi> wrote:

> Hi,
>
> Like I said, there is restrictions. In week 22 build, any violation causes
> outright reject. IIRC (cannot verify right now) there is script called
> /etc/init/xsession/app-precheck.sh that checks the job validity. Run that
> and it'll let you know whars wrong. (that script is gone in later builds,
> btw and no job is rejected but just sanitized.)
>
> Most likely your error is in using script stanza, which in week 22 was
> restricted (no longer in later). Workaround would be avoiding script in job,
> but using exec stanza and doing scripty things in separate scripts (like
> "exec /usr/bin/start-daemon.sh" and "pre-start exec
> /usr/bin/prestart-daemon.sh" etc) Its clumsy, but luckily fixed already.
>
> Initctl commands identify jobs by path, excluding leading /etc/init/ and
> trailing . conf so in 3rd party app case start and stop commands look like:
> start apps/<jobname>
>
> Hope this helps. Writing long answers on mobile+vkb isn't that handy :-)
>
> Cheers, Tumi
>
> On 3.8.2011, at 7.54, "Sudheer K." <scifi1947@gmail.com> wrote:
>
>
>
> On Tue, Aug 2, 2011 at 2:29 AM, Tuomo Tanskanen < <tumi@tumi.fi>
> tumi@tumi.fi> wrote:
>
>> (Posting from mobile, excuse top post)
>>
>> Hi,
>>
>> Harmatran has Upstart 1.2 and since 0.5 the init job directory has been
>> /etc/init/ . /etc/event.d/ is not used. This is the main reason for your
>> failure.
>>
>> Secondly, in SDK docs (dunno URL) it is suggested that 3rd party apps are
>> installed to /etc/init/apps/ which is dedicated for this purpose and which
>> imposes couple limitatations to jobs in it. There has been changes in those
>> since n950 sw version and latest internal builds.
>>
>> I think Aegis might prevent your job to be run from /etc/init/ so you
>> should install to /etc/init/apps/. Most notably, jobs launched from there
>> cannot have "start on" stanza, but they're executed at end of boot sequence.
>>
>> Hope this helps.
>>
>> Cheers, Tumi
>>
>
> Hi Tumi,
>
> Thanks for your response. I changed my upstart file and deployed the file
> to /etc/init/apps. This time there are no errors while deploying or in the
> syslog, but the job is not started. I am using build
> 1.2011.22-6_PR_RM680. Is there a way to troubleshoot or solve this?
>
> I tried to start the job manually by using "start shake2skip-daemon"
> command but it fails with error "Unknown job". Here is the job configuration
> [1]. Any thoughts?
>
> ~Sudheer
>
> [1] - <http://pastebin.com/zbfBtt5f>http://pastebin.com/zbfBtt5f
>
>
Re: Aegis - Upstart script not working in Harmattan [ In reply to ]
Hi,

On 08/05/2011 09:17 AM, ext Sudheer K. wrote:
> Thanks a lot Tumi. The upstart script is finally working.
>
> I ran /etc/init/xsession/app-precheck.sh and it gave errors on script, if,
> fi and end stanzas. I removed all of them and just called another shell
> script using exec. Here [1] is the final upstart script that worked. Thanks
> again for your help.
>
> Just a note for others creating custom upstart scripts, the upstart script
> in /etc/init/apps folder is started almost 1 minute (or more) after device
> is booted and applications become ready for use.

There are quite a few apps that are pre-started[1], additional things
are run after the standard pre-started apps have been started, otherwise
those additional things could slow down their startup.

[1] See:
ps|grep prestart|grep -v invoker

(Several of these are started before desktop is up, but most are started
after that.)


- Eero

> This made me think lot of times that the syntax in upstart script is incorrect
> (even though it is perfectly fine).
>
> ~Sudheer
>
> [1] - http://pastebin.com/sYrq4ss6
>
>
>
> On Wed, Aug 3, 2011 at 12:15 AM, Tuomo Tanskanen<tumi@tumi.fi> wrote:
>
>> Hi,
>>
>> Like I said, there is restrictions. In week 22 build, any violation causes
>> outright reject. IIRC (cannot verify right now) there is script called
>> /etc/init/xsession/app-precheck.sh that checks the job validity. Run that
>> and it'll let you know whars wrong. (that script is gone in later builds,
>> btw and no job is rejected but just sanitized.)
>>
>> Most likely your error is in using script stanza, which in week 22 was
>> restricted (no longer in later). Workaround would be avoiding script in job,
>> but using exec stanza and doing scripty things in separate scripts (like
>> "exec /usr/bin/start-daemon.sh" and "pre-start exec
>> /usr/bin/prestart-daemon.sh" etc) Its clumsy, but luckily fixed already.
>>
>> Initctl commands identify jobs by path, excluding leading /etc/init/ and
>> trailing . conf so in 3rd party app case start and stop commands look like:
>> start apps/<jobname>
>>
>> Hope this helps. Writing long answers on mobile+vkb isn't that handy :-)
>>
>> Cheers, Tumi
>>
>> On 3.8.2011, at 7.54, "Sudheer K."<scifi1947@gmail.com> wrote:
>>
>>
>>
>> On Tue, Aug 2, 2011 at 2:29 AM, Tuomo Tanskanen< <tumi@tumi.fi>
>> tumi@tumi.fi> wrote:
>>
>>> (Posting from mobile, excuse top post)
>>>
>>> Hi,
>>>
>>> Harmatran has Upstart 1.2 and since 0.5 the init job directory has been
>>> /etc/init/ . /etc/event.d/ is not used. This is the main reason for your
>>> failure.
>>>
>>> Secondly, in SDK docs (dunno URL) it is suggested that 3rd party apps are
>>> installed to /etc/init/apps/ which is dedicated for this purpose and which
>>> imposes couple limitatations to jobs in it. There has been changes in those
>>> since n950 sw version and latest internal builds.
>>>
>>> I think Aegis might prevent your job to be run from /etc/init/ so you
>>> should install to /etc/init/apps/. Most notably, jobs launched from there
>>> cannot have "start on" stanza, but they're executed at end of boot sequence.
>>>
>>> Hope this helps.
>>>
>>> Cheers, Tumi
>>>
>>
>> Hi Tumi,
>>
>> Thanks for your response. I changed my upstart file and deployed the file
>> to /etc/init/apps. This time there are no errors while deploying or in the
>> syslog, but the job is not started. I am using build
>> 1.2011.22-6_PR_RM680. Is there a way to troubleshoot or solve this?
>>
>> I tried to start the job manually by using "start shake2skip-daemon"
>> command but it fails with error "Unknown job". Here is the job configuration
>> [1]. Any thoughts?
>>
>> ~Sudheer
>>
>> [1] -<http://pastebin.com/zbfBtt5f>http://pastebin.com/zbfBtt5f
>>
>>
>
>
>
> _______________________________________________
> maemo-developers mailing list
> maemo-developers@maemo.org
> https://lists.maemo.org/mailman/listinfo/maemo-developers

_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers