Author |
Message |
bigbro
|
Posted: Wed Jan 31, 2007 11:13 pm |
|
Joined: Sat Dec 24, 2005 11:33 am
Posts: 400
Location:
Kitsap Peninsula, Wa., United States
|
I was doing some checking around this morning trying to figure out why I had a bad recording. Turns out it was the station not me.
Anyway, in checking some of the logs I found that /var/log/mythtv/mythbackend.log was empty
When I do ls -al
It shows this
Code: -rw-r----- 1 root adm 11710 Jan 21 10:05 mythbackend.log.0 -rw-r--r-- 1 mythtv mythtv 50445 Jan 21 04:25 mythbackend.log.2 Now these are the last rollover and the one before it. I tried killing mythbackend.log and expecting it to recreate but no dice. I had installed babysit_backend a couple of weeks back it all seemed to work fine. I noticed that the babysit log was doing the same thing as fat as ownership as were many others. I usually do not log in as root but rather ssh in as user mythtv and su to root. Most recently I installed the rrdtools to monitor my mbe. That also showed strange owner ship but I killed the most recent one and now it recreated and seems correct but is still not growing. Code: -rw-r--r-- 1 root mythtv 0 Jan 31 15:22 babysit_backend.log -rw-r----- 1 root adm 292 Jan 27 07:43 babysit_backend.log.0 it won't until it needs to reset the backend. Those are rare... I know if I check the Backend logs in Mythweb it shows me typical output I am used to seeing. I am still pretty new to Linux any thoughts. Should it have made a difference if I built the scripts above when I was on myKnoppix box, when I log in from that machine I have to SU my personal profile and then ssh as su into the Mythbox. Might be rambling here, but trying to give you all the things I can remember I have done over the last 2 weeks. Thanks for the help. Andy [/code]
_________________ KnoppMyth R5.5
MBE: AMD64 3400+, K8N Neo4 Plat., 1Gig, Asus Extreme N6200, 320G pata, 2x320Gsata, 750Gsata, PVR-150 Retail w/Blaster
SBE: AMD XP2000, GA 7ZMMH, 1 Gig, XFX 256M 6200, 20 Gig, PVR-150 Retail w/Blaster
SBE: AMD Dur1800, 512M, PVR500
Last edited by bigbro on Sun Feb 04, 2007 11:38 am, edited 2 times in total.
|
|
Top |
|
 |
alien
|
Posted: Thu Feb 01, 2007 1:06 am |
|
Joined: Mon Jun 21, 2004 5:28 am
Posts: 700
Location:
Germany
|
The ownership still looks funny. Did you possibly start mythbackend as root at some point?
I recommend you stop the backend, fix the ownerships (chown mythtv:mythtv /var/log/mythtv/mythbackendlog*), then restart the backend with the correct userID. Either just reboot your box, or as root use the startup script in /etc/init.d/. I think there are also ALT keybindings for starting/stopping the backend, but have never used them.
_________________ ASUS AT3N7A-I (Atom 330) TBS 8922 PCI (DVB-S2)
|
|
Top |
|
 |
bigbro
|
Posted: Thu Feb 01, 2007 8:20 am |
|
Joined: Sat Dec 24, 2005 11:33 am
Posts: 400
Location:
Kitsap Peninsula, Wa., United States
|
Alien, I like never use the /etc/init.d route to start or stop the backend. Can't remember for sure if I did. I'll keep looking at things>
Updated information>
Last evening after I wrote the post, I did some additonal digging around.
The only thing that came to mind was to rm the bad current file and recreate it as a standard user. My thinking that would start a new file with the appropriate permissions since they should be inherited from the acls' for the directory.
After I did this I used key bindings to stop and start the backend.
It appears this morning they are updating correctly.
When I get home this evennig, I'll post updated snaps of the directory/file ownerships.
Thanks!
Solved: The solution was to rm the files and then recreate them as the appropriate user. Probalby was an easier way to do this, but that worked for me. YMMV. it appears to be rolling those logs properly and updating as it goes along.
Quote: To break it at this point would have been disasterous. That W has a lot of stuff recorded and I don't have time to fix it at the moment... woohoo!
_________________ KnoppMyth R5.5
MBE: AMD64 3400+, K8N Neo4 Plat., 1Gig, Asus Extreme N6200, 320G pata, 2x320Gsata, 750Gsata, PVR-150 Retail w/Blaster
SBE: AMD XP2000, GA 7ZMMH, 1 Gig, XFX 256M 6200, 20 Gig, PVR-150 Retail w/Blaster
SBE: AMD Dur1800, 512M, PVR500
|
|
Top |
|
 |
