[Top][All Lists]

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

Re: Force CVS to using root to commit files (one way or another)

From: Eric Siegerman
Subject: Re: Force CVS to using root to commit files (one way or another)
Date: Thu, 8 Feb 2001 15:35:24 -0500
User-agent: Mutt/1.2.5i

On Thu, Feb 08, 2001 at 09:57:57AM -0500, Todd Denniston wrote:
> Matthew J Fletcher wrote:
> > - Due to the requirements of our work we need to be operating as root, (this
> > is set in stone, honist),
> [...] the only time you NEED to be root is to "make
> install [...]", assuming you know how to use file
> permissions. 

Technically true.  They may have some broken development process
mandated by some pointy-haired boss, though.  Beyond the scope of
this list...

> > eg,.
> > 
> > #!/bin/bash
> > su matt
> > tkcvs -dir /usr/src/cvssources &
> > exit
> > 
> > but it dont work,.. any ideas ?

No, it wouldn't.  The "su" command starts up a shell that reads
from standard input, which is your terminal, not the script.
When you quit that shell, the script continues (with the "tkcvs"
command) in the old context, ie. as root.

> > 
> Try this:
> #!/bin/bash
> su - matt -c "tkcvs -dir /usr/src/cvssources" 
> exit

Not all variants of "su" take a -c option; depends which flavour
of Unix you're using.  If yours doesn't, try this version, which
supplies the command you want to run as standard input to the
"su" command, and thus to the subshell that it spawns:

        echo "tkcvs -dir /usr/src/cvssources; exit" | su matt

(You almost certainly don't need the "; exit", since the subshell
should exit on its own when it sees end-of-file.  I added it for
completeness, in case bash has been told to ignore end-of-file.)


|  | /\
|-_|/  >   Eric Siegerman, Toronto, Ont.        address@hidden
|  |  /
Interviewer: You've been looking at the stars all your life:
Is there anything in astrology?
Arthur C. Clarke: It's utter nonsense.  But I'm a Sagittarius,
so I'm naturally skeptical.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]