Hi Andreas, Le 23 févr. 2014 22:30, "Andreas Tille" <andr...@an3as.eu> a écrit : > > Hi Emilien, > > On Sun, Feb 23, 2014 at 09:49:46PM +0100, Emilien Klein wrote: > > 2014-02-23 19:53 GMT+01:00 Karsten Hilbert <karsten.hilb...@gmx.net>: > > > > > > On Sun, Feb 23, 2014 at 08:38:56AM +0100, Andreas Tille wrote: > > > > > > > > Extract from the manpages: > > > > > sudo: > > > > > sudo, sudoedit - execute a command as another user > > > > > > > > I'd call this a bit confusing since sudo is the command to do something > > > > as superuser. > > > > > > Not really. It just so happens that the *default* > > > target usually is root. > > > > > > Look at "-u username". > > > > > > Correct, sudo is to perform a command as another user (by default > > root, but it can be any user you which), while su is to 'become" that > > other user (and then likely perform commands as that other user). > > > > Only those few commands (in different scripts) need to be performed as > > the database-owning user, all the rest of the process needs to be done > > by root. Using sudo is the correct way to do that. > > I will make sure to Depend on sudo. > > As I tried to express this is *not* the correct conclusion in my > opinion.
Yes, I understand what you are saying. > You should use su in your scripts. OK, but why? What I'm missing so far is an explanation on why we shouldn't use sudo for this use-case. > May be you are trying > to grep /var/lib/dpkg/info for the usage of su / sudo to get some > picture what others are doing. 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" 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. Should I ask the -devel mailing list to help us get out of our confusion? Have a great start of your week. +Emilien