Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor LAS_VEGAS's Avatar
    Join Date
    Sep 2006
    Posts
    79
    I created a helloworld application using ESbox and installed it on the device. The application works fine when I type the following in x terminal:

    Code:
    ~ $ which helloworld
    /usr/bin/helloworld
    ~ $ helloworld
    Now I want to add it to startup so that it runs automaticaly after the boot. I created a upstart script named "helloworld" in /etc/event.d/ as root and I also did:
    Code:
    "chmod +x helloworld"
    The /etc/event.d/helloworld file is like this:
    Code:
    start on runlevel 4
    start on startup
    
    console none
    
    exec /usr/bin/helloworld
    
    service # tried also commenting this out but no success
    After I restart the phone, I open a X terminal window and when I type the following I get:

    Code:
    /etc/event.d # initctl list helloworld
    initctl: No jobs matching 'helloworld'
    /etc/event.d #
    Any ideas why my app has not started?

  2. #2
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    You are using sysvinit script, which is supported by upstart.
    After creating the script you have to register with the command:
    Code:
    update-rc.d helloworld defaults
    It will create symlinks in corresponding /etc/rc*.d/ directories.

    See manual page of update-rc.d for the details:
    http://www.tin.org/bin/man.cgi?secti...ic=update-rc.d

  3. #3
    Regular Contributor LAS_VEGAS's Avatar
    Join Date
    Sep 2006
    Posts
    79
    Quote Originally Posted by divanov View Post
    You are using sysvinit script, which is supported by upstart.
    After creating the script you have to register with the command:
    Code:
    update-rc.d helloworld defaults
    It will create symlinks in corresponding /etc/rc*.d/ directories.

    See manual page of update-rc.d for the details:
    http://www.tin.org/bin/man.cgi?secti...ic=update-rc.d
    I get this error:
    Code:
    update-rc.d helloworld defaults
    /etc/init.d/helloworld: file does not exist
    I don't have an init.d script, I am trying to do this using only upstart.
    Last edited by LAS_VEGAS; 2010-01-08 at 12:03.

  4. #4
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    And what happens if you try:
    Code:
    start helloworld
    ?

  5. #5
    Regular Contributor LAS_VEGAS's Avatar
    Join Date
    Sep 2006
    Posts
    79
    I have changed the script in /etc/event.d/helloworld, to make it simpler, like this:

    Code:
    start on runlevel 2
    
    console output
    
    script
          echo "helloworld" > /tmp/helloworld.out
          date >> /tmp/helloworld.out
    end script
    And when I start the script manually
    Code:
    /home/user # start helloworld
    (start) waiting
    (start) starting
    (start) pre-start
    (start) spawned, process 1836
    (start) post-start, (main) process 1836
    (start) running, process 1836
    (stop) running
    (stop) stopping
    (stop) killed
    (stop) post-stop
    (stop) waiting
    /home/user #
    After this the file /tmp/helloworld.out is created and says "helloworld" and the date. Then I remove it and reboot the phone, and check again, but there is no such file there.

  6. #6
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Quote Originally Posted by LAS_VEGAS View Post
    I have changed the script in /etc/event.d/helloworld, to make it simpler, like this:

    Code:
    start on runlevel 2
    Change it to
    Code:
    start on startup
    and for exec it's probably the best to use:
    Code:
    start on started hildon-desktop

  7. #7
    Regular Contributor LAS_VEGAS's Avatar
    Join Date
    Sep 2006
    Posts
    79
    OK I did that but no success

    Code:
    start on startup
    
    console output
    
    script
          echo "helloworld" > /tmp/helloworld.out
          date >> /tmp/helloworld.out
    end script

  8. #8
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Quote Originally Posted by LAS_VEGAS View Post
    OK I did that but no success

    Code:
    start on startup
    
    console output
    
    script
          echo "helloworld" > /tmp/helloworld.out
          date >> /tmp/helloworld.out
    end script
    Your script works. There is a message in syslog that script cannot write to not mounted partition.

  9. #9
    Regular Contributor LAS_VEGAS's Avatar
    Join Date
    Sep 2006
    Posts
    79
    OK, I got it work. It was ranning too early. I changed "start on" line and it worked. Thanks a lot!

Similar Threads

  1. ARMI - THUMB
    By adrianogalati in forum Symbian C++
    Replies: 6
    Last Post: 2007-10-23, 19:57
  2. how can I run for ARMI - THUMB with carbide?
    By adrianogalati in forum Symbian C++
    Replies: 2
    Last Post: 2007-10-23, 15:59
  3. Replies: 4
    Last Post: 2006-02-15, 03:33
  4. Yes another helloworld problem...but mines important :)
    By flipflop82 in forum Symbian C++
    Replies: 5
    Last Post: 2004-11-13, 20:42
  5. Failed to run the HelloWorld MIDlet in the emulator
    By ckchui in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2004-09-17, 04:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved