[maemo-developers] Aegis - Upstart script not working in Harmattan

From: Sudheer K. scifi1947 at gmail.com
Date: Fri Aug 5 09:17:56 EEST 2011
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 at 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 at gmail.com> wrote:
>
>
>
> On Tue, Aug 2, 2011 at 2:29 AM, Tuomo Tanskanen < <tumi at tumi.fi>
> tumi at 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.maemo.org/pipermail/maemo-developers/attachments/20110804/00b08fc4/attachment.htm>
More information about the maemo-developers mailing list