Bugzilla – Bug 294
Not able to set Variable in default Profile for CA
Last modified: 2008-11-06 07:16:46 MST
The documentation shows an example of how to use a defaults setting for !set_logname. The documentations shows: Defaults>root !set_logname I believe it should be: Defaults:root !set_logname I get errors with the documentation example but it seems to work fine if I swap out the > for a :. All of the other examples use a : when specifying users.
In sudo1.6.9p17 we are facing problem while setting variable in default profile. The variable $AGENTWORKS_DIR is required in CA setup.Whenever we execute awservices command, follwing error generates: bash-3.00# awservices status Environment is not set properly. AGENTWORKS_DIR undefined Failed to load codeset table from file /services/config/local/cp1252.xlt, error 201 Environment is not set properly. AGENTWORKS_DIR undefined Failed to load codeset table from file /services/config/local/cp1252.xlt, error 201 Environment is not set properly. AGENTWORKS_DIR undefined Failed to load codeset table from file /services/config/local/cp1252.xlt, error 201 Environment is not set properly. AGENTWORKS_DIR undefined Failed to load codeset table from file /services/config/local/cp1252.xlt, error 201 Environment is not set properly. AGENTWORKS_DIR undefined Failed to load codeset table from file /services/config/local/cp1252.xlt, error 201 Environment is not set properly. AGENTWORKS_DIR undefined Failed to load codeset table from file /services/config/local/cp1252.xlt, error 201 Environment is not set properly. AGENTWORKS_DIR undefined Failed to load codeset table from file /services/config/local/cp1252.xlt, error 201 Environment is not set properly. AGENTWORKS_DIR undefined Failed to load codeset table from file /services/config/local/cp1252.xlt, error 201 Segmentation Fault (core dumped). $AGENTWORKS_DIR is set in default profile file as follows: if [ "$AGENTWORKS_DIR" = '' ] then AGENTWORKS_DIR=/opt/CA/UnicenterNSM/atech export AGENTWORKS_DIR fi if [ -f "$AGENTWORKS_DIR"/scripts/envset ] then . "$AGENTWORKS_DIR/scripts/envset" fi The same profile settings are present in machines with earlier version of sudo i.e Sudo version 1.6.8p9, but we are not facing any problem on these machine. Kindly inform if it is a version constraint & secondly is it possible to resolve this issue using sudo 1.6.9p17 version Regards Rajan
The '>' indicates that the default is applied when running commands as that user. In the example, !set_logname will be applied when running commands as root. Perhaps you have an older version of sudo that doesn't support runas Defaults. With respect to the AGENTWORKS_DIR environment variables, since version 1.6.9 sudo will run commands with a clean environment. If you need to preserve variables you can do so. See the UPGRADE file included with the sudo distribution for more information.