Koozali.org: home of the SME Server

How do I make a new logfile or exclude an app from making them

Offline versa

  • ****
  • 109
  • +0/-0
How do I make a new logfile or exclude an app from making them
« on: October 27, 2008, 01:27:31 AM »
I have two dreambox satellite recievers and a card reader in my server since its the only thing that runs 24X7
Im using an application called CCcam which I start in /etc/rc.d/rc.local via /var/bin/CCcam.x86
It works fine but generates a lot of logs in the server manager -> view log files -> messages
Code: [Select]
Oct 27 00:09:11 server2 CCcam: client versa ecm request for handler 0x64 0x961(0x0) sid 0x2582 ok (took 0.4692 seconds)
Oct 27 00:09:18 server2 CCcam: local ecm -> card /dev/ttyS0 0x961(0x000) sid 0x2582
Oct 27 00:09:18 server2 CCcam: local ecm <- card /dev/ttyS0 ok
Oct 27 00:09:18 server2 CCcam: local ecm -> card /dev/ttyS0 0x961(0x000) sid 0x2581
Oct 27 00:09:18 server2 CCcam: client versa ecm request for handler 0x64 0x961(0x0) sid 0x2582 ok (took 0.4684 seconds)
Oct 27 00:09:19 server2 CCcam: local ecm <- card /dev/ttyS0 ok
As you can imagine it will create a big logfile.

Is there an easy way to create a new logfile just for this or even to exclude it from creating any entery's at all?


Regards
Versa
......

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: How do I make a new logfile or exclude an app from making them
« Reply #1 on: October 27, 2008, 03:21:24 AM »
Is there an easy way to create a new logfile just for this or even to exclude it from creating any entery's at all?

That's entirely up to CCcam. By default it is logging via syslog, and the log messages appear in /var/log/messages.

I see from this message:

http://www.info-sat.org/forums/lofiversion/index.php?t85453.html

that CCcam has a -d option which means that it stays in the foreground, and logs to standard output rather than syslog. That makes it suitable for running as a supervised service. Instead of starting it from rc.local, you would create a /var/service/CCcam directory, containing an executable 'run' script something like:

Code: [Select]
#! /bin/sh
exec 2>&1
exec /var/service/CCcam -d

and a /var/service/CCcam/log directory, containing an executable 'run' script something like:

Code: [Select]
#! /bin/sh
exec  setuidgid smelog  \
    /usr/local/bin/multilog t s500000  \
    /var/log/CCcam

You would then do:

Code: [Select]
mkdir /var/log/CCcam
chown smelog.smelog /var/log/CCcam
ln -s /var/service/CCcam /service

Read the developers guide for more detail about running supervised services and multilog logging.

Read this as well:

http://thedjbway.org/daemontools.html

Alternatively, you could ask people who know about CCcam how to configure it so that it doesn't create all these log messages, or how to configure it so that it logs to a syslog "facility" such as "local5.debug", and you could configure syslog via a custom template to not include those messages in /var/log/messages.