Re: itp: static bins / resolving static debian issues
Hi Craig,
Actually, cron always uses /bin/sh unless you override it, no matter
what roots shell actually is. From the crontab(5) manpage:
Several environment variables are set up automatically by
the cron(8) daemon. SHELL is set to /bin/sh, and LOGNAME
and HOME are set from the /etc/passwd line of the
crontab's owner. PATH is set to "/usr/bin:/bin". HOME,
SHELL, and PATH may be overridden by settings in the
crontab; LOGNAME may not.
So, unless you specifically set another SHELL in your crontab
entries, cron will use /bin/sh.
It is unusually difficult to concoct a method whereby roots shell
would matter to the execution of some script, except, of course, to
things like .profile or .cshrc which your shell invokes automatically
upon startup. Even there, you know what conventions to follow based
on the name of the script (eg: stick to bourne-isms for .profile,
but go wild with bash-isms in .bash_profile).
You can safely set roots shell to anything you like, without fear
of having any impact whatsoever on scripts running on your system.
Justin
On Fri, Aug 20, 1999 at 10:06:31AM +1000, Craig Sanders wrote:
> On Thu, Aug 19, 1999 at 01:44:41PM +0200, Marek Habersack wrote:
> > * Raul Miller said:
> >
> > > > switched to a posix sh, switching root's shell to sash would
> > > > likely be a disaster (i'm disturbed even by the fact that the
> > > > postinst for sash asks if it should change root's shell to sash!)
> > >
> > > For the record, I'm disturbed by this as well, but I'm still (after
> > > a year) not sure what I'm going to do about it.
> > >
> > > This discussion has prompted me to think about this problem
> > > differently, however.
> >
> > I use sash on my machine at home as a root shell and ash on the
> > machines at work. Both pose no problems with the shell scripts. They
> > are just root shells, not system default shells.
>
> i said root cron jobs, not the init.d scripts.
>
> e.g. someone who's been running debian for years and has various
> bashisms and posixisms in /var/spool/cron/crontabs/root - root's shell
> has always been bash on debian so that is a fairly common situation.
> changing root's shell to sash will immediately break those cron jobs.
>
> easily fixed by setting "SHELL=/bin/bash" or "SHELL=/bin/sh" in the
> crontab...but to do that, you first need to know there's a problem and
> you probably won't know that until after a few cron jobs have failed.
>
> there's no need to set root's shell to sash, and it presents some fairly
> obvious dangers. if someone wants to do it on their own system, that's
> fine - but debian systems should NOT automatically break just because a
> package has been installed.
>
> craig
>
> --
> craig sanders
Reply to: