- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: how add scritps in startup
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-06-2011 02:14 AM
09-06-2011 02:14 AM
how add scritps in startup
Hi all,
how can i add the my scripts in startup. explain the steps.
Regards
Abu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2011 03:53 AM
09-06-2011 03:53 AM
Re: how add scritps in startup
The exact requirements vary in different Linux distributions/versions.
In general, your scripts should follow the standards of the Linux Standards Base:
http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/tocsysinit.html
(see chapters 20.2 - 20.8 of the above)
The current version of LSB also has a standard installation and removal process for startup scripts.
For example, in RHEL, you should find instructions and an example script in /usr/share/doc/initscripts-<version>/sysvinitfiles.
(Looks like this has been true in older pre-Enterprise RedHat versions too, perhaps back to RHL 7.0, although the <version> part in the pathname will obviously be different in each version.)
If your system has the "chkconfig" command, you should read "man chkconfig": if your script complies with the requirements listed there, you can add your startup script by just copying it to /etc/init.d, and then running "chkconfig --add <name_of_script>".
Many newer Linux distributions (including RHEL 6) use a new "dependency-based" boot scheme, in which each script must declare the system services it depends on. This enables the system to boot up faster. As a result, the comment scheme described in this part of LSB is now a requirement, instead of just a recommendation:
http://refspecs.freestandards.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/initscrcomconv.html
Also, your script should create an empty file in /var/lock/subsys/ if it starts up something that must be stopped at system shutdown. The name of the file should match the name of your script. (If this file does not exist, the stop function of your script won't be run, because the system assumes the service has already been stopped.)