<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">I think rhncfg-client should exit with a non-zero status in the following scenarios</div><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">=> when `rhncfg-client get` fails to get all files successfully</div><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">=> when `rhncfg-client get filename` doesn't find "filename" in a subscribed configuration channel</div><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">=> when `rhncfg-client verify` finds that one or more files differ in some way (modifided, mode, user, group, selinux, etc.)</div><div style="font-family: Calibri, sans-serif; font-size: 12pt; "><br></div><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">For example, when I run the following command, I want to be able to restart the ntpd service only if the client successfully retrieved the ntp.conf file from the configuration channel.  WIthout a non-zero return value, it is not as straightforward and adding an "if [ "$?" == 0 ] statement.</div><div style="font-family: Calibri, sans-serif; font-size: 12pt; "><br></div><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">[root@server1 ~]# rhncfg-client get /etc/ntp.conf</div><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">Using server name spacewalk.example.com</div><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">Not found on server: /etc/ntp.conf</div><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">[root@server1 ~]# echo $?</div><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">0</div><div style="font-family: Calibri, sans-serif; font-size: 12pt; "><br></div><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">In this case, if I run the following remote command on a subscribed system, the Spacewalk Web UI will say that it ran successfully, even though ntp.conf is not a managed configuration file.  Additionally, ntpd will be restarted regardless, which is not the desired effect:</div><div style="font-family: Calibri, sans-serif; font-size: 12pt; "><br></div><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">#!/bin/bash</div><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">/usr/bin/rhncfg-client get /etc/ntp.conf</div><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">/sbin/service ntpd restart</div><div style="font-family: Calibri, sans-serif; font-size: 12pt; "><br></div><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">I would like to run the following and have it work:</div><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">#!/bin/bash</div><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">/usr/bin/rhncfg-client get /etc/ntp.conf</div><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">if [ "$?" == 0 ]; then</div><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">    /sbin/service ntpd restart</div><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">fi</div><div style="font-family: Calibri, sans-serif; font-size: 12pt; "><br></div><div><font face="Calibri, sans-serif" size="3">I think the code for this part is in the </font><font face="Calibri, sans-serif">HandlerBase class inside /usr/share/rhn/config_client/handler_base.py.</font></div><div><font face="Calibri, sans-serif"><br></font></div><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">Is there a design reason why rhncfg-client doesn't return non-zero values in these instances?</div><div style="font-family: Calibri, sans-serif; font-size: 12pt; "><br></div><div style="font-family: Calibri, sans-serif; font-size: 12pt; ">Thanks.</div>                                    </div></body>
</html>