[mythtv-users] LIRCD will load as root.. But not as mythtv?

Michael Jones m_g_j at michaelandholly.com
Mon May 1 17:02:25 UTC 2006


I've already tried changing the permissions on the /var/lock/subsys
directory and that doesn't solve it.. It also causes problems for other
areas of the system.

LIRCD doesn't actually have a log location..so nothing to change there.



> From: "R. G. Newbury" <newbury at mandamus.org>
> Reply-To: Discussion about mythtv <mythtv-users at mythtv.org>
> Date: Mon, 24 Apr 2006 15:16:15 -0400
> To: Discussion about mythtv <mythtv-users at mythtv.org>
> Subject: Re: [mythtv-users] LIRCD will load as root.. But not as mythtv?
> 
> Michael Jones wrote:
>> Devan, 
>> 
>> Thanks for the response..  But..
>> 
>> Rebooting the system and running lsmod doesn't show anything lirc.
>> 
>> When I run modprobe lirc_i2c as root, it works perfectly.  When I run it as
>> mythtv it fails.
>> 
>> Before the modprobe lirc_i2c as root, the file /var/run/lirc.pid doesn't
>> exist. 
>> 
>> Before modprobe lirc_i2c there's an entry /dev:
>> 
>> srw-rw-rw-  1 root root    0 Apr 23 23:48 lircd
>> 
>> If I run (logged in as mythtv rather than root)
>> 
>> # sudo modprobe lirc_i2c
>> 
>> It works, and in /dev:
>> 
>> crw-------  1 root root 61, 0 Apr 23 23:52 lirc
>> crw-------  1 root root 61, 0 Apr 23 23:52 lirc0
>> srw-rw-rw-  1 root root     0 Apr 23 23:48 lircd
>>  
>> If I enter: 
>> 
>> # sudo service lircd start
>> 
>> Things work just fine.
>> 
>> If I put the sudo'd commands in the startup script.. Things don't work.
>> 
>> I'm having a hard time believing that it's strictly permission related.
>> Especially since I didn't change any permissions after updating from .18 to
>> .19 (at least not intentionally).
>> 
>> I'm thinking that there must be a related issue somewhere in the background.
>> Is there any way that the system could have been starting lirc as root all
>> along.. Now, due to an update or change, it's running it as the mythtv user?
>> 
>> This is a little too weird - and frustrating, since I have to log in
>> remotely every time I reboot the machine and modprobe and start manually
>> before anything will work.
>> 
>> Anyone have any more ideas?
> 
> It may well be a permissions issue, but one which does not seem to
> produce any error messages!
> 
> In Fedora 5, the provided startup scripts (from the contrib folder) call
>    'daemon /usr/.../mythbackend -d -l /var/....logfile'
> 
> When you call 'service mythbackend start' as the mythtv user, it will
> call the /etc/init.d/mythbackend script.
> 
> If you just try the 'daemon...' line from the command line it will fail.
> 
> You can change the ownership of BOTH the subdirectory where the logfile
> will go AND the /var/lock/subsys subdirectory to mythtv:mythtv . NOTE
> that you have to create a mythbackend subdirectory for the logfile, (and
> change /etc/sysconfig/mythbackend and the init.d/mythbackend scripts)
> because if you just change the ownership of the entire /var/log
> directory, mysqld (or mysqld_safe) will fail, *silently*....User 'mysql'
> has to own its subdirectory...
> 
> Anyone suspecting that I have 'Been There Done That'?... One gold star
> on your helmet!).
> 
> I do not know what it is with 'daemon' that causes the problem but you
> can see the error message...It says something like....'error changing to
>   / ... no permission..'
> 
> The other and maybe better route is to remove mythbackend from the
> init.d scripts and just add a line to your rc.local file to start
> mythbackend exactly as you would from the command line.
> 
> Then you can chown all of the myth programs to mythtv:mythtv and set the
> lockfile, pid file and log files to the same ownership.
> 
> Note that at present, if you use 'service' then the lockfile belongs to
> 'root' and cannot be cleared by a 'service...restart' initiated by
> another user *unless that user is the owner of the directory*...hence
> the direction above.
> 
> Geoff
> 
> 
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
> 




More information about the mythtv-users mailing list