[mythtv-users] Autostart MythTV on Raspberry Pi 3

Greg Oliver oliver.greg at gmail.com
Sun Oct 15 22:49:27 UTC 2017


On Sun, Oct 15, 2017 at 3:31 PM, Rajil Saraswat <rajil.s at gmail.com> wrote:

> On 10/15/2017 11:42 AM, Rajil Saraswat wrote:
> > On 10/15/2017 03:55 AM, Jeff wrote:
> >> I've just documented my setup here:
> >>
> >> https://www.mythtv.org/wiki/Raspberry_Pi#Autostart_MythTV_on_boot
> >>
> >> Regards
> >>
> >> Jeff
> > I believe there are some shortcomings of this approach compared to
> > .xinitrc  which i use on my desktop documented here
> > https://dev.gentoo.org/~cardoe/mythtv/autostart.html
> >
> > a) If frontend crashes, it will not respawn the frontend again. Also, if
> > i do an 'Exit Mythtv' in the frontend, it will not restart the frontend.
> > b) I have  autologin-user=pi set in /etc/lightdm.conf so on first-boot
> > it autologs me in. However, if X dies (say killall Xorg), then it doesnt
> > autologin instead shows up the login/passwd input box.
> >
> > It is not idiot proof yet :)
> >
> > Any comments?
> >
> > Thanks
>
> I decided to use console based auto-login instead of graphics login.
> Enabled autologin first using:
>
> systemctl set-default multi-user.target
> sed /etc/systemd/system/autologin at .service -i -e
> "s#^ExecStart=-/sbin/agetty --autologin
> [^[:space:]]*#ExecStart=-/sbin/agetty --autologin pi#"
> ln -fs /etc/systemd/system/autologin at .service
> /etc/systemd/system/getty.target.wants/getty at tty1.service
>
> and then followed the instructions below. You need to replace tty8 with
> tty1 for RPI.
>
> https://dev.gentoo.org/~cardoe/mythtv/autostart.html
>
>
I opted to go with ratpoison since I will never run anything on a local TV
except Myth, so no heavy GUI needed.

cat .xinitrc
# The black/white grid as background doesn't suit my taste.
xsetroot -solid black &
exec /usr/bin/ratpoison

cat .ratpoisonrc
exec xset -dpms
exec xset s off
exec while true ; do mythfrontend >/home/greg/mythfrontend.log 2>&1 ; sleep
5; done

cat /etc/systemd/system/getty at tty1.service.d/override.conf
[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin greg --noclear %I \$TERM

I have a button mapped with irexec that `kills` mythfrontend if I need it
to.  It starts right back up because of the while loop in ratpoison..

Of course if you ever need to debug mythfrontend (I do it on another
machine), you need to obviously change the bottom line..

-Greg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20171015/f7b2585d/attachment.html>


More information about the mythtv-users mailing list