LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 09-13-2005, 09:01 AM   #1
Akhran
Member
 
Registered: Aug 2005
Distribution: Debian 'lenny'
Posts: 208

Rep: Reputation: 30
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.
 
Old 09-13-2005, 09:19 AM   #2
yanik
Member
 
Registered: Oct 2003
Location: Montreal Beach
Distribution: Debian Unstable
Posts: 368

Rep: Reputation: 30
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?
 
Old 09-13-2005, 09:27 AM   #3
Akhran
Member
 
Registered: Aug 2005
Distribution: Debian 'lenny'
Posts: 208

Original Poster
Rep: Reputation: 30
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?
 
Old 09-13-2005, 09:43 AM   #4
yanik
Member
 
Registered: Oct 2003
Location: Montreal Beach
Distribution: Debian Unstable
Posts: 368

Rep: Reputation: 30
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.
 
Old 09-13-2005, 05:41 PM   #5
Akhran
Member
 
Registered: Aug 2005
Distribution: Debian 'lenny'
Posts: 208

Original Poster
Rep: Reputation: 30
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.
 
Old 09-13-2005, 05:58 PM   #6
yanik
Member
 
Registered: Oct 2003
Location: Montreal Beach
Distribution: Debian Unstable
Posts: 368

Rep: Reputation: 30
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
 
  


Reply



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
What is the autoexec.bat and config.sys equivalent of linux lemuel Linux - Newbie 4 12-07-2004 09:34 PM
Linux Startup - AutoExec.bat equivalent? perry Linux - Software 6 05-03-2004 11:13 PM
Autoexec.bat in Linux? sikandar Linux - Software 10 08-31-2003 12:30 PM
Autoexec.bat Equivalent dwpondscum Linux - Distributions 5 06-16-2003 09:51 AM
The Linux version of autoexec.bat ??? Canaris Linux - Newbie 9 05-27-2003 07:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 01:45 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration