Managing Initscripts with Red Hat's chkconfig
Hopefully, you've seen the benefits of Red Hat's chkconfig utility for managing initscripts. While its functionality seems simple, the timesaving benefits makes chkconfig an administrator's command worth committing to memory.

- « first
- ‹ previous
- 1
- 2
- 3
- 4
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
- Using Salt Stack and Vagrant for Drupal Development
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- New Products
- Validate an E-Mail Address with PHP, the Right Way
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Home, My Backup Data Center
- New Products
- RSS Feeds
- New Products
- This is the easiest tutorial
5 hours 48 min ago - Ahh, the Koolaid.
11 hours 26 min ago - git-annex assistant
17 hours 26 min ago - direct cable connection
17 hours 48 min ago - Agreed on AirDroid. With my
17 hours 59 min ago - I just learned this
18 hours 3 min ago - enterprise
18 hours 33 min ago - not living upto the mobile revolution
21 hours 24 min ago - Deceptive Advertising and
22 hours 10 sec ago - Let\'s declare that you have
22 hours 1 min ago




Comments
Oracle shutdown not working
Hi,
thanks for this article.
One addition: Oracle doesn't shutdown automatically in RHEL5 if /var/lock/subsys/ isn't considered.
Please refer to .
Cheers,
Thomas
Oops... the most important
Oops... the most important information was truncated:
Refer to http://linux.derkeiler.com/Mailing-Lists/RedHat/2008-12/msg00037.html:
Your script needs to touch a /var/lock/subsys/oracle file upon successful startup, and remove it on a successful stop. In a shutdown, services are stopped that have a lock file in /var/lock/subsys.
Here's what I've added to my script:
start)
echo -n $"Starting Oracle: "
/bin/su - oracle -c "dbstart \$ORACLE_HOME" &
/bin/su - oracle -c "opmnctl startall" &
/bin/su - oracle -c "emctl start dbconsole" &
/bin/su - oracle -c "export ORACLE_HOME=$ORACLE_HOME/oc4j; $ORACLE_HOME/bin/oc4j -start &"
touch /var/lock/subsys/oracle
exit 4
;;
stop)
echo -n $"Stopping Oracle: "
/bin/su - oracle -c "touch \$ORACLE_HOME\init_stop"
/bin/su - oracle -c "opmnctl shutdown" &
/bin/su - oracle -c "emctl stop dbconsole"
/bin/su - oracle -c "lsnrctl stop"
/bin/su - oracle -c "dbshut \$ORACLE_HOME"
rm /var/lock/subsys/oracle
exit 0
;;
Hope it's readable now, otherwise contact me at thomas.gutzmann@gutzmann.com.
superb
Super Article....
Helped a lot Jimmy.
Cheers!!!
-Sandeep
Precise
Perfect writeup. Very useful
Thank you
Thank you! Oldie but goodie. Have been wanting to decipher this for years.
Thanks
I found many references to "add these comments at the begining of the script", but no one seemed to have any idea what they meant. Your article gave me everything I needed to know.
Thanks.
very interesting and useful
just want to thank for the article. I was googling for this topics, and when i found it I saved immediately a copy in my how-to-do
thanks
marco
excellent article
i just wanted to thank you for this great article !!
these line are magical:
#chkconfig: 2345 80 05
#description:
Managing Initscripts with Red Hat's chkconfig
This article was EXTREMELY useful! Thanks for writing it!
good job!!
neatly explained! but im a bit confused with the start and stop priority.. what are available values for those and how to choose the right one for my own script?
start priority
The priority is a number from 0 upwards.
It simply determines the order in which services start. Low numbers = start before high numbers.
e.g. you want your network to be up before start apache server.
S10network -> ../init.d/network
S85httpd -> ../init.d/httpd
The list above - network starts first.
At shutdown the reverse happens. stop httpd first before stopping network.
K90network -> ../init.d/network
K15httpd -> ../init.d/httpd
Service starts as daemon user
Excellent article. Once the service is started, it looks to be running as the daemon user. How would you start a service as a different user other than daemon? Thanks.
Most common way is by command line switch
Many daemons are started with a specific user & group by command line switches, for example you might see this one if you are running mySQL:
/usr/bin/mysqld_safe --user=mysql
Some have configuration files that specify the user/group, like for example sendmail.mc often has this in it:
define(`confDEF_USER_ID',``8:12'')
(Note the user "mail" has uidNumber eight, the group "mail" has gidNumber twelve on a typical Red Hat system)
Stuff that is run out of xinetd can use xinetd's inherent capability to manage users with appropriate configuration lines in /etc/xinetd.d - type "man xinetd.conf" on a typical Red Hat system and look at the user and group options.
Primitive daemons that don't have the ability to change their user or drop capabilities can still be run as a specific user with appropriate scripting in the init script; Red Hat supplies a tool for this in RHEL5 (/sbin/runuser) but in earlier versions you'll need to understand how to use and script the "su" command.
But it all boils down to this: the init script (for standalone daemons) or a file in the xinetd.d folder (for daemons invoked on the fly by the xinetd superdaemon) can control the user and group of a system daemon. If a daemon has a user/group option in its configuration file, you can use that, but the init script could override it.
HTH,
--Charlie