[Openstack-docs] [training-guides] sudo vs. root

Pančur, Matjaž Matjaz.Pancur at fri.uni-lj.si
Fri Jun 13 15:06:29 UTC 2014


+1 for using sudo (and for re-using devstack "core” scripts where it adds clarity)

I believe it is easier to overlook changed prompt (for “switching” to root) than sudo in front of a command.

Matjaz


On 13. jun. 2014, at 10:54, Roger Luethi <rl at patchworkscience.org> wrote:

> For the training-guides scripts, this is a decision of some importance:
> do we write scripts that run as root (within the VMs, of course),
> or do we use sudo where necessary?
> 
> The install guide uses different prompts ($, #) to indicate regular vs.
> root user [1]:
> 
> ---------------------------------------------------------
> Commands prefixed with the # prompt are to be executed by the root user.
> These examples can also be executed by using the sudo command, if
> available.
> 
> Commands prefixed with the $ prompt can be executed by any user, including
> root.
> ---------------------------------------------------------
> 
> Obviously, our scripts cannot just change a prompt to switch users.
> Switching users adds some complexity (for instance, you lose much of
> your environment in a sudo call and need to rebuild it every time).
> The devstack scripts (although not intended for production) go to great
> lengths to run as a regular user and use sudo when necessary.
> 
> The training-guides infrastructure is also set up to use sudo rather than
> being root. This is going to be much harder to change once all the the
> scripts have been written, so if this is considered a bad decision, please
> let us know.
> 
> Roger
> 
> [1] http://docs.openstack.org/icehouse/install-guide/install/apt-debian/content/ch_preface.html
> 
> _______________________________________________
> Openstack-docs mailing list
> Openstack-docs at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-docs




More information about the Openstack-docs mailing list