SUSE Support

Here When You Need Us

Cannot run "crm status" command as root user

This document (7018754) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise High Availability Extension 11 Service Pack 3
SUSE Linux Enterprise High Availability Extension 11 Service Pack 4

Situation

Logged in as root user, getting error when trying to run "crm status" command.
         Sorry, sudo has been configured to not allow root to run it.
         ERROR: crm_mon exited with code 1 and said:

Resolution

Local configuration and custom environment for crm shell is found in the the users home directory.  Example: /root/.config/crm/rc  
To fix the issue, changed the environment to match the other node that was working. 
In this case, needed to remove the user "hacluster" from the "crm_daemon_user" section (default value)
      Working configuration: crm_daemon_user = ""
Once removed, root user could then run the "crm status" command without errors.

Cause

In this case they had a pretty complex sudoers setup and nothing defined for the "hacluster" user. 

Additional Information

Sufficient privileges are necessary in order to manage a cluster: programs such as crm_verify or crm_resource and,
ultimately, cibadmin have to be run either as root or as the CRM owner user (typically hacluster).
You don't have to worry about that if you run crm as root. A more secure way is to run the program with your usual privileges, set this option
to the appropriate user (such as hacluster), and setup the sudoers file.

Custom crm shell configuration for environment.
Reference:
2.0+ crm shell
crm can be configured using both a system-wide configuration file, and a per-user configuration file. The values set in the user-local file take precedence over the system-wide settings.

The global configuration file is usually installed at /etc/crm/crm.conf, and the user-local configuration file at ~/.config/crm/crm.conf.

Reference:
1.0+ crm shell
user-local configuration files at ~/.config/crm/rc

Helpful commands:
crm options show   * Displays current settings
crm options reset  * This command resets all user options to the defaults. If used as a slingshot command, the rc file ($HOME/.config/crm/rc) is reset to the defaults too.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7018754
  • Creation Date: 29-Mar-2017
  • Modified Date:03-Mar-2020
    • SUSE Linux Enterprise High Availability Extension

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.