bigbro
|
Posted: Sun Feb 04, 2007 11:45 am |
|
Joined: Sat Dec 24, 2005 11:33 am
Posts: 400
Location:
Kitsap Peninsula, Wa., United States
|
I downgraded this from Solved as it has resurfaced.
After I had manually created the files as the appropriate users it worked until today.
Logs roller over last night as they have been and all of a sudden I am not writing to babysit_backend.log and mythbackend.log again.
Permissions were like this.
This one seems to rollover once a week or so so it just happened.
Quote: -rw-r----- 1 root adm 0 Feb 4 04:47 babysit_backend.log -rw-r----- 1 root adm 11276 Feb 3 12:21 babysit_backend.log.0 This one rolls every morning. Quote: -rw-r----- 1 root adm 0 Feb 4 04:47 mythbackend.log -rw-r----- 1 root adm 5468 Feb 4 08:41 mythbackend.log.0 -rw-r--r-- 1 mythtv mythtv 80969 Feb 4 04:25 mythbackend.log.2 -rw-r--r-- 1 mythtv mythtv 56489 Feb 3 04:25 mythbackend.log.3
Any thoughts of what I can look at that is causing the change in permissions it would seem it is something being executed in a log rollover sctipt.
I did add LVM to this box yesterday morning, actually finished at about noon on Feb 3.
Thanks for the help!
_________________ KnoppMyth R5.5
MBE: AMD64 3400+, K8N Neo4 Plat., 1Gig, Asus Extreme N6200, 320G pata, 2x320Gsata, 750Gsata, PVR-150 Retail w/Blaster
SBE: AMD XP2000, GA 7ZMMH, 1 Gig, XFX 256M 6200, 20 Gig, PVR-150 Retail w/Blaster
SBE: AMD Dur1800, 512M, PVR500
|
|
Top |
|
 |
tjc
|
Posted: Sun Feb 04, 2007 12:41 pm |
|
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location:
Arlington, MA
|
Check to see what user the backend is running as, it should be mythtv as shown here:
Code: root@black2:~# ps -elf | grep mythbackend 1 S mythtv 16648 1 0 60 0 - 47912 stext 10:16 ? 00:00:08 /usr/bin/mythbackend --daemon --logfile /var/log/mythtv/mythbackend.log --pidfile /var/run/mythtv/mythbackend.pid 0 S root 20112 5083 0 78 0 - 411 pipe_w 13:35 ttyp0 00:00:00 grep mythbackend If the backend is getting naively restarted by root that would explain this. Also make sure that the ownership and permissions on /var/log/mythtv look like this: Code: root@black2:~# ls -ald /var/log/mythtv drwxrwsr-x 2 mythtv mythtv 4096 Feb 4 06:25 /var/log/mythtv
Any script which are monitoring/restarting the backend should either be running as mythtv or be using /etc/init.d/mythtv-backend restart which will ensure that the daemon is started as the right user.
|
|
Top |
|
 |
bigbro
|
Posted: Sun Feb 04, 2007 7:52 pm |
|
Joined: Sat Dec 24, 2005 11:33 am
Posts: 400
Location:
Kitsap Peninsula, Wa., United States
|
TJC, mine looks the same as yours for the most part.
Code: root@mythtv:/home/mythtv# ps -elf | grep mythbackend 1 S mythtv 5189 1 0 76 0 - 45369 stext Feb03 ? 00:07:54 /usr/bin/mythbackend --daemon --logfile /var/log/mythtv/mythbackend.log --pidfile /var/run/mythtv/mythbackend.pid 0 R root 32156 32072 0 75 0 - 410 - 17:43 ttyp0 00:00:00 grep mythbackend Code: root@mythtv:/home/mythtv# ls -ald /var/log/mythtv drwxrwsr-x 2 mythtv mythtv 4096 Feb 4 09:35 /var/log/mythtv
I know I can manually create these as Mythtv user and they start working again seems to be until something rolls over the logfiles. Seems to be tied to the babysit_backend.log rollover.
|
|
Top |
|
 |
tjc
|
Posted: Sun Feb 04, 2007 8:24 pm |
|
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location:
Arlington, MA
|
I suspect that you're right...
|
|
Top |
|
 |
bigbro
|
Posted: Mon Feb 05, 2007 3:51 pm |
|
Joined: Sat Dec 24, 2005 11:33 am
Posts: 400
Location:
Kitsap Peninsula, Wa., United States
|
I have tried a couple of changes to see if I can correct this issue.
I cannot see where it forces a rotation of the babysit log.
In looking at the babysit_backend tips to install it, seems the user was not su.
Might be my issue cuz I do most everythig remotely and need to su in to do that.
I looked ownership of babysit_backend.sh
ls -al babysit_backend.sh reveals:
Code: -rwxr-xr-x 1 root root 2134 Jan 18 17:23 babysit_backend.sh I changed ownership and group to be mythtv: Code: root@mythtv:/usr/local/bin# ls -al babysit_backend.sh -rwxr-xr-x 1 mythtv mythtv 2134 Jan 18 17:23 babysit_backend.sh
I then went into the root crontab at /etc/crontab and tried changing the username to mythtv.
It showed it was executing, but a test by killing the backend would not set the backend.
When I look in the script some of the commands like to restart the backend start with sudo.
I changed it back to root in the crontab. Tests show it is working and restores the backend.
not sure it this is correct but it is working.
I'll need to keep an eye on it to see if it keeps working.
I'll post back when I have more info.
|
|
Top |
|
 |
bigbro
|
Posted: Mon Feb 12, 2007 10:00 am |
|
Joined: Sat Dec 24, 2005 11:33 am
Posts: 400
Location:
Kitsap Peninsula, Wa., United States
|
Ok new info
I made some changes to lircrc which required a restart. I performed that restart last evening at 21:45 hrs or there abouts.
When it restarted it caused the logs to revert ownership and they were not writing again.
Here is what they look like. The last time I did any restarts etc was Feb 5
essentially babysit_backend.log had only a couple fo entires in it but the system had been working fine.
Code: mythtv@mythtv:/var/log/mythtv$ ls -al total 444 drwxrwsr-x 2 mythtv mythtv 4096 Feb 11 04:47 . drwxr-xr-x 14 root root 4096 Feb 12 04:25 .. -rw-r--r-- 1 root mythtv 2386 Dec 26 09:14 KnoppMyth-run.log -rw-r----- 1 root adm 0 Feb 11 04:47 babysit_backend.log -rw-r----- 1 root adm 436 Feb 5 13:26 babysit_backend.log.0 -rw-r----- 1 root adm 709 Feb 3 12:21 babysit_backend.log.1.gz -rw-r----- 1 root adm 150 Jan 27 07:43 babysit_backend.log.2.gz -rw-r----- 1 root adm 210 Jan 18 22:24 babysit_backend.log.3.gz -rw-r----- 1 root adm 0 Feb 11 04:47 mythbackend.log -rw-r----- 1 root adm 36413 Feb 11 21:46 mythbackend.log.0 -rw-r--r-- 1 mythtv mythtv 37681 Feb 11 04:25 mythbackend.log.2 -rw-r--r-- 1 mythtv mythtv 86264 Feb 10 04:25 mythbackend.log.3 -rw-r--r-- 1 mythtv mythtv 81391 Feb 8 04:25 mythbackend.log.4 -rw-r--r-- 1 mythtv mythtv 63120 Feb 7 04:25 mythbackend.log.5 -rw-r--r-- 1 mythtv mythtv 74977 Feb 6 04:25 mythbackend.log.6 -rw-r--r-- 1 mythtv mythtv 14239 Feb 5 04:25 mythbackend.log.7
Any thoughts on what I should look at?
I did notice it seems to have restarted the logs and changed their permissions. My log files roll over at 04:45 every morning so it follows that the permissions changed at 21:46 when the system came back up and these two logs have not written since then.
_________________ KnoppMyth R5.5
MBE: AMD64 3400+, K8N Neo4 Plat., 1Gig, Asus Extreme N6200, 320G pata, 2x320Gsata, 750Gsata, PVR-150 Retail w/Blaster
SBE: AMD XP2000, GA 7ZMMH, 1 Gig, XFX 256M 6200, 20 Gig, PVR-150 Retail w/Blaster
SBE: AMD Dur1800, 512M, PVR500
|
|
Top |
|
 |