[mythtv-users] mythbackend won't start during bootup on fc16

Richard Shaw hobbes1069 at gmail.com
Fri May 18 15:21:05 UTC 2012


On Tue, May 8, 2012 at 10:31 PM, R. G. Newbury <newbury at mandamus.org> wrote:
> ################################################
> # /usr/local/bin/pre-start.sh
>  #!/bin/bash
>
> # Sanity check on existence of required user
> # Needed after bare-metal install and worth checking otherwise
> # DEFAULT user and password: fix mysql if changed!
> # should match config.xml (and mysql.txt)
>
> USERNAME="mythtv"
> PASSWORD="mythtv"
>
> # Non-usual home for mythtv user
> export HOME=/var/log/mythtv
> export MYTHTV_HOME=/var/log/mythtv
>
> # UTF encoding needed by myth
> export LC_ALL=en_US.UTF-8
>
> # Check for user, create if missing, create HOME too
> RESULT=""
> # if user exists, will be in /etc/passwd file
> RESULT=`grep "$USERNAME" /etc/passwd`;
> if [ "$RESULT" == ""  ]; then
>     #  echo "Mythtv user not found, user account will be created"
>     useradd -m -d "$HOME" -G mysql -p "$PASSWORD" -U "$USERNAME" 2&>1;
>  else
>     echo ""    # acts as a NOP for the else branch
>     #  echo "Mythtv user found, no action taken"  # testing only
> fi

I would also add the user to the audio and video groups. This can be
necessary to access sound and video devices when running as a user
other than root. Since this should be checked even if the user does
exist and it's pretty safe, I would just run this evey time (outside
of the conditional):

usermod -a -G audio,video mythtv

Richard


More information about the mythtv-users mailing list