init managed or rc script managed services
Marc Evans
Marc at SoftwareHackery.Com
Thu Jan 23 13:02:43 EST 2003
Hello -
I am pondering the decision logic that is used to decide what processes
are started through the use of inittab versus rc scripts. It seems to me
that several of the distros have chosen to use primarily rc scripts. From
a robustness of service perspective however, it is my opinion that many of
the services that are started by rc scripts really should be managed by
the init process through the /etc/inittab file. I am looking for opinions
on the subject.
In my opinion, a key to deciding which method should be used is the answer
to the question "Should this service always be operating during normal
operation?" Another way to look at making this decision would be "Does
this script simply configure or manage hardware or state information and
then terminate?"
Using those questions as a guide, it is my opinion that syslog, xntp,
httpd, crond, named and anacron are examples of services that should be
managed by init through inittab. By contrast, iptables, ipchains, keytable
and network are examples of rc scripts that should remain rc scripts.
As I have presented this to some people, I have heard the comment that the
convience of being able to run "service {foo} stop" would be lost by
moving items from rc scripts to inittab. To counter that, I present a
trivial perl script that can be installed in the /etc/rc.d/init.d
directory which manages the entries in /etc/inittab, producing the same
behavior as sysadmins have experienced prior to such changes.
You might ask, why do I care about this? Well, I have found that on rare
occasions, some of these services terminate, such as due to being out of
memory. Specifically, cron and anacron have been observed to experience
this, and unless the sysadmin is careful after the problem is corrected,
they may never get restarted. By moving these to inittab, I assert that
the system is more robust in its services.
So, let the debate begin as to if my thoughts on this subject make any
sense!
Thanks in advance - Marc
More information about the gnhlug-discuss
mailing list