[mythtv-users] Logging doesn't work
Peter Bennett
cats22 at comcast.net
Sun Sep 17 16:51:10 UTC 2017
On 09/17/2017 12:31 PM, Enno Middelberg wrote:
> 2017-09-17 15:17 GMT+02:00 Bill Meek <keemllib at gmail.com>:
>> You may be looking in the wrong place (logging works great
>> as you saw from the command line test.)
>>
>> I'd try this: $ systemctl cat mythtv-backend
>>
>> And expect to see a line similar to:
>>
>> # /etc/systemd/system/mythtv-backend.service
>>
>> I believe if a .service file exists, then it will be preferred
>> to an entry in /etc/init.d (it does for me.)
>>
>> Also, try: $ systemctl status mythtv-backend
>> to verify where your service is being loaded,
>> e.g.:
> Everything seems to point to /etc/init.d/mythtv-backend:
>
> root at medienpc:/etc/init.d# systemctl cat mythtv-backend
> # /run/systemd/generator.late/mythtv-backend.service
> # Automatically generated by systemd-sysv-generator
>
> [Unit]
> Documentation=man:systemd-sysv-generator(8)
> SourcePath=/etc/init.d/mythtv-backend
> Description=LSB: Start/Stop the MythTV server.
> Before=multi-user.target
> Before=multi-user.target
> Before=multi-user.target
> Before=graphical.target
> After=remote-fs.target
> After=mysql.service
>
> [Service]
> Type=forking
> Restart=no
> TimeoutSec=5min
> IgnoreSIGPIPE=no
> KillMode=process
> GuessMainPID=no
> RemainAfterExit=yes
> SuccessExitStatus=5 6
> ExecStart=/etc/init.d/mythtv-backend start
> ExecStop=/etc/init.d/mythtv-backend stop
>
>
> root at medienpc:/etc/init.d# systemctl status mythtv-backend
> ● mythtv-backend.service - LSB: Start/Stop the MythTV server.
> Loaded: loaded (/etc/init.d/mythtv-backend; generated; vendor
> preset: enabled)
> Active: active (running) since Sun 2017-09-17 16:17:46 CEST; 2h 3min ago
> Docs: man:systemd-sysv-generator(8)
> Process: 1054 ExecStop=/etc/init.d/mythtv-backend stop (code=exited,
> status=0/SUCCESS)
> Process: 1460 ExecStart=/etc/init.d/mythtv-backend start
> (code=exited, status=0/SUCCESS)
> Tasks: 20 (limit: 4915)
> CGroup: /system.slice/mythtv-backend.service
> └─962 /usr/bin/mythbackend --daemon --pidfile
> /var/run/mythtv/mythbackend.pid
>
> Sep 17 16:17:46 medienpc systemd[1]: Starting LSB: Start/Stop the
> MythTV server....
> Sep 17 16:17:46 medienpc mythtv-backend[1460]: Starting MythTV server:
> mythbackend .
> Sep 17 16:17:46 medienpc systemd[1]: Started LSB: Start/Stop the MythTV server..
>
>
> Also when I change /etc/init.d/mythtv-backend, for example, to pass
> extra command line args such as "--syslog" then this option will
> appear in the process list, indicating that I'm editing the correct
> file:
>
> root at medienpc:/etc/init.d# ps aux | grep mythbackend
> mythtv 2924 1.6 1.2 3660892 44220 ? Ssl 18:26 0:00
> /usr/bin/mythbackend --daemon --pidfile
> /var/run/mythtv/mythbackend.pid --syslog
>
> I don't get it. Where the bloody hell does it write logging information?
>
> Also, to clarify: the backend usually won't come up when the machine
> wakes itself up of after a reboot ("All tuners are busy" or some such
> problem). However, when I manually stop/start the process, the backend
> will typicall work. So that's what I'm trying to debug.
>
>
> Cheers,
>
> Enno
>
Normally you should use /usr/bin/mythbackend --syslog local7
Then in order to put the log into /var/log/mythtv, there should be a
file in /etc/rsyslog.d with rules for logging, otherwise the log will be
mixed into /var/log/syslog with other system messages. Those rules look
something like this:
# Send all logging from MythTV applications to application-specific log
files.
if $msg startswith ' mythbackend' then /var/log/mythtv/mythbackend.log
& stop
if $msg startswith ' mythfrontend' then /var/log/mythtv/mythfrontend.log
& stop
if $msg startswith ' mythjobqueue' then /var/log/mythtv/mythjobqueue.log
& stop
if $msg startswith ' mythmediaserver' then
/var/log/mythtv/mythmediaserver.log
& stop
...
Make sure that the /var/log/mythtv directory exists
More information about the mythtv-users
mailing list