MythTV creates files in /home even if mount /home fails

Bug #326702 reported by Will Uther on 2009-02-07
26
This bug affects 3 people
Affects Status Importance Assigned to Milestone
mythtv (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: mythtv-backend

I've been having some difficulty with the filesystem I'm using for /home. This means that that filesystem has occasionally failed to mount. This is annoying, but it interacts with /etc/init.d/mythtv-backend in a bad way too...

If /home doesn't mount, the mythtv-backend startup script runs anyway. And that startup script, on line 51, does this:

mkdir -p $USER_HOME/.mythtv

which, because of the -p option, creates files in /home even if $USER_HOME doesn't exist (because the mount failed).

This causes all future attempts to mount /home to fail! (until the newly created files are removed.)

Might I suggest that the '-p' option here be removed. If $USER_HOME exists, this will still create the .mythtv directory, but if /home isn't mounted then nothing bogus will be created.

This is on jaunty with mythtv-backend version 0.21.0+fixes19556-0ubuntu6

Related branches

description: updated

Perhaps a check to see if $USER_HOME exists first is better. If it doesn't
exist, then abort the init script. Worse things can happen if that home
directory isn't around I think.

On Sat, Feb 7, 2009 at 16:24, Will Uther <<email address hidden>
> wrote:

> Public bug reported:
>
> Binary package hint: mythtv-backend
>
> I've been having some difficulty with the filesystem I'm using for
> /home. This means that that filesystem has occasionally failed to
> mount. This is annoying, but it interacts with /etc/init.d/mythtv-
> backend in a bad way too...
>
> If /home doesn't mount, the mythtv-backend startup script runs anyway.
> And that startup script, on line 51, does this:
>
> mkdir -p $USER_HOME/.mythtv
>
> which, because of the -p option, creates files in /home even if
> $USER_HOME doesn't exist (because the mount failed).
>
> This causes all future attempts to mount /home to fail! (until the
> newly created files are removed.)
>
> Might I suggest that the '-p' option here be removed. If $USER_HOME
> exists, this will still create the .mythtv directory, but if /home isn't
> mounted then nothing bogus will be created.
>
> This is on jaunty with mythtv-backend version 0.21.0+fixes19556-0ubuntu6
>
> ** Affects: mythtv (Ubuntu)
> Importance: Undecided
> Status: New
>
> ** Description changed:
>
> Binary package hint: mythtv-backend
>
> I've been having some difficulty with the filesystem I'm using for
> /home. This means that that filesystem has occasionally failed to
> mount. This is annoying, but it interacts with /etc/init.d/mythtv-
> backend in a bad way too...
>
> If /home doesn't mount, the mythtv-backend startup script runs anyway.
> And that startup script, on line 51, does this:
>
> mkdir -p $USER_HOME/.mythtv
>
> which, because of the -p option, creates files in /home even if
> $USER_HOME doesn't exist (because the mount failed).
>
> This causes all future attempts to mount /home to fail! (until the
> newly created files are removed.)
>
> Might I suggest that the '-p' option here be removed. If $USER_HOME
> exists, this will still create the .mythtv directory, but if /home isn't
> mounted then nothing bogus will be created.
> +
> + This is on jaunty with mythtv-backend version 0.21.0+fixes19556-0ubuntu6
>
> --
> MythTV creates files in /home even if mount /home fails
> https://bugs.launchpad.net/bugs/326702
> You received this bug notification because you are a member of MythTV
> Ubuntu Maintainers, which is subscribed to mythtv in ubuntu.
>

--
Mario Limonciello
<email address hidden>

Will Uther (willu-mailinglists) wrote :

That sounds reasonable.

Something like this:

if [ ! -d $USER_HOME ]; then
 log_failure_msg "MythTV home directory, $USER_HOME, does not exist!"
 exit 1
fi

#create a symbolic link for mysql.txt so it can't be overwritten
if [ ! -e $USER_HOME/.mythtv/mysql.txt ]; then
    mkdir -p $USER_HOME/.mythtv
    chown -R $USER $USER_HOME/.mythtv
    ln -s /etc/mythtv/mysql.txt $USER_HOME/.mythtv/mysql.txt
fi

Changed in mythtv:
status: New → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mythtv - 0.21.0+fixes19961-0ubuntu1

---------------
mythtv (0.21.0+fixes19961-0ubuntu1) jaunty; urgency=low

  [ John Baab ]
  * Fixes missing config.xml issue (LP: #220604)

  [ Mario Limonciello ]
  * Check whether $USER_HOME exists in mythtv-backend init
    script before continuing on. Thanks Will Uther. (LP: #326702)
  * Update branch to release-0-21-fixes rev #19961. Pulls in
    fix related to channel scanning and setting number correctly. (LP: #323769)

 -- Mario Limonciello <email address hidden> Mon, 09 Feb 2009 08:49:29 -0600

Changed in mythtv:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers