[arch-general] Impossible redirect console buffer to log

Maykel Franco maykeldebian at gmail.com
Fri Mar 1 18:15:00 UTC 2019


El vie., 1 mar. 2019 a las 19:09, Chris Billington
(<chrisjbillington at gmail.com>) escribió:
>
> The program could also explicitly be modifying its behaviour based on whether stdout is a tty or not. You can trick it into thinking its stdout is a tty with the program 'unbuffer'. For example:
>
> [bilbo:~]$ python -c 'import sys; print(sys.stdout.isatty())' | cat
> False
> [bilbo:~]$ unbuffer python -c 'import sys; print(sys.stdout.isatty())' | cat
> True
>
> So you might try:
>
> unbuffer /usr/local/bin/CCcam -d > file
>
>
> On Fri, Mar 1, 2019 at 1:04 PM Maykel Franco <maykeldebian at gmail.com> wrote:
>>
>> El vie., 1 mar. 2019 a las 19:01, Chris Billington
>> (<chrisjbillington at gmail.com>) escribió:
>> >
>> > Perhaps the program writes its log to stderr, and not to stdout?
>> >
>> > If so, you can redirect both stdout and stderr to file with:
>> >
>> > command &> out
>> >
>> >
>> >
>> > On Fri, Mar 1, 2019 at 12:47 PM Maykel Franco via arch-general <arch-general at archlinux.org> wrote:
>> >>
>> >> HI, I playing with cccam for a proyect with decoder and I like stdout
>> >> console log to specific log but not work...
>> >>
>> >> I try all:
>> >>
>> >> >> /var/log/test.log
>> >>
>> >> tee -a /var/log/test.log
>> >>
>> >> strace -p pid
>> >>
>> >> The command is:
>> >>
>> >> /usr/local/bin/CCcam -d
>> >> 18:43:15.717 CCcam:
>> >> ======================================================================
>> >> 18:43:15.717 CCcam: starting CCcam
>> >> ======================================================================
>> >> 18:43:15.717 CCcam: online using nodeId 91dd747775a31f66
>> >> 18:43:15.735 CCcam: create 1 cam device(s)
>> >> 18:43:15.739 CCcam: readKeyfile: cannot open /var/keys/SoftCam.Key or not found
>> >> 18:43:15.739 CCcam: readKeyfile: cannot open /var/keys/AutoRoll.Key or not found
>> >> 18:43:15.739 CCcam: static cw not found or bad
>> >> 18:43:15.746 CCcam: parsed 11522 entries from /var/etc/CCcam.prio
>> >> 18:43:15.747 CCcam: added 1005 provider names from /var/etc/CCcam.providers
>> >> 18:43:15.798 CCcam: added 11097 channel names from /var/etc/CCcam.channelinfo
>> >> 18:43:15.798 CCcam: server started on port 47015
>> >>
>> >>
>> >>
>> >> The binary program is:
>> >>
>> >> /usr/local/bin/CCcam: ELF 64-bit LSB executable, x86-64, version 1
>> >> (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2,
>> >> for GNU/Linux 2.6.32, BuildID[sha1]=6ab44025c0a35a3
>> >> 83d63f30e96e489f29df424b5, stripped
>> >>
>> >>
>> >> I've tried everything, I do not know what to do to have that output
>> >> write it to log.
>> >>
>> >> I've tried inclusy with tty, pts but it's impossible.
>> >>
>> >> Does somebody knows why it could be? with any other command / program works well
>> >>
>> >> with the only thing that I have managed to write to log is add:
>> >>
>> >> | stdbuf -oL
>> >>
>> >> but the program closes
>>
>> Thanks for your reply.
>>
>> Not works... I probe all combinations:
>>
>> > file redirects stdout to file
>> 1> file redirects stdout to file
>> 2> file redirects stderr to file
>> &> file redirects stdout and stderr to file
>>
>> Not work...

Unbuffer work but the program exit...

$ unbuffer /usr/local/bin/cccam -d > /var/log/test.log

tail: /var/log/test.log: file truncated
19:12:12.548 CCcam:
======================================================================
19:12:12.548 CCcam: starting CCcam 2.1.3 compiled on Nov 14 2009 at 00:47:12
19:12:12.548 CCcam:
======================================================================
19:12:12.548 CCcam: online using nodeId 95ced5a4a066a2b2
19:12:12.568 CCcam: create 1 cam device(s)

and exit... crash/close program


More information about the arch-general mailing list