LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-09-2003, 01:58 AM   #1
FreakboY
Member
 
Registered: Jun 2002
Location: TX, USA
Distribution: Slackware
Posts: 385

Rep: Reputation: 32
i want to run a script or program at boot time!!


How can I run an specific program or script
when a user logs in to my machine!??

Thanks in advance!
 
Old 10-09-2003, 02:49 AM   #2
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Place the program, with full path into the user's ~/.bash_profile file that is located in their home directory. This assumes the user is using Bash of course. You can also look at system wide config file /etc/profile but be weary of editing that if you don't know what's going on. As always, make a backup before "tinkering".

Cool
 
Old 10-09-2003, 10:19 AM   #3
Ricky
Member
 
Registered: Sep 2003
Posts: 34

Rep: Reputation: 15
wht should i add in profile to start dhcpd and iptable routing scritp at startup??
 
Old 10-09-2003, 01:46 PM   #4
troycus
Member
 
Registered: Sep 2003
Posts: 84

Rep: Reputation: 15
I'm having the same problem sort of. I created a script to start when booting. I place the file in my "bin" directory. the script runs when I execute it: ./filename, but not when it boots.
 
Old 10-09-2003, 01:54 PM   #5
wuck
Member
 
Registered: Sep 2003
Location: barneveld.nl
Distribution: Slackware
Posts: 170

Rep: Reputation: 30
troycus: I think your path hasn't been set yet? Try /usr/bin/yourfilename ?

Ricky: dhcpd and iptables aren't user-specific processes, but system-wide processes.
If I want something started at boot time that isn't listed in my DrakXServices handy tool app, I put it in /etc/rc.local
Note that this is not a very thorough approach: you might want to assign these processes with a specific runlevel, and then you want to (FIXME) put it somewhere in /etc/rcx.d, where x is the runlevel you want it assigned to.
 
Old 10-10-2003, 06:41 AM   #6
Ricky
Member
 
Registered: Sep 2003
Posts: 34

Rep: Reputation: 15
Well I am not very used to linux but can you tell me wht the runlevel for??

I have seen run levels but don't know wht are they about?

Also I have installed dhcpd from source ie. not from rpm.. so i think i have to something manualy to make dhcpd appear in services.

i start dhpcd by just typing dhcpd at console..
 
Old 10-10-2003, 03:33 PM   #7
wuck
Member
 
Registered: Sep 2003
Location: barneveld.nl
Distribution: Slackware
Posts: 170

Rep: Reputation: 30
Quote:
Originally posted by Ricky
Well I am not very used to linux but can you tell me wht the runlevel for??
I googled for you:

http://stalin.iodynamics.com/education/runlevel.html

Quote:
Also I have installed dhcpd from source ie. not from rpm.. so i think i have to something manualy to make dhcpd appear in services.

i start dhpcd by just typing dhcpd at console..
If you just want to get the freakin' app started at boot time, here is your approach. But note, as I said: it's not the most thorough, I still need to learn runlevels

Find the path of dhcpd. (find / | grep -i "dhcpd") I'll use /sbin/dhcpd as an example.

Now add this to the end of your /etc/rc.local:

Code:
# wuck: launch dhcpd at boot time

/sbin/dhcpd &
by saying:

# echo 'see_above_code' >> /etc/rc.local

(or just use your favorite text editor and cut 'n paste ..)

I always add a comment to lines I add, because my rc.local file is already stuffed with code from other people. That way I know what I added. Be sure to backup the file. You _can_ leave 'wuck', but you might as well change it

For future reference: as you might have seen, /etc/rc.local is executed every time you boot, no matter what runlevel your system boots.

NOTE: I don't think dhcpd will appear in the services list.
 
Old 10-12-2003, 01:15 AM   #8
Ricky
Member
 
Registered: Sep 2003
Posts: 34

Rep: Reputation: 15
WEll thanks for your googling but I have already seen that link...
 
Old 10-12-2003, 01:35 AM   #9
Toker
Member
 
Registered: Sep 2003
Distribution: Mandrake9.1
Posts: 92

Rep: Reputation: 15
In order for me to run xmodmap at startup, I needed to add the line to my /etc/X11/Xsession file, although it should run from the $HOME/.kde(gnome, etc...)/.xsession (or .initrc, or autostart)

Just a guess though, I may not be understanding the question... g/l!
 
Old 10-12-2003, 09:03 AM   #10
Ricky
Member
 
Registered: Sep 2003
Posts: 34

Rep: Reputation: 15
Well may be u r not getting the questionn..
 
  


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 I get the computer to boot up and run a program/game w/ bash script or C++? DaMan101 Programming 5 04-11-2004 04:22 PM
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 01:23 AM
RH8 - how to automatically run a shell script at boot time nu-B Linux - Newbie 2 11-03-2003 03:47 PM
RH8 - how to automatically run iptables rules shell script at boot time nu-B Linux - General 1 10-29-2003 09:38 PM
How do I automatically run at boot an X program or script cmisip Linux - General 4 01-05-2003 07:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:16 PM.

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