• Symptom:
    When you install ZStack, you use root for login. However, when you start the service, the system reports that you are not a root user and sudo is required.
    ERROR: please use sudo or root user FAIL
     Reason: failed to start zstack
    When you run the following command in a Python CLI environment, you find that Python determined that you are not a root user.
    import getpass
     user = getpass.getuser()
     print user 
  • Cause:

    When you switch from a regular user to a root user, you used su instead of sudo su. In this case, only the root user is switched but relevant environment variables are not switched.

  • Description:
    • The sudo command can be used by the current user with the root super permission.
    • The su command can be used to switch to a root user. However, the relevant environment variables are not switched to the root directory.
    • The sudo su command is used to switch to a root user with the root permission.