I think rhncfg-client should exit with a non-zero status in the following 
scenarios=> when `rhncfg-client get` fails to get all files successfully=> when 
`rhncfg-client get filename` doesn't find "filename" in a subscribed 
configuration channel=> when `rhncfg-client verify` finds that one or more 
files differ in some way (modifided, mode, user, group, selinux, etc.)
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.
[root@server1 ~]# rhncfg-client get /etc/ntp.confUsing server name 
spacewalk.example.comNot found on server: /etc/ntp.conf[root@server1 ~]# echo 
$?0
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:
#!/bin/bash/usr/bin/rhncfg-client get /etc/ntp.conf/sbin/service ntpd restart
I would like to run the following and have it 
work:#!/bin/bash/usr/bin/rhncfg-client get /etc/ntp.confif [ "$?" == 0 ]; then  
  /sbin/service ntpd restartfi
I think the code for this part is in the HandlerBase class inside 
/usr/share/rhn/config_client/handler_base.py.
Is there a design reason why rhncfg-client doesn't return non-zero values in 
these instances?
Thanks.                                           
_______________________________________________
Spacewalk-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-list

Reply via email to