Bug 4414

Summary: mythtv-frontend install - mythtv user doesn't exists
Product: Fedora Reporter: Nicolas Chauvet <kwizart>
Component: mythtvAssignee: Richard <hobbes1069>
Status: RESOLVED FIXED    
Severity: enhancement CC: jarod
Priority: P1    
Version: 25   
Hardware: x86_64   
OS: GNU/Linux   
namespace:

Description Nicolas Chauvet 2017-01-12 18:30:15 CET
When installing mythtv-frontend (only), I'm experiencing this:

[...]
Installing: mythtv-common-0.28-10.fc25.x86_64                                                                            
warning : user mythtv doesn't exist - using root
warning : group mythtv inexistant - using root
warning : user mythtv doesn't exist - using root
warning : group mythtv doesn't exist - using root
[...]


Please fix the dependencies so that the user and group exists.
Comment 1 Richard 2017-01-14 15:12:35 CET
Only the group "mythtv" is created in %pre and I'm not sure a user is really required. The only real need in the common package is for the stuff in /etc and as long as the permissions are set to group writable that's all that should be needed.

Change:
%attr(-,mythtv,mythtv) %dir %{_sysconfdir}/mythtv
%attr(0664,mythtv,mythtv) %config(noreplace) %{_sysconfdir}/mythtv/config.xml

To:
%attr(0775,-,mythtv) %dir %{_sysconfdir}/mythtv
%attr(0664,-,mythtv) %config(noreplace) %{_sysconfdir}/mythtv/config.xml

Do you see any issues with that?
Comment 2 Nicolas Chauvet 2017-01-16 09:35:02 CET
(In reply to Richard from comment #1)
> Only the group "mythtv" is created in %pre and I'm not sure a user is really
> required. The only real need in the common package is for the stuff in /etc
Well, mythbackend is run as mythtv user, so I think it's useful.


Also in https://www.mythtv.org/wiki/Installing_MythTV_on_Fedora#Configure_automatic_startup
One can use mythtv user to autolaunch myth-frontend on mythtv user session.
I think it would be useful.

That been said, it would be useful to have a basic documentation for mythtv in our wiki: rpmfusion.org/Howto/
Can you please consider adding one ?

Thx for maintaining mythtv, I've only recently managed to have a working dvb-t setup.
Comment 3 Richard 2017-01-17 16:14:28 CET
Never mind, I don't know how I missed it but a user is created in %pre for both the frontend and backend but not for common so it looks like this cropped up due to the order of package installation. 

So my "fix" would work for the user problem but not the group problem so I guess I have to duplicate the script for the common package as well.
Comment 4 Nicolas Chauvet 2017-01-17 16:26:02 CET
(In reply to Richard from comment #3)
> Never mind, I don't know how I missed it but a user is created in %pre for
> both the frontend and backend but not for common so it looks like this
> cropped up due to the order of package installation. 
> 
> So my "fix" would work for the user problem but not the group problem so I
> guess I have to duplicate the script for the common package as well.

Well, why to duplicate, please only create the user in -common. both -frontend and -backend requires it anyway.
Comment 5 Richard 2017-01-17 16:33:38 CET
(In reply to Nicolas Chauvet from comment #4)
> (In reply to Richard from comment #3)
> > Never mind, I don't know how I missed it but a user is created in %pre for
> > both the frontend and backend but not for common so it looks like this
> > cropped up due to the order of package installation. 
> > 
> > So my "fix" would work for the user problem but not the group problem so I
> > guess I have to duplicate the script for the common package as well.
> 
> Well, why to duplicate, please only create the user in -common. both
> -frontend and -backend requires it anyway.

I'll have to dig deeper but if it's only in the common package and the backend or frontend get installed first then we'll still run into the same problem.

Would moving the script to %pretrans guarantee it runs before any packages are installed?
Comment 6 Nicolas Chauvet 2017-01-17 16:58:01 CET
(In reply to Richard from comment #5)
...
> I'll have to dig deeper but if it's only in the common package and the
> backend or frontend get installed first then we'll still run into the same
> problem.
Then you might need to add
Requires(pre): mythtv-common
instead of
Requires: mythtv-common
Comment 7 Richard 2017-01-17 18:19:07 CET
Ok, looking at how Require works[1]:

"A plain Requires is enough to ensure proper installation order if there are no dependency loops present in the transaction."

As the frontend and backend both require the common package simply moving user and group creation to the common package should be sufficient.

[1] http://rpm.org/max-rpm-snapshot/s1-rpm-depend-manual-dependencies.html
Comment 8 Richard 2017-03-05 19:47:53 CET
I believe this is fixed at this point?
Comment 9 Richard 2017-03-14 16:38:05 CET
* Sun Jan 22 2017 Richard Shaw <hobbes1069@gmail.com> - 0.28-12
- Update to latest fixes/0.28 from git.
- Remove SysV conditionals as EL 7 has systemd and EL 6 is not supported.
- Update default permissions for /etc/mythtv and move user/group creation
  to the common package, fixes RFBZ#4414.
- Change some dependencies from Requires to Recommends, fixes RFBZ#4415.