allegra.att.com">
usenix.ORG
allegra.att.com (John P. Linderman)
usenix.ORG
When I lived in a single-manufacturer world, I never had to give this
much thought. Now that I help administer systems from several
manufacturers, I find the following sorts of questions surprising
difficult to answer satisfactorily:
1) Where is the rsh command? The one that runs a command on a
remote machine.
2) What follows
PATH=
in shell scripts run from crontab?
In the Sun (OS <= 4.1.3) world, rsh is in /usr/ucb. But on our SGI IRIS
workstations, there is no /usr/ucb. /usr/bsd/rsh works on the SGIs.
But beware of /bin/rsh, a restricted flavor of the bourne shell.
There was no problem when we only had Suns, because rsh was unambiguous.
Now rsh means quite another thing if you are on an SGI and /bin comes
early in your search path.
Question 2 is similar. In the Sun world, one search path made sense
for a large class of scripts. But if the scripts are also to run in
the SGI world, I need a different search path.
I can think of a couple straw men, and the glimmering of a valid
solution.
Straw Man 1) Come up with a single search path that combines all
the directories in BOTH worlds. Beyond being ugly, which is reason
enough to reject it, it is also crude. If I put /usr/bsd ahead of
/bin to make sure I get the desired mail command, then I must be
willing to have all the commands thereunder take priority. In
general, no single sequence of standard directories will guarantee
that the commands I care about come from the desired place. And
how does this extend to manufacturers I haven't seen yet?
Straw Man 2) Have the manufacturers agree on standard places and
standard names and standard behaviors. Sure. World peace, too.
But I am dwelling in the present, and I need a solution I can
do something about, now.
Glimmer) Create a few system-specific files, let's say under
/etc/standard, that pin down some of the solutions in a way that
admins can control. For example, have /etc/standard/path/
contain files for root, adm, and normal users corresponding
to standard search paths. Root's would not contain . or other
inessential or insecure directories. adm would contain the
root set, plus special admin directories, perhaps /usr/local/adm/bin,
that normal users wouldn't need. The user baseline path would include
/usr/games, ., /usr/local/bin and so on, as local tastes dictated.
This is the sort of thing that is hotwired into the login command now,
but is not (to my knowledge) conveniently accessible to scripts.
/etc/standard/bin would contain symlinks for ambiguous commands
like rsh, echo, mail and so on, and would come at the start of all
of the standard paths, thus answering question 1: if there is some
question about where rsh comes from, wire it down in /etc/standard/bin
on all the machines you administer. And the answer to question 2 is
PATH=`/etc/standard/path/root`
for scripts run by root, and so on. The output will differ on
systems from different sources, but the scripts stand a much better
chance of running everywhere.
Is this a solved problem, whose solution I missed? (I don't spend
a lot of time following standards proposals, so I apologize in
advance if I am addressing a dead issue.) Have other admins
encountered and/or solved it? Flames to me, contributions to me
or the group. I'll summarize what people don't broadcast.
John P. Linderman jpl
allegra.att.com