Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 763132 - media-tv/mythtv-31.0-r5 destroys /dev/null
Summary: media-tv/mythtv-31.0-r5 destroys /dev/null
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High critical (vote)
Assignee: Wilson M. Michaels
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-01-02 15:08 UTC by Frank Noack
Modified: 2021-02-10 22:06 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Noack 2021-01-02 15:08:35 UTC
If mythtv is installed the following lines destroy my /dev/null

--- replaced obj /etc/conf.d/mythfrontend
--- replaced obj /etc/conf.d/mythbackend
--- replaced dir /etc/conf.d
--- replaced dir /etc
--- replaced obj /dev/null/.xinitrc
--- replaced obj /dev/null/.bash_profile
--- replaced dir /dev/null
--- replaced dir /dev
/usr/lib/portage/python3.8/ebuild.sh: line 11: /dev/null: Is a directory
/usr/lib/portage/python3.8/phase-functions.sh: line 895: /dev/null: Is a directory
/usr/lib/portage/python3.8/phase-functions.sh: line 897: /dev/null: Is a directory
/usr/lib/portage/python3.8/phase-functions.sh: line 899: /dev/null: Is a directory
/usr/lib/portage/python3.8/phase-functions.sh: line 901: /dev/null: Is a directory
/usr/lib/portage/python3.8/phase-functions.sh: line 903: /dev/null: Is a directory
/usr/lib/portage/python3.8/phase-functions.sh: line 905: /dev/null: Is a directory
Comment 1 Wilson M. Michaels 2021-01-02 16:38:18 UTC
It appears that the home directory for the user "mythtv" is /dev/null.  It must be a real directory. I'll work on a fix to check for this and die instead of breaking ebuild.sh
Comment 2 Wilson M. Michaels 2021-01-02 16:51:43 UTC
It appears that the mythtv user was not created by acct-user/mythtv. It is not modified if it already exists.

The gentoo standard mythtv home directory is /var/lib/mythtv.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-01-02 16:55:30 UTC
(In reply to Wilson M. Michaels from comment #2)
> It appears that the mythtv user was not created by acct-user/mythtv. It is
> not modified if it already exists.

Actually, the eclass functions do modify the homedir.

@Frank, what version of acct-user/mythtv do you have installed?
Comment 4 Frank Noack 2021-01-02 17:25:05 UTC
I use the stable version acct-user/mythtv-0-r1. I have updated from mythtv-29.1-r1 which worked properly.
Comment 5 Wilson M. Michaels 2021-01-02 18:52:02 UTC
@Frank, what does "grep -i mythtv /etc/passwd" show?
Comment 6 Frank Noack 2021-01-02 19:47:26 UTC
mythtv:x:105:117:Mythtv mythbackend server/daemon user:/dev/null:/bin/bash
Comment 7 Wilson M. Michaels 2021-01-02 22:40:56 UTC
A fix for this bug is to modify the user home directory to /var/lib/mythtv.

A work around is to not set the autostart USE flag.
Comment 8 Frank Noack 2021-01-03 08:41:20 UTC
Until now I have used /home/mythtv as directory for my files.
Comment 9 Frank Noack 2021-01-03 09:05:00 UTC
Now I have changed home directory in mythtv-setup to /var/lib/mythtv and recreated /dev/null. A new emerge brought this error:

--- /lib/
--- /lib/systemd/
--- /lib/systemd/system/
>>> /lib/systemd/system/mythbackend.service
--- /var/
--- /var/log/
--- /var/log/mythtv/
>>> /var/log/mythtv/.keep_media-tv_mythtv-0
--- /dev/
 * 
 * Installation of a directory is blocked by a file:
 *   '/dev/null'
 * This file will be renamed to a different name:
 *   '/dev/null.backup.0001'
 * 
bak /dev/null /dev/null.backup
>>> /dev/null/
>>> /dev/null/.bash_profile
>>> /dev/null/.xinitrc
>>> Safely unmerging already-installed instance...
/usr/lib/portage/python3.8/ebuild.sh: line 11: /dev/null: Is a directory
/usr/lib/portage/python3.8/phase-functions.sh: line 895: /dev/null: Is a directory
/usr/lib/portage/python3.8/phase-functions.sh: line 897: /dev/null: Is a directory
/usr/lib/portage/python3.8/phase-functions.sh: line 899: /dev/null: Is a directory
Comment 10 Wilson M. Michaels 2021-01-03 15:39:36 UTC
/dev/null is a virtual file created by linux. It should not be are real file so remove what you have and recreate it.

rm -r /dev/null
mknod /dev/null c 1 3
chmod 666 /dev/null
Comment 11 Wilson M. Michaels 2021-01-03 16:11:01 UTC
(In reply to Frank Noack from comment #8)
> Until now I have used /home/mythtv as directory for my files.

I did this for years myself and managed to make it work for a long time. Today best practice is to use a different user for mythfrontend and use mythtv only for the mythbackend server. This is quite flexible when you have multiple displays in different rooms connected to the same linux box as I do.
Comment 12 Wilson M. Michaels 2021-01-03 16:37:21 UTC
(In reply to Frank Noack from comment #9)
> Now I have changed home directory in mythtv-setup to /var/lib/mythtv and
> recreated /dev/null. A new emerge brought this error:

Change the home directory of user mythtv to something other than /dev/null.
For example, as root:

usermod -d /var/lib/mythtv mythtv

Then try the emerge again after fixing /dev/null (Comment #10)
Comment 13 Frank Noack 2021-01-03 20:50:03 UTC
This was the relevant clue. It was the wrong owner of the directory. Maybe this should be checked by emerge.Thanks
Comment 14 Wilson M. Michaels 2021-01-04 14:40:33 UTC
(In reply to Frank Noack from comment #13)
> This was the relevant clue. It was the wrong owner of the directory. Maybe
> this should be checked by emerge.Thanks

When user is created by acct-user/mythtv it gets correct owner and permissions and groups. In your case the user already exists so gentoo left the home directory alone. There is currently a discussion on gentoo-dev list about how gentoo acct-user.eclass should handle an existing user when updating.

When gentoo copies the staged files into you system to install a package, it creates any directory structure it needs. That is how /dev/null got broken.
Comment 15 Tom Dexter 2021-02-10 22:06:05 UTC
Can someone clarify where this stands? I'm looking to update from 29.1 but this one scares the hell out of me.

This would be an update as I said, and my mythtv user exists with a home of /home/mythtv, and no way do I want that to change. What exactly is the behavior with updating when the mythtv user already exists? Thanks!