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

Roger Luethi rl at patchworkscience.org
Fri Jun 13 08:54:19 UTC 2014


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



More information about the Openstack-docs mailing list