- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- which is the Startup file???
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2006 07:51 PM
09-11-2006 07:51 PM
I need to make the entries in startup file of RHEL AS4 for two commands,
so please let me know in which file, i need to make the entries?
i have done:
#cd /home/praveen
#vi praveen_start.sh
cd /opt/cpu_mem
./alert.sh
:wq!
#chmod 777 praveen_start.sh
#cd /etc/rc5.d
#ln -s /home/praveen/praveen_start.sh praveen
#chmod 777 praveen
then i tried with reboot, but these file could not be run. it didn't work
Please let me know in which file i need to make the entries.
OS Run level is 5, and this entry should be for all the users (local, NIS & root)
thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2006 08:21 PM
09-11-2006 08:21 PM
Re: which is the Startup file???
So it again depends what is your shell.
I recomend bash.
so make a file .bash_login
make it executeble, it's just bash script, which sais what needs to be done just after you login.
It should work also for other shells
.ksh_login
...
if you want to start your script with OS, you need to add this /etc/rc.d with exec rights ofcourse
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2006 08:29 PM
09-11-2006 08:29 PM
Re: which is the Startup file???
.bash_profile its a hidden fine at ur home directory..it runs automatically when u login.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2006 09:01 PM
09-11-2006 09:01 PM
Re: which is the Startup file???
I want this to start with OS.
please suggest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2006 09:29 PM
09-11-2006 09:29 PM
Re: which is the Startup file???
It looks like it's missing the "magic line":
#!/bin/bash
btw, you can replace 2 commands with 1:
/opt/cpu_mem/alert.sh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2006 12:11 AM
09-12-2006 12:11 AM
Solution#cd /etc/rc5.d
#ln -s /home/praveen/praveen_start.sh praveen
#chmod 777 praveen
The startup location is non-standard, e.g. though it will probably work if the praveen_start.sh script works some future version of SELINUX or security tool may stop it.
The ln -s command will feed the script a start command only if the soft link starts with a captial S, otherwise it will be ignored at run level 5 where its being created.
Suggestion:
#cd /etc/rc5.d
#ln -s /home/praveen/praveen_start.sh S91praveen
#chmod 777 S91praveen
Now at least it will execute at start time.
Better:
#cd /etc/rc5.d
#ln -s /etc/init.d/praveen_start.sh S91praveen
#chmod 777 S91praveen
Relocate the startup script to a standard location.
Last, The script should be able to accept a K (stop) link and able to be shut down the same way its started. e.g. where is the shutdown soft link?
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2006 01:17 AM
09-12-2006 01:17 AM
Re: which is the Startup file???
It will get executed after all other startup actions.
If you want to put something to /etc/rc5.d, you must make the script's name start with either capital "S" (for Start) or with capital K (for Kill). When starting up to runlevel 5, the server runs all scripts in /etc/rc5.d starting with the "S" in POSIX standard alphanumberic sorting order. Each "S" script is run with command line argument "start". So, if your script is named /etc/rc5.d/S99praveen, the system will execute the command:
/etc/rc5.d/S99praveen start
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2006 04:05 AM
09-13-2006 04:05 AM
Re: which is the Startup file???
If you want to put in /etc/init.d/, you'd better to write the script following the examples in the directory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2006 10:53 PM
09-19-2006 10:53 PM
Re: which is the Startup file???
#ln -s /etc/init.d/praveen_start.sh S91praveen
#chmod 777 S91praveen
Thanks