LinHES Forums
http://forums.linhes.org/

mythtv-backend won't start with user mythtv
http://forums.linhes.org/viewtopic.php?f=14&t=7296
Page 1 of 1

Author:  dwalton22 [ Fri Dec 09, 2005 10:43 pm ]
Post subject:  mythtv-backend won't start with user mythtv

I'm on a R5A26 install (a BIG thank you to everyone who works on KnoppMyth BTW, it is a life saver) and I upgraded to svn code. After the upgrade the backend no longer starts on bootup. I get the dreaded "Unable to set initgroups" error message. I've checked and I did not create another user account called mythtv:

mythtv@backend:/etc/init.d$ ./mythtv-backend start
Starting MythTV server: mythbackendstart-stop-daemon: Unable to set initgroups() with gid 105
mythtv@backend:/etc/init.d$

backend:/etc/init.d# grep mythtv /etc/passwd
mythtv:$1$GLU854Ty$NGBuJMMLs4jXBFBVAox9U/:105:105::/home/mythtv:/bin/tcsh
backend:/etc/init.d#

I tried adding mythtv to the root group, tried changing the group for the script mythtv-backend to mythtv, changed file ownership to mythtv, etc, etc but nothing works.

What group does the user "mythtv" need to be a member of?

Thanks

Author:  cesman [ Fri Dec 09, 2005 10:59 pm ]
Post subject: 

Code:
grep mythtv /etc/group
Quote:
cdrom:*:24:mythtv,cecil
audio:!:29:mythtv,cecil
video:!:44:mythtv,cecil
mythtv:x:105:

Author:  dwalton22 [ Fri Dec 09, 2005 11:21 pm ]
Post subject: 

Same thing here except I added mythtv to the root group while trying to figure this thing out.

backend:/etc# grep mythtv /etc/group
root:!:0:mythtv
cdrom:*:24:mythtv,dwalton22
audio:!:29:mythtv,dwalton22
video:!:44:mythtv,dwalton22
mythtv:x:105:
backend:/etc#

Author:  dwalton22 [ Mon Dec 12, 2005 10:43 am ]
Post subject: 

bump...any ideas? Thanks

Author:  tiggermanh [ Fri Dec 16, 2005 5:05 pm ]
Post subject: 

You have to be root to run that command.

Sounds like you are running it from an xterm window.

Either su to root

or press ctrl shift F1 and login as root here and run the command.

Author:  dwalton22 [ Fri Dec 16, 2005 11:59 pm ]
Post subject: 

My backend logs in under the mythtv user by default so I was trying to run the script as mythtv in an xterm (troubleshooting).

How do I tell my backend to login as root by default instead of mythtv?

Author:  mjl [ Sun Dec 18, 2005 6:55 pm ]
Post subject: 

Hi dwalton22,

I am not really clear as to the issues, however start with the obvious stuff first. Most problems begin with not having done the homework for $ mythtv-setup and the setups under the the Utilities menu. These are run as mythtv user.

Also, depending how you did your install, some directories may not have been created (happens when using manual install) goto http://mythtv.org and compare the list of what should be under /myth/ directories. Mine looks like this however yours will most likely be a little different:

sh-3.00$ ls -al /myth
total 76
drwxr-xr-x 16 mythtv mythtv 4096 Dec 16 16:56 .
drwxr-xr-x 25 root root 4096 Dec 16 23:26 ..
drwxr-xr-x 6 mythtv mythtv 4096 Dec 16 23:23 avimanager
drwxr-xr-x 2 mythtv mythtv 4096 Dec 17 13:38 backup
drwxr-xr-x 6 mythtv mythtv 4096 Dec 16 23:23 games
drwxrwxr-t 2 www-data www-data 4096 Dec 18 19:03 image_cache
drwx------ 2 mythtv mythtv 16384 Dec 16 23:21 lost+found
drwxr-xr-x 4 mythtv mythtv 4096 Dec 16 16:58 music
drwxr-xr-x 14 mythtv mythtv 4096 Dec 16 23:23 mythburn
drwxr-xr-x 8 mythtv mythtv 4096 Dec 16 23:23 nuv2disc
drwxr-xr-x 2 mythtv mythtv 4096 Dec 16 23:23 pretty
drwxr-xr-x 2 mythtv mythtv 4096 Dec 17 21:48 saytime
drwxr-xr-x 2 mythtv mythtv 4096 Dec 16 23:23 stream
drwxr-xr-x 9 mythtv mythtv 4096 Dec 18 18:26 tools
drwxr-xr-x 2 mythtv mythtv 4096 Dec 18 19:10 tv
drwxr-xr-x 4 mythtv mythtv 4096 Dec 16 23:24 video

Look in this log for some guidence,
less /var/log/mythtv/mythbackend.log or
tail -100 /var/log/mythtv/mythbackend.log for the last 100 entries.

These guys are more than willing to help but they need information to do so. Also 99% of the troubles have been covered about 10 times each, so don't be scared to do some searching trying out various key words. Sometimes they hide, so then ask for some supplemental assistance.

Hope this is helpful.
Have a great day!
Mikke

Author:  dwalton22 [ Tue Dec 20, 2005 9:45 pm ]
Post subject: 

I finally figured it out, I needed to add

HOME=/home/mythtv

to the beginning of /etc/init.d/mythtv-backend

Author:  sammo2828 [ Sat Feb 18, 2006 7:15 am ]
Post subject: 

I also get the same message:

mythtv@backend:/etc/init.d$ ./mythtv-backend start
Starting MythTV server: mythbackendstart-stop-daemon: Unable to set initgroups() with gid 105
mythtv@backend:/etc/init.d$

Can somebody please clarify whether user mythtv is supposed to be able to run /etc/init.d/mythtv-backend [restart | start] ??? I'm guessing not ...

Instead of adding user mythtv to the root group and adding HOME=/home/mythtv to the script as dwalton22 did, I added /etc/init.d/mythtv-backend to the /etc/sudoers file instead ...

This way, I can do:

mythtv@backend:/etc/init.d$ sudo /etc/init.d/mythtv-backend start
Starting MythTV server: mythbackend.
mythtv@backend:/etc/init.d$

Hope this helps ...

Author:  tjc [ Sat Feb 18, 2006 10:39 am ]
Post subject: 

sammo2828 wrote:
Can somebody please clarify whether user mythtv is supposed to be able to run /etc/init.d/mythtv-backend [restart | start] ??? I'm guessing not ...

No. Starting/stopping daemons from init.d is a job for root. HOWEVER, it should run the daemon as the mythtv user. (See the setting of the USER variable in your /etc/init.d/mythtv-backend script and the defaults file /etc/default/mythtv-backend that it sources for any overrides.) Did you try to get excessively clever and set /usr/bin/mythbackend setuid or setgid to root? What does this show on your machine?
Code:
root@black2:~# ls -al /usr/bin/mythbackend
-rwxr-xr-x  1 root root 781396 Jan 24 00:32 /usr/bin/mythbackend

Author:  sammo2828 [ Sat Feb 18, 2006 5:56 pm ]
Post subject: 

hi tjc, thanks for the clarification ..

i didn't try to get "excessively clever" with setuid or setgid to root :) .. the daemon still runs as the mythtv user ..

the reason why i needed to restart /etc/init.d/mythtv-backend from user mythtv is because of a problem i had with mythbackend crashing or misbehaving occasionally when changing channels (don't worry about why, it seems to be better with the new 0.19) ...

I also added the following to /etc/X11/fluxbox/keys

Code:
Mod1 R :ExecCommand killall mythfrontend; mythfrontend
Control Mod1 R :ExecCommand killall mythfrontend; sudo /etc/init.d/mythtv-backend restart; mythfrontend


This way, I can easily restart mythfrontend with alt-R and restart mythbackend AND mythfrontend with control-alt-R ...

Author:  cesman [ Tue Feb 21, 2006 1:00 am ]
Post subject: 

Why would you do that when you could already start, stop and restart the backend with <alt><1>, <2> and <3> respectively?

Author:  sammo2828 [ Tue Feb 21, 2006 4:20 am ]
Post subject: 

oooh :shock: ... i'm still running R5A12 (with kernel and mythtv upgrades) :)

Author:  randomhtpcguy [ Sun Mar 26, 2006 3:16 pm ]
Post subject:  how can we start, stop, restart the master backend server

how can we start, stop, restart the master backend server?

I have to restart it often when my dvb card locks up.

Author:  cesman [ Sun Mar 26, 2006 3:20 pm ]
Post subject: 

Look up.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/