LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-23-2005, 05:29 AM   #1
tareqth
Member
 
Registered: Jul 2005
Posts: 31

Rep: Reputation: 15
Where to put some sh ...


I'd like to put some shell scripts to run everytime the user logs in, and some other scripts to run everytime the system starts. Can you help me where to put them ?

Thanx

Last edited by tareqth; 07-23-2005 at 05:37 AM.
 
Old 07-23-2005, 05:53 AM   #2
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Which distro are you running and what do the scripts do?
 
Old 07-23-2005, 06:07 AM   #3
RomanG
Member
 
Registered: Jan 2005
Location: Russia, Kazan
Distribution: Mandrake 10.2, RedHat sometimes..
Posts: 110

Rep: Reputation: 15
Usually you can put it in users ~/.bash_profile file
Code:
[root@squirrel etc]# cat /home/roman/.bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi

# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME

echo
/usr/games/fortune
echo
[root@squirrel etc]#
To run some scripts when your system starts you usually can
add them to /etc/rc.d/rc.local script file. But as XavierP said it depends on your distro.
 
Old 07-23-2005, 10:05 AM   #4
tareqth
Member
 
Registered: Jul 2005
Posts: 31

Original Poster
Rep: Reputation: 15
I use RHEL 4
 
Old 07-23-2005, 12:10 PM   #5
RomanG
Member
 
Registered: Jan 2005
Location: Russia, Kazan
Distribution: Mandrake 10.2, RedHat sometimes..
Posts: 110

Rep: Reputation: 15
Yes, it's OK for you if you follow them.
Notice that users can modify their ~/.bash_profile and ~/.bashrc scripts, so if you want to start some scripts/programms when user logs in the system and don't want to allow that user to bypass it, you should run your scripts/programms from /etc/zlogin or /etc/zprofile scripts.
 
  


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
WOuld i just put the installation cd in. Nawas111 Linux - Hardware 3 11-18-2004 01:40 AM
Where do you put your files? dbc001 Linux - General 7 02-23-2004 10:04 AM
Where to put swap SBarretDolph Linux - Newbie 11 01-27-2004 12:07 AM
No way to put the OS in... TheIrish Linux - Laptop and Netbook 2 01-09-2004 01:05 PM
Where do I put the software? tentonipete Linux - Software 7 07-09-2003 09:39 PM

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

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