LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices

Reply
 
Search this Thread
Old 12-07-2004, 08:48 PM   #1
alice95089
Member
 
Registered: Dec 2004
Location: hong kong
Posts: 44

Rep: Reputation: 15
while to need while loop at /etc/init.d/rcS in embeded linux to start QT


Hi all,
I am a linux beginner and work in embeded linux field =)
i want to start the application QT when booting up, some people
teach me to add the following line:
/usr/sbin/startQT ( whis is the asolute part to start the QT)
while [ 1 ]
do
sleep 1000d
done
exit (0)


if i don't add the while loo, it can boot to the kernel and rootdisk without starting the QT at boot up, while do i need to add the while loop?

Thanks for answering
 
Old 12-08-2004, 01:08 AM   #2
gd2shoe
Member
 
Registered: Jun 2004
Location: Northern CA
Distribution: Debian
Posts: 835

Rep: Reputation: 49
I haven't worked with embedded systems, I can only venture a guess as to why the While statement is needed.

I think that the startQT program above probably starts a separate process. If the current process ends, for some reason it will take out the one started from startQT (this is just a guess). The above statements can be translated into:

Start the "startQT" thread
whenever {true} is true,
do the following:
do nothing for 1000d, let other process run
go back to whenever.
I'm finished.

Note that the "exit" command is never reached. It is an intentional infinite loop. the script checks to see if 1 is still true, and if it is it will do nothing for "1000d". Then it will check to see if 1 is still true, which it will always be.

by the way, your title should say: "Why do I need a while loop in /etc/init.d/rcS in embedded linux to start QT", or "Why is a while loop needed in..."

While means "as long as". It is the opposite of "until".
 
Old 12-09-2004, 09:25 PM   #3
alice95089
Member
 
Registered: Dec 2004
Location: hong kong
Posts: 44

Original Poster
Rep: Reputation: 15
Hellow gd2shoe,
Thank for you kindly reply=) , i will pay attendtion to my typing and grammer next time also. (since i am from Hong Kong), it just like "stop the computer without wait all the process finish" in that sense? right? maybe i can try the "wait" command to test it can still work also! Thanks a lot for your reply=). i am so appreciate it. Thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
to make a embeded linux system with a wirless network card(ad hoc mode) as a proxy lamppost Linux - Networking 1 11-14-2004 11:10 AM
to make a embeded linux system with a wirless network card(ad hoc mode) as a proxy lamppost Linux - Wireless Networking 0 11-14-2004 05:27 AM
Linux Red Hat 9 start up problem - Init ID X respawning too fast RahmanJan Red Hat 2 08-14-2004 08:06 PM
Embeded linux PCI card backup system Nigel_Tufnel Linux - Hardware 2 05-05-2004 05:36 AM
Embeded Linux on Ti calculators? NSKL Linux - General 4 10-15-2002 09:28 AM


All times are GMT -5. The time now is 11:08 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration