<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Oct 5, 2017 at 10:31 AM, Darac Marjal <span dir="ltr"><<a href="mailto:mailinglist@darac.org.uk" target="_blank">mailinglist@darac.org.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Oct 05, 2017 at 07:57:45AM -0500, Richard Shaw wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
  On Thu, Oct 5, 2017 at 3:44 AM, Darac Marjal <[1]<a href="mailto:mailinglist@darac.org.uk" target="_blank">mailinglist@darac.org.uk</a>> wrote:<br>
<br>
    The following should be a suitable start:<br>
<br>
            [Unit]<br>
            Description=the open source DVR, MythTV<br>
            After=graphical-session.target<br>
            BindsTo=graphical-session.targ<wbr>et<br>
<br>
            [Service]<br>
            Environment=DISPLAY=%i<br>
            ExecStart=/usr/bin/mythfronten<wbr>d<br>
<br>
            [Install]<br>
            WantedBy=graphical-session.tar<wbr>get<br>
<br>
    This should start mythtv when you log in (WantedBy) and kill mythtv when you log out (BindsTo). Save this as<br>
    /etc/systemd/system/mythtv@.se<wbr>rvice, then run "systemctl enable mythtv@:0.service" for display :0.<br>
<br></span>
    All information cadged from [2]<a href="https://bitbucket.org/KaiSforza/systemd-user-units/wiki/X-Applications" rel="noreferrer" target="_blank">https://bitbucket.org/KaiSf<wbr>orza/systemd-user-units/wiki/<wbr>X-Applications</a><span class=""><br>
<br>
  That's pretty cool but I have two questions...<br>
  This will start mythfrontend for ALL users, not just a specific one right? <br>
  I have a "mythuser" login and use the session preferences to start the frontend which always works for me so luckily I don't<br>
  have this problem... I wouldn't want mythfrontend to load if I login as another user...<br>
</span></blockquote>
<br>
Good point. Save the file to ~/.config/systemd/user/mythtv@<wbr>.service<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  Wouldn't you want to add mythbackend to the "After" command? I know there's still issues with it not necessarily being ready<br>
  to accept connections even if systemd thinks it's up, but it could help.<br>
</blockquote>
<br></span>
Yes. After mythbackend probably makes more sense than after mysql, as mythbackend probably won't come ready until it has access to the database.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  Thanks,<br>
  Richard<br>
<br>
References<br>
<br>
  Visible links<br>
  1. mailto:<a href="mailto:mailinglist@darac.org.uk" target="_blank">mailinglist@darac.org.u<wbr>k</a><br>
  2. <a href="https://bitbucket.org/KaiSforza/systemd-user-units/wiki/X-Applications" rel="noreferrer" target="_blank">https://bitbucket.org/KaiSforz<wbr>a/systemd-user-units/wiki/X-<wbr>Applications</a></blockquote></blockquote><div><br></div><div>So how do you say after mythbackend? Is it mythbackend.service?</div></div><br></div></div>