Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
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).


  Search this Thread
Old 12-07-2004, 09:48 PM   #1
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 ]
sleep 1000d
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, 02:08 AM   #2
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, 10:25 PM   #3
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


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 12:10 PM
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 06:27 AM
Linux Red Hat 9 start up problem - Init ID X respawning too fast RahmanJan Red Hat 2 08-14-2004 09:06 PM
Embeded linux PCI card backup system Nigel_Tufnel Linux - Hardware 2 05-05-2004 06:36 AM
Embeded Linux on Ti calculators? NSKL Linux - General 4 10-15-2002 10:28 AM > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 08:20 PM.

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