[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

/etc/init.d scripts



[After discussion on other lists, I've reached the conclusion that this is
a policy issue regarding section 4.4 of Debian policy -- SCRIPTS]

Hi,

I'm working on some scripts that will allow various daemons to be
start/stopped/reloaded from other machines, automatically.

One solution I've come up with is to use something of the sort:

ssh remotehost /etc/init.d/daemon reload

Assume I'm running as root and have made the changes to let it happen w/o
a password. I'm going to get an error here that it can't find
"start-stop-daemon". Alternatively, if I change the "daemon" script to
point to /sbin/start-stop-daemon then it works fine. I tried this with
/etc/init.d/bind

There were various solutions proposed, but none of them was
all-encompassing (ssh, rsh and otherwise) and others felt that it was a
good idea in general to have what I'm proposing below for various reasons.

Someone mentioned to me that most of the scripts have a line at the top
like:

PATH=/sbin:/usr/sbin

Although for most of the scripts in /etc/init.d this is NOT true.

Section 4.4 of the policy does not discuss a PATH statement in scripts.

IMHO, this is a mistake. I'm proposing the following addition of policy
to 4.4: (exact wording isn't important)

----

All scripts must have one of the following two contained in them:

1) A PATH environment setting that lists all the directories where any
programs invoked by the script may be found.

2) All the programs be hard-linked (must contain a full directory setting)

----

I think #1 should be the preferred policy, but if for whatever reason the
script maintainer wants to use a "hard-link" (full directory location)
then it should be allowed as an alternative.

It should not be assumed that any programs run are in the PATH, as that
may be changed w/o connection to the script and then it would break the
script.

-- 
Brock Rozen                                              brozen@torah.org
Director of Technical Services                              (410)358-9800
Project Genesis                                     http://www.torah.org/ 








Reply to: