<p dir="ltr">Hi Andreas,</p>
<p dir="ltr">Le 23 févr. 2014 22:30, "Andreas Tille" <<a href="mailto:andreas@an3as.eu">andreas@an3as.eu</a>> a écrit :<br>
><br>
> Hi Emilien,<br>
><br>
> On Sun, Feb 23, 2014 at 09:49:46PM +0100, Emilien Klein wrote:<br>
> > 2014-02-23 19:53 GMT+01:00 Karsten Hilbert <<a href="mailto:Karsten.Hilbert@gmx.net">Karsten.Hilbert@gmx.net</a>>:<br>
> > ><br>
> > > On Sun, Feb 23, 2014 at 08:38:56AM +0100, Andreas Tille wrote:<br>
> > ><br>
> > > > > Extract from the manpages:<br>
> > > > > sudo:<br>
> > > > > sudo, sudoedit - execute a command as another user<br>
> > > ><br>
> > > > I'd call this a bit confusing since sudo is the command to do something<br>
> > > > as superuser.<br>
> > ><br>
> > > Not really. It just so happens that the *default*<br>
> > > target usually is root.<br>
> > ><br>
> > > Look at "-u username".<br>
> ><br>
> ><br>
> > Correct, sudo is to perform a command as another user (by default<br>
> > root, but it can be any user you which), while su is to 'become" that<br>
> > other user (and then likely perform commands as that other user).<br>
> ><br>
> > Only those few commands (in different scripts) need to be performed as<br>
> > the database-owning user, all the rest of the process needs to be done<br>
> > by root. Using sudo is the correct way to do that.<br>
> > I will make sure to Depend on sudo.<br>
><br>
> As I tried to express this is *not* the correct conclusion in my<br>
> opinion.</p>
<p dir="ltr">Yes, I understand what you are saying.</p>
<p dir="ltr">> You should use su in your scripts.</p>
<p dir="ltr">OK, but why?<br>
What I'm missing so far is an explanation on why we shouldn't use sudo for this use-case.</p>
<p dir="ltr">> May be you are trying<br>
> to grep /var/lib/dpkg/info for the usage of su / sudo to get some<br>
> picture what others are doing.</p>
<p dir="ltr">Following the Unix philosophy of using a collection of specialized small tools that do one thing best, when performing an action as another user it seems to be the correct thing to use a tool that "execute a command as another user" rather than one whose primary goal is "change user ID or become superuser"</p>
<p dir="ltr">I would be in complete agreement to not use that tool if it was either new or obscure, but I don't think this can be said of sudo.</p>
<p dir="ltr">Should I ask the -devel mailing list to help us get out of our confusion?</p>
<p dir="ltr">Have a great start of your week.<br>
+Emilien<br>
</p>