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

Re: Keeping a customized file from being updated during package upgrade



On Fri, Jul 09, 2004 at 10:31:02AM -0400, Ken Long wrote:
> I have a question that I hope someone can help me with.
> 
> As some background, we had a problem where every once in a very long
> while, someone (usually me O:) ) would get a little ahead of themselves
> and issue a shutdown command to shut down the system they were logged in
> on.  Problem was, the person would be in a rush and not notice they were
> actually still ssh'ed into another machine when they typed it!  As you
> can imagine, doing a "shutdown -h now" on your mail server when you're
> sitting at home (over an hour away) is not a pleasant thing to have
> happen.  
> 
> Sooooo, I had this bright idea to replace shutdown with a script that
> would take an additional parameter of the hostname of the system.  The
> script would then check the hostname given on the commandline against
> the hostname of the system it was being run on and only pass on the rest
> of the parameters to the real shutdown command if they matched.
> 
> Soooo, the short of it is that now, /sbin/shutdown is this script and
> the stock shutdown command is /sbin/shutdown.real
> 
> So, here is my question.  How can I make it so that if I upgrade the
> sysvinit package on a system, it will either just not touch the
> /sbin/shutdown file, or better yet, redirect the new /sbin/shutdown file
> to /sbin/shutdown.real instead?  Is that possible?
> 
> Thanks in advance for your help!
> 
> -Ken
Hi Ken,
I would consider that fact that there are too many people with root
access. I'm assuming that the other 'root' users do not really need root
access and that they really need a few commands with root access. The
solution is to use 'sudo' with these users for most root access commands
and to setup a special 'shutdown' script that check certain conditions
before it shuts down the machine.
-Kev

-- 

        (__)
        (oo)
  /------\/
 / |    ||
*  /\---/\
   ~~   ~~
...."Have you mooed today?"...

Attachment: signature.asc
Description: Digital signature


Reply to: