[Solved] Running Mythfrontend at Login

For discussion of topics specific to MythTV on linux
Post Reply
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

[Solved] Running Mythfrontend at Login

Post by kbocek »

Rebuilding a 0.39 frontend on Ubuntu 18.04. All the mythfrontend files are installed from PPA.

Figured out the GDM3 autologin to the mythtv user. Now how the heck do I get mythfrontend to auto-run at login? All my old methods aren't working.

Thanks for the help.
jfbauer
Newcomer
Posts: 13
Joined: Tue Jul 26, 2022 11:43 pm
United States of America

Re: Running Mythfrontend at Login

Post by jfbauer »

Search for "Startup Applications", run that, select add
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: Running Mythfrontend at Login

Post by kbocek »

Thanks for the help jfbauer but I'm looking the command line answer. In my other frontend I do basic X configuration through /home/mythtv/.xsession. But for some reason it isn't being read in this default installation of Ubuntu 18. Is this some GDM3 magic I am not aware of? Is there something to be done to enable .xsession?
jfbauer
Newcomer
Posts: 13
Joined: Tue Jul 26, 2022 11:43 pm
United States of America

Re: Running Mythfrontend at Login

Post by jfbauer »

I am sure, but you could try ~/.Xclients instead of .xsession.
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: Running Mythfrontend at Login

Post by kbocek »

jfbauer wrote:
Mon Jan 23, 2023 12:35 am
I am sure, but you could try ~/.Xclients instead of .xsession.
Nope. .Xclients does not do it.

I can't seem to figure out how to auto-run mythfrontend under GDM3.

So https://www.mythtv.org/wiki/Frontend_Au ... _Autostart Says .gnomerc. I've got that. Just the way the wiki says. But it's still not running.
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: Running Mythfrontend at Login

Post by kbocek »

So this is an old Ubuntu bug:

https://bugs.launchpad.net/ubuntu/+sour ... ug/1895781

There is a workaround in the bug post to get .gnomerc to be read
white_haired_uncle
Senior
Posts: 244
Joined: Thu Feb 23, 2023 8:55 pm
Location: Safe outside my gilded cage
United States of America

Re: Running Mythfrontend at Login

Post by white_haired_uncle »

I had autologin working and launching mythfrontend on Ubuntu 22.04, but I'm pretty resource constrained and it was running a bunch of additional stuff I didn't need (like processes to support an email client I don't use, on a machine without internet access, that's used ONLY as a frontend). I tried switching to a light-weight window manager, but it wouldn't take. I tried masking services with systemctl, even removing execute permissions, and something just kept undoing my changes.

I don't mind fighting with an unfamiliar desktop manager, but when it starts fighting back, we're done. Time to step outside. Let's see how you like runlevel 3.

Code: Select all

#switch to default runlevel 3
$ sudo systemctl set-default multi-user.target

# setup mythtv for automatic login on tty1
$ sudo EDITOR=vi systemctl edit getty@tty1.service

### Editing /etc/systemd/system/getty@tty1.service.d/override.conf
### Anything between here and the comment below will become the new contents of the file

[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin mythtv --noclear %I $TERM /usr/bin/startx

### Lines below this comment will be discarded
...


# yeah, that blank ExecStart= line is actually necessary

# set ksh to start X on tty1 (probably .bashrc for most people)
$ cat .kshrc
...
if [ "`tty`" == "/dev/tty1" ]; then
  /usr/bin/startx
fi

# set X to run mythfrontend
$ cat ~/.xsession
#!/bin/sh
if [ -x $HOME/.xinitrc ]
    then exec $HOME/.xinitrc
    else exec xterm -geometry 80x24+0-60 -ls
fi
$ cat ~/.xinitrc
/usr/bin/icewm &
/usr/bin/mythfrontend
$ chmod 755 ~/.xsession ~/.xinitrc

# Reboot, just for good measure
Not the most elegant solution in the world, but it just works.

[EDIT: Added icewm. Turns out you need a window manager when using an external video player (at least if you want to pass keyboard input to it). Tried ratpoison, but it made my screen blink when playing AV1 files].

[EDIT: Making the switch to Devuan, which has NO SYSTEMD! I didn't install a desktop environment, so it defaulted to runlevel 2, which is cool. Both this, and the agetty entry for autologin are handled in /etc/inittab: ]

Code: Select all

# The default runlevel.
id:2:initdefault:

#1:2345:respawn:/sbin/getty --noclear 38400 tty1
1:2345:respawn:/sbin/agetty --autologin mythtv --noclear 38400 tty1
Last edited by white_haired_uncle on Thu Oct 19, 2023 7:28 pm, edited 2 times in total.
User avatar
bill6502
Developer
Posts: 2299
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Running Mythfrontend at Login

Post by bill6502 »

@kbocek: Something like this (what I use): systemctl edit --user --force --full mythtv-frontend.service
and add:

Code: Select all

[Unit]
Description=MythTV Frontend
Wants=mythtv-backend.service
After=mythtv-backend.service graphical-session.target

[Service]
Environment=XDG_SESSION_TYPE=
ExecStart=/usr/local/bin/mythfrontend --loglevel warning --jumppoint 'TV Recording Playback' --systemd-journal
Type=notify

[Install]
WantedBy=graphical-session.target
Starts the FE after I login to the GUI. Modify the mythfrontned command switches to your liking.
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: Running Mythfrontend at Login

Post by kbocek »

So I finally just moved to nodm as documented in the wiki. Reads .xsession just fine and loads the frontend.

New issue though. I've got my remote configured and it is reading button presses just fine. But when I'm in the frontend a single press seems to repeat endlessly. Eventually the frontend locks up.

Any thoughts on what might be causing that?

I see notes here but no fix:
viewtopic.php?t=4426

The fix is said to be to change the kernel. I have tried changing to 5.8.0 and 5.8.18. The repeating keys problem does not go away. So again, anyone have any ideas?

====================
Edit:

I discovered lircd was running in the background. I stopped and disabled lircd and the issue was resolved.
Post Reply