Debian This forum is for the discussion of Debian Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
09-13-2005, 09:01 AM
|
#1
|
Member
Registered: Aug 2005
Distribution: Debian 'lenny'
Posts: 208
Rep:
|
Is there an equivalent of autoexec.bat in debian?
Suppose I want to run a script automatically with each bootup, is there an equivalent of autoexec.bat file(Windows) in Debian?
Thanks.
|
|
|
09-13-2005, 09:19 AM
|
#2
|
Member
Registered: Oct 2003
Location: Montreal Beach
Distribution: Debian Unstable
Posts: 368
Rep:
|
The best way is to put your script in /etc/init.d/ (make sure it has the right permissions and that it is executable) and then use update-rc.d -n nameofscript defaults
This will make you script start at runlevel 2 to 5 and to stop at runlevel 0,1 and 6.
Is that what you were looking for?
|
|
|
09-13-2005, 09:27 AM
|
#3
|
Member
Registered: Aug 2005
Distribution: Debian 'lenny'
Posts: 208
Original Poster
Rep:
|
Thanks for your reply
I have a script called vmware-toolbox (comes with vmware) that I need to make it run automatically with each startup (runlevel 5). Assuming I only need to run it when my windows manager is running (fluxbox in this case), is the following command correct to start in runlevel 5 and to kill it in the rest of the runlevels?
Code:
update-rc.d start 99 5 . stop 10 0 1 2 3 4 6 .
If I do not need to terminate the process in runlevel 0,1,2,3,4,6, can I just run the following command?
Code:
update-rc.d start 99 5 .
Thanks !
Quote:
Originally posted by yanik
The best way is to put your script in /etc/init.d/ (make sure it has the right permissions and that it is executable) and then use update-rc.d -n nameofscript defaults
This will make you script start at runlevel 2 to 5 and to stop at runlevel 0,1 and 6.
Is that what you were looking for?
|
|
|
|
09-13-2005, 09:43 AM
|
#4
|
Member
Registered: Oct 2003
Location: Montreal Beach
Distribution: Debian Unstable
Posts: 368
Rep:
|
The default runlevel in debian is 2 tho. Runlevel 2,3,4 and 5 are the same.
You need the name of the script somewhere in there too, I think.
But does it depends on an Xsession? If so you might better use Xsession to start your script.
|
|
|
09-13-2005, 05:41 PM
|
#5
|
Member
Registered: Aug 2005
Distribution: Debian 'lenny'
Posts: 208
Original Poster
Rep:
|
I think it does need Xsession. How do I call a script from another(Xsession) ?
Thanks for your time
Quote:
Originally posted by yanik
The default runlevel in debian is 2 tho. Runlevel 2,3,4 and 5 are the same.
You need the name of the script somewhere in there too, I think.
But does it depends on an Xsession? If so you might better use Xsession to start your script.
|
|
|
|
09-13-2005, 05:58 PM
|
#6
|
Member
Registered: Oct 2003
Location: Montreal Beach
Distribution: Debian Unstable
Posts: 368
Rep:
|
I'm not sure, you'll have to experiment, but AFAIK, it goes like that:
Create an empty .xsession in your home dir.
Everything in there will be executed when starting X, so put in something like:
vmware-toolbox &
Assuming vmware-toolbox is in your PATH, if not, enter the full path to vmware-toolbox
|
|
|
All times are GMT -5. The time now is 06:54 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|