LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-24-2005, 03:49 PM   #1
ultramancool
Member
 
Registered: Jul 2004
Location: Hell
Distribution: Gentoo 2005.1 r1
Posts: 92

Rep: Reputation: 15
How do i have a program run at boot?


just wondering how i add startup items to the system. in specific Eff Tor i have to start it every time. I read somethings on boot script but that looks really hard

I've been googling for sometime now and haven't found anything :-(

Last edited by ultramancool; 02-24-2005 at 03:50 PM.
 
Old 02-24-2005, 04:11 PM   #2
CoolAJ86
Member
 
Registered: Jan 2004
Location: VT, USA
Distribution: Gentoo, Ubuntu - t3h 1337 & the easy, respectively
Posts: 125

Rep: Reputation: 15
Are you talking about a program starting up in text mode?
Most programs that are designed for this automatically create a file in /etc/rc.d/init.d/<progname> (or similar) when you install them. You can link that to /etc/rc.<runlevel>/S##<progname> to make it start automatically.
In gentoo `rc-update add <progname> <runlevel>` does the trick. most other distros, AFAIK, have something easy like that.

Otherwise, you'd want to look at /etc/rc.d/boot.local or something similar to that and add the appropriate lines to run the program. Read the manpage for start-stop-daemon - although you don't have to use it to run your program, the sysadmin gods will smile upon you if you do.... I'm pretty sure.



Are you talking about a program starting up in Gnome?
Applications > Desktop Preferences > Advanced > Sessions > Startup Programs

Or are you talking about a program starting up in KDE?
Put a link to the prog you want to run in ~/.kde/Autostart

Last edited by CoolAJ86; 02-24-2005 at 04:19 PM.
 
Old 02-25-2005, 06:22 AM   #3
phil-rio
LQ Newbie
 
Registered: Dec 2004
Posts: 4

Rep: Reputation: 0
I have a similar question.

How to run a program when a user login instead of a shell?
 
Old 02-25-2005, 06:50 AM   #4
Marius2
Member
 
Registered: Jan 2004
Location: Munich
Distribution: SuSE 9.2, 10.2, 10.3, knoppix
Posts: 276

Rep: Reputation: 31
Quote:
Originally posted by phil-rio
I have a similar question.

How to run a program when a user login instead of a shell?
You could put your commands in ~/.bashrc of the particular user, e.g. (assuming your user is "test")
if you add the following lines

#Start the program here (add '&' to send it to the background, else it would die
#with the exit
/path/to/your/binary/binary &
#logout again
exit

to /home/test/.bashrc, you'd have the desired effect.

(assuming as well that bash is your shell; mechanism may be different for other shells)

Last edited by Marius2; 02-25-2005 at 06:52 AM.
 
Old 02-25-2005, 07:07 AM   #5
phil-rio
LQ Newbie
 
Registered: Dec 2004
Posts: 4

Rep: Reputation: 0
Starting the program from .bashrc still leaves a shell available ( ie ctrl c )

So perhaps I could run the program from etc/passwd by replacing the shell string with a program?

just a thought as I want to run an interactive program ONLY then logoff as soon as the program is done with no chance to get to a shell.
 
  


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
How can a command/program be run automatically on boot? chuanweizuo Linux - Hardware 1 11-28-2005 10:36 AM
add a program to run in vty/console at boot? carl0ski Mandriva 3 11-23-2004 06:07 AM
How can I get the computer to boot up and run a program/game w/ bash script or C++? DaMan101 Linux From Scratch 1 04-10-2004 12:23 AM
i want to run a script or program at boot time!! FreakboY Linux - Newbie 9 10-12-2003 08:03 AM
How do I automatically run at boot an X program or script cmisip Linux - General 4 01-05-2003 06:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:43 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