[Spacewalk-list] 'rhncfg-client verify' traceback
Colin Coe
colin.coe at gmail.com
Tue Nov 29 22:44:16 UTC 2011
On Tue, Nov 29, 2011 at 4:03 PM, Jan Pazdziora <jpazdziora at redhat.com> wrote:
> On Tue, Nov 29, 2011 at 10:32:54AM +0800, Colin Coe wrote:
>> Hi all
>>
>> I'm getting a taceback when running rhncfg-client verify on a newly
>> built RHEL6 node. I hacked
>> /usr/share/rhn/config_client/rhncfgcli_verify.py to print the name of
>> the file it is processing and I find that it is failing on
>> /etc/auto.master.
>>
>> rhncfg-client verify
>> Using server name 172.22.106.16
>> /etc/auto.home
>> /etc/auto.hp
>> /etc/auto.master
>> Traceback (most recent call last):
>> File "/usr/bin/rhncfg-client", line 34, in <module>
>> sys.exit(Main().main() or 0)
>> File "/usr/share/rhn/config_common/rhn_main.py", line 184, in main
>> handler.run()
>> File "/usr/share/rhn/config_client/rhncfgcli_verify.py", line 83, in run
>> ret_dict = self._process_file(src, dst, file, ftype, file_info)
>> File "/usr/share/rhn/config_client/rhncfgcli_verify.py", line 259,
>> in _process_file
>> dst_selinux = lgetfilecon(dst)[1]
>> OSError: [Errno 2] No such file or directory
>>
>> ls -lZ /etc/auto.master
>> -rw-r--r--. root root system_u:object_r:etc_t:s0 /etc/auto.master
>>
>> Anyway, this small patch silences the error. Not sure if this is the
>> right way to handle it though.
>>
>> diff -uw /usr/share/rhn/config_client/rhncfgcli_verify.py.orig
>> /usr/share/rhn/config_client/rhncfgcli_verify.py
>> --- /usr/share/rhn/config_client/rhncfgcli_verify.py.orig 2011-11-29
>> 10:29:13.194363922 +0800
>> +++ /usr/share/rhn/config_client/rhncfgcli_verify.py 2011-11-29
>> 10:30:38.706358435 +0800
>> @@ -248,8 +248,11 @@
>> src_selinux = info['selinux_ctx']
>> if src_selinux:
>> if not stat_err:
>> - dst_selinux = lgetfilecon(dst)[1]
>> - if dst_selinux == None:
>> + try:
>> + dst_selinux = lgetfilecon(dst)[1]
>> + if dst_selinux == None:
>> + dst_selinux = ""
>> + except:
>> dst_selinux = ""
>> else:
>> dst_selinux = "missing"
>
> Can you investigate in more depth why you'd get that No such file or
> directory error?
>
> If you do
>
> python -c 'from selinux import lgetfilecon; print lgetfilecon("/etc/auto.master")'
>
> -- what do you get? In what context does the rhncfg-client run
> on your system?
>
> --
> Jan Pazdziora
> Principal Software Engineer, Satellite Engineering, Red Hat
>
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list
>
Hi Jan
python -c 'from selinux import lgetfilecon; print
lgetfilecon("/etc/auto.master")'
[27, 'system_u:object_r:etc_t:s0']
Thanks
CC
--
RHCE#805007969328369
More information about the Spacewalk-list
mailing list