×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Registered User
    Join Date
    Apr 2013
    Posts
    7

    Run application at startup (meego N9)

    Hello Guys.
    I need a big help. I do not know how to run my application at startup of phone (Nokia N9), the application was created with QT Creator (Qt Quick harmattan).
    I also looked at this page: applauncherd but honestly I did't understand much..
    I do not know how to do, please let help me Thanks

  2. #2
    Regular Contributor
    Join Date
    Apr 2012
    Location
    malaysia
    Posts
    262

    Re: Run application at startup (meego N9)

    From a quick look,it seems the documentation is about how to optimise or speed up application starting/opening process.

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,688

    Re: Run application at startup (meego N9)

    In the linked page I do not see if applauncherd can help with autostarting.
    However the general environment is Linux/Unix, so searching for N9 init.d results in some findings. This is the description you may start following: http://harmattan-dev.nokia.com/docs/...g_daemons.html - and also check the two upstart links for the details.

  4. #4
    Registered User
    Join Date
    Apr 2013
    Posts
    7

    Re: Run application at startup (meego N9)

    Quote Originally Posted by wizard_hu_ View Post
    In the linked page I do not see if applauncherd can help with autostarting.
    However the general environment is Linux/Unix, so searching for N9 init.d results in some findings. This is the description you may start following: http://harmattan-dev.nokia.com/docs/...g_daemons.html - and also check the two upstart links for the details.
    First of all thanks to both of you for having responded to me
    I'm not highly experienced on the subject "start up".
    I have read the page, and I realized that I can start daemons with no graphics applications, but I have an application in qml, I should run at startup.
    However, I tried to put all the necessary code strings and gives me error .. Do you know if there is a way to be able to use daemons with applications with graphics?

    Thanks for your help

    Edit: the error happens because if I do not have root permissions, I can not copy the file. "conf" in etc/init/apps..
    So how do I get them?
    Last edited by stefano947; 2013-07-19 at 17:13.

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,688

    Re: Run application at startup (meego N9)

    Well, I actually do not know much about the N9, just used Google. Like root N9 brings me http://talk.maemo.org/showthread.php?t=79147 as the first hit

  6. #6
    Registered User
    Join Date
    Apr 2013
    Posts
    7

    Re: Run application at startup (meego N9)

    I know how to have privileges root on N9, by terminal.. but when i build application with Qt Creator, it make an error, I think because i don't have root for copy .conf file to etc/init/apps.
    This do with this code:
    Code:
    daemonconf.path = /etc/init/apps/
    daemonconf.files = unlockpassd.conf
    INSTALLS += daemonconf
    And I tried to copy .conf file to /home/user :
    Code:
    daemonconf.path = /home/user/
    daemonconf.files = unlockpassd.conf
    INSTALLS += daemonconf
    And it work fine, because for copy a file to /home/user/ not needed root privileges.

    I hope you will understand, because I'm not very good at English

  7. #7
    Registered User
    Join Date
    Jun 2012
    Posts
    105

    Re: Run application at startup (meego N9)

    Forget applauncherd; it is good for prestarted apps only, which are configured by Nokia (sigh).

    You need a screen for running an app as a daemon with a screen, for instance have a look at this example file :
    <code>
    #
    # Example 3rd party application/daemon startup script.
    #
    # Install the startup script to /etc/init/apps

    #
    # Applications are started after official stuff is done.
    #
    # The name of the script has to be unique, suffix .conf is mandatory.
    #
    # Applications are started in alphabetical order; note that
    # 3rd party applications are not run in malfunction state nor in
    # charging/act-dead mode.
    #
    # Stanzas that are limited:
    # oom (negative values)
    # nice (negative values)
    # reboot (not allowed)
    # start on (not allowed)
    # stop on (only "core_shutdown" and "stopping xsession" allowed)
    #
    # During installation, application can be started by issuing command
    # "start apps/myapp" in post-install script. Note that suffix .conf must
    # be omitted.
    #

    # Description of the script, mandatory
    description "TEst app launcher"

    # Author e-mail address, mandatory
    author "users.giulietta@gmail.com"

    #
    # Start on stanza is ignored for 3rd party apps
    #


    #
    # One and only one "stop on" is allowed (mandatory)
    # If missing or invalid, it'll be forced to "stopping xsession"
    #

    # stop when xsession is stopped
    stop on stopping xsession

    # stop when device is shut down (keep running in charging/act-dead mode)
    # stop on core_shutdown


    # stdout to /dev/null, use "console output" to direct stdout to console (optional)
    console output

    # if application exits, restart it (optional)
    #respawn

    # restart max 3 times withing 300 secs (optional, you need respawn defined)
    #respawn limit 1 300

    # not a critical task (optional, negative nice not allowed)
    nice 19


    # do not restart if exitcode is 0 (optional)
    #normal exit 0

    # start the app (/usr/bin/myapp)
    # (change the pathname of the exec, of course);
    # If you need to do preparations, you can use normal Upstart stanzas
    # such as pre-start, post-start, script, pre-stop and post-stop sections

    env DISPLAY:0.0
    # Start myapp as user
    exec /usr/bin/aegis-exec -s -u user qdbus com.giulietta.lancia

    # Start myapp as root
    #exec /opt/debota/debota_daemon

    </code>

    the env DISPLAY ... part is the relevant one.
    Last edited by tkastlunger; 2013-07-20 at 05:57.

  8. #8
    Registered User
    Join Date
    Apr 2013
    Posts
    7

    Re: Run application at startup (meego N9)

    So if I use this code, I can start the application (the one with graphics in qml)?
    Thanks And why the code:
    Code:
    daemonconf.path = /etc/init/apps/
    daemonconf.files = unlockpass.conf
    INSTALLS += daemonconf
    don't work?

    EDIT:

    this is the Compile Output
    Code:
    dh_clean -k 
    dh_installdirs
    # Add here commands to install the package into debian/unlockpass.
    /usr/bin/make INSTALL_ROOT="/Users/steebono/UnlockPass/unlockpass-harmattan"/debian/unlockpass install
    cp -f -r /Users/steebono/UnlockPass/unlockpass/qml/unlockpass /Users/steebono/UnlockPass/unlockpass-harmattan/debian/unlockpass/opt/unlockpass/qml/
    install -m 644 -p /Users/steebono/UnlockPass/unlockpass/unlockpass80.png /Users/steebono/UnlockPass/unlockpass-harmattan/debian/unlockpass/usr/share/icons/hicolor/80x80/apps/
    install -m 644 -p /Users/steebono/UnlockPass/unlockpass/unlockpass_harmattan.desktop /Users/steebono/UnlockPass/unlockpass-harmattan/debian/unlockpass/usr/share/applications/
    install -m 755 -p "unlockpass" "/Users/steebono/UnlockPass/unlockpass-harmattan/debian/unlockpass/opt/unlockpass/bin/unlockpass"
    install -m 755 -p /Users/steebono/UnlockPass/unlockpass/unlockpass.conf /Users/steebono/UnlockPass/unlockpass-harmattan/debian/unlockpass/etc/init/apps/
    dh_testdir
    dh_testroot
    dh_installchangelogs 
    dh_installdocs
    dh_installexamples
    dh_installman
    dh_link
    dh_strip
    dh_compress
    dh_fixperms
    dh_installdeb
    find: -printf: unknown option
    dh_installdeb: command returned error code
    make: *** [binary-arch] Error 1
    dpkg-buildpackage: failure: debian/rules binary gave error exit status 2
    Packaging Error: Command '/Users/steebono/QtSDK/Madde/bin/mad dpkg-buildpackage -nc -uc -us' failed.Exit code: 2
    Error while building project unlockpass (target: Harmattan)
    When executing build step 'Create Debian Package'
    
    UPDATE:

    Continuing to try I got to this point:

    So I created a file startup.sh

    Code:
    #!/bin/sh
    exec /opt/unlockpass/bin/unlockpass
    In the project *. pro I inserted the installation of startup.sh as follows:
    Code:
    startup.files = startup.sh
    startup.path = /opt/unlockpass/bin
    
    INSTALLS += startup
    and with this code does not give me any error

    then I copied the file "unlockpass.conf" manually in /etc/init/apps by terminal of N9

    unlockpass.conf:
    Code:
    description "Unlock Mee daemons"
    
    # Author e-mail address, mandatory
    author "stee.bono@gmail.com"
    
    stop on stopping xsession
    
    console output
    
    exec /usr/bin/aegis-exec -s -u user -l "exec /opt/unlockpass/bin/startup.sh"
    
    # Start myapp as root
    #exec /opt/unlockpass/bin/unlockpass
    And when I restart the phone, the application starts automatically without any problems
    Now the problem is, install the file unlockpass.conf in /etc/init/apps when I install .deb package
    Last edited by stefano947; 2013-07-20 at 02:39.

  9. #9
    Registered User
    Join Date
    Jun 2012
    Posts
    105

    Re: Run application at startup (meego N9)

    Note that there is an error in the find syntax:

    find: -printf: unknown option

  10. #10
    Registered User
    Join Date
    Apr 2013
    Posts
    7

    Re: Run application at startup (meego N9)

    And how do I resolve this error?
    what is it find syntax?

  11. #11
    Registered User
    Join Date
    Jun 2012
    Posts
    105

    Re: Run application at startup (meego N9)


  12. #12
    Registered User
    Join Date
    Apr 2013
    Posts
    7

    Re: Run application at startup (meego N9)

    I googled my error in Qt, but I did not find the results that could me help...

  13. #13
    Registered User
    Join Date
    Jun 2012
    Posts
    105

    Re: Run application at startup (meego N9)

    It is not Qt, find is a linux utility.

Similar Threads

  1. List All Application of Meego
    By proj_symbian in forum Nokia N9
    Replies: 52
    Last Post: 2012-04-19, 05:03
  2. How to use in-app analytics in Meego application
    By PhoneSoulPL in forum Monetization APIs
    Replies: 4
    Last Post: 2012-02-03, 15:29
  3. Replies: 2
    Last Post: 2010-10-22, 23:35
  4. Replies: 2
    Last Post: 2006-11-13, 09:04
  5. Phone Startup & Application Startup
    By mvadu in forum General Development Questions
    Replies: 0
    Last Post: 2006-06-21, 13:35

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×