2010-04-07 21:08:36     How to run user aplication program directly. with out login?

Document created by Aaronwu Employee on Aug 21, 2013
Version 1Show Document
  • View in full screen mode

2010-04-07 21:08:36     How to run user aplication program directly. with out login?

liang wang (CHINA)

Message: 88193   

 

I want to let a program running which is designed by Qt after  the system is started,and no login  prompt. how to realize it?

 

Thank you!

TranslateQuoteReplyEditDelete

 

 

2010-04-07 21:30:23     Re: How to run user aplication program directly. with out login?

Mike Frysinger (UNITED STATES)

Message: 88194   

 

use /etc/rc

QuoteReplyEditDelete

 

 

2010-04-07 21:42:51     Re: How to run user aplication program directly. with out login?

liang wang (CHINA)

Message: 88195   

 

Dear Frysinger:

 

I add one script file in the /etc/rc.d

 

however when it run my Qt program, it report that  painter not active ,the program it running smoothly when after I  login using  root .

 

how to let it auto login directly and run my program?

 

Can you give me a clearly way ? Thank you

TranslateQuoteReplyEditDelete

 

 

2010-04-07 21:56:31     Re: How to run user aplication program directly. with out login?

Mike Frysinger (UNITED STATES)

Message: 88196   

 

there is no /etc/rc.d/ support by default.  the default is only to execute the /etc/rc file.

QuoteReplyEditDelete

 

 

2010-04-08 03:12:02     Re: How to run user aplication program directly. with out login?

billy walton (UNITED KINGDOM)

Message: 88215   

 

Liang Wang,

 

I had to do the same, but hit similar problems...

 

It seems its very hard to get the environment setup ready for running dynamically linked apps from init process (SysV init or busybox varients) that depend on various other libraries

 

How i got around it (rightly or wrongly - and im sure more wrongly) was to use the built in msh shell from busybox (which may need an entry in your inittab based on your config and type of init your running) - so when you boot up, you are presented with a msh shell prompt

 

I then edited the msh.c file in the busy box shell source, and implemented a very basic autoexec type function that firstly detected that it was a user interactive shell, and if it was, simply executed the command to run my program before it starts looping for user input.

 

This worked a treat - it launches my program exactly the same way as it would if i typed the program name on the command line, and the side effect is that if my customer has a problem, he can just plug a serial console in and see the program messages straight away without any special setup.

 

Great if you hardware has only one thing to do....

 

Hope it helps

 

Billy

QuoteReplyEditDelete

 

 

2010-04-09 08:28:16     Re: How to run user aplication program directly. with out login?

Terry Markovich (UNITED STATES)

Message: 88260   

 

I've never had problems running QT apps from /etc/rc, it has nothing to do with libraries, but just getting environment variables set.  "env" in a normal shell is your friend here.  For my QT app started by /etc/rc, I need:

 

"export QTDIR=/usr/local/qt-embedded/" (this may be different with the latest release)

QuoteReplyEditDelete

 

 

2010-05-03 23:45:28     Re: How to run user aplication program directly. with out login?

liang wang (CHINA)

Message: 89097   

 

Thank you for you reply,billy

 

I add it with two line in a file. fist you must  cd the dir,then  ./your_application .It will run ok.

 

however If I  just use   ./dir/yourapplication ,it will fail  when I using the qt apllication.

Attachments

    Outcomes