Ticket #1131 (closed defect: fixed)
bcfg2-info pipes partial output
Reported by: | https://www.google.com/accounts/o8/id?id=AItOawkcI3Ss9yHoQPv6KUCZdrDeUmrgJw4Sokw | Owned by: | desai |
---|---|---|---|
Priority: | major | Milestone: | Bcfg2 1.3.0 Release |
Component: | bcfg2-server | Version: | 1.0 |
Keywords: | Cc: | [email protected]… |
Description
When redirecting 'bcfg2-info groups' output to a file or whatever, not all information is redirected.
I tried on virtual servers
- Fedora 16 3.1.0-7.fc16.x86_64 bcfg2-server 1.2.1-2
- Fedora 15 2.6.40.3-0.fc15.i686.PAE bcfg2-server 1.2.0-1
So i have redirected command output to a bcfg2-groups file Then copy/paste command output to a file bcfg2-groups-pasted
Here is a result:
- Fedora 16, bcfg2-server 1.2.1-2
[root]# bcfg2-info groups > bcfg2-groups 2>&1 [root]# ll bcfg2-groups -rw-r--r-- 1 root root 14462 Oct 2 12:38 bcfg2-groups [root]# wc -l bcfg2-groups 60 bcfg2-groups [root]# ll bcfg2-groups-pasted -rw-r--r-- 1 root root 18153 Oct 2 12:43 bcfg2-groups-pasted [root]# wc -l bcfg2-groups-pasted 95 bcfg2-groups-pasted
- Fedora 15, bcfg2-server 1.2.0-1
[root]# bcfg2-info groups > bcfg2-groups 2>&1 [root]# ll bcfg2-groups -rw-rw-r-- 1 root root 35038 Oct 2 05:50 bcfg2-groups [root]# wc -l bcfg2-groups 174 bcfg2-groups [root]# ll bcfg2-groups-pasted -rw-rw-r-- 1 root root 36623 Oct 2 05:50 bcfg2-groups-pasted [root]# wc -l bcfg2-groups-pasted 184 bcfg2-groups-pasted
Attachments
Change History
comment:1 Changed 10 years ago by https://www.google.com/accounts/o8/id?id=AItOawkcI3Ss9yHoQPv6KUCZdrDeUmrgJw4Sokw
comment:2 Changed 10 years ago by https://www.google.com/accounts/o8/id?id=AItOawmhfxIOg3eM29zqtzKItP4pG8fxKrMlb8w
- Cc [email protected]… added
comment:3 follow-up: ↓ 4 Changed 10 years ago by https://www.google.com/accounts/o8/id?id=AItOawnSjgovXZr-_V3vGkvMSR0pc5LDykRc1Nc
- Milestone set to Bcfg2 1.3.0 Release
I believe there were several fixes to how bcfg2-info produces output (specifically with regards to redirection) in 1.2 at some point. Can you try upgrading to 1.2.3 and see if you still encounter the problem?
If you do, please also provide a diff of the redirected output and the expected (pasted) output, so we can see what's missing. Thanks very much.
comment:4 in reply to: ↑ 3 Changed 10 years ago by https://www.google.com/accounts/o8/id?id=AItOawkcI3Ss9yHoQPv6KUCZdrDeUmrgJw4Sokw
Replying to https://www.google.com/accounts/o8/id?id=AItOawnSjgovXZr-_V3vGkvMSR0pc5LDykRc1Nc:
I believe there were several fixes to how bcfg2-info produces output (specifically with regards to redirection) in 1.2 at some point. Can you try upgrading to 1.2.3 and see if you still encounter the problem?
If you do, please also provide a diff of the redirected output and the expected (pasted) output, so we can see what's missing. Thanks very much.
I have compiled version 1.2.3 on fedora 15 and fedora 16
First output is expected(pasted).
Then output a redirected contend
And redirect with tee command. Same problem here
log of actions:
[[email protected] ~]# rpm -q bcfg2-server bcfg2-server-1.2.3-0.0.noarch [[email protected] ~]# uname -a Linux f15-32 2.6.42.3-2.fc15.i686.PAE #1 SMP Thu Feb 9 01:31:44 UTC 2012 i686 i686 i386 GNU/Linux [[email protected] ~]# bcfg2-info groups Handled 14 events in 0.004s Groups | Profile | Category | Contains ============================================== basic | yes | | redhat debian | no | | freebsd | no | | gentoo | no | | mandrake | no | | redhat | no | | solaris | no | | suse | no | | ubuntu | no | | [[email protected] ~]# bcfg2-info groups > bcfg2-groups [[email protected] ~]# cat bcfg2-groups Handled 14 events in 0.005s [[email protected] ~]# [[email protected] ~]# bcfg2-info groups | tee bcfg2-groups Handled 14 events in 0.004s [[email protected] ~]# cat bcfg2-groups Handled 14 events in 0.004s [[email protected] ~]#
Here is diff of outputs:
--- bcfg2-groups 2012-10-29 06:15:36.000000000 -0400 +++ bcfg2-groups-pasted 2012-10-29 06:21:12.000000000 -0400 @@ -1 +1,13 @@ -Handled 14 events in 0.004s +Handled 14 events in 0.005s + Groups | Profile | Category | Contains +============================================== + basic | yes | | redhat + debian | no | | + freebsd | no | | + gentoo | no | | + mandrake | no | | + redhat | no | | + solaris | no | | + suse | no | | + ubuntu | no | | +
same problem on fedora 16
And problem is that i can't get my group information in script. Is there a better way to achieve this?