LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-28-2006, 11:37 PM   #1
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 239

Rep: Reputation: 30
run script at logon


How do i run my script at after every logon on REDHAT ES 4.
 
Old 12-29-2006, 05:26 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Add it to your users .bash_login in their home directory.
 
Old 12-29-2006, 10:25 AM   #3
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Code:
ls /etc/rc.local
less /etc/rc.local
Sorry, I don't know where the man page is.
 
Old 12-29-2006, 10:34 AM   #4
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Also consider /etc/bashrc & /etc/profile, they are system-wide, i.e. apply to all users. I think /etc/bashrc is preferable, check man bash for the (slightly subtle) differences between them.


If instead you really want something that runs at every boot after the init scripts, check out /etc/rc.local:
Code:
ls /etc/rc.local
less /etc/rc.local
Sorry, I don't know where that man page is.
 
Old 12-29-2006, 11:01 PM   #5
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
If you use the system wide configuration you can write some code to fire off a script, program or command based on either user id or group id.

Example:

Code:
if [ "$UID" = "1001" ]; then
    some command........
fi

if [ "$GID" = "100" ]; then
   . /execute/some/script
fi
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Run Shell Script on logon thesystem Debian 2 10-20-2005 11:11 AM
Samba as PDC: can it just run logon script, not host profiles? hamish Linux - Networking 0 09-09-2005 09:44 AM
Linux gateway - It doesn't allow run logon script of all clients to win2k3 b:z Linux - Networking 1 04-21-2005 11:17 PM
Run script when interent logon AbsoluteMonkey Linux - Networking 6 03-22-2004 03:07 PM
on Network Up Script run? On Battery power run script? v2-ncl Linux - General 0 12-08-2003 09:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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