[mythtv-users] Who's running Myth on Arch, and what do you think?

R. G. Newbury newbury at mandamus.org
Sat Nov 23 21:42:34 UTC 2013


On 11/22/2013 01:35 PM, Larry Finger wrote:
> I certainly do not want to contribute to any part of starting another
> flame war on systemd, and will keep any editorial comments to myself.
> Are the systemd service files for mythbackend and mysql available
> somewhere? I just upgraded my mythtv host to use systemd, and I'm stuck
> with a real kluge for getting those two started. Thus far, searches have
> not shown me any candidates.

There is no doubt that systemd is *different*. And early versions had 
some ,,, quirks. But when set up properly, it boots FAST and provides 
much more granularity and control of what runs. Unfortunately, like 
pulse it is hard to find good information about how it works. And yes, I 
hated it when I first installed Fedora 17. Now, not so much.

I have been using this mythbackend.service for about a year and a half. 
It works quite well.
###############################################
[Unit]
Description=MythTV backend service
Wants=httpd.service
After=network.target mysqld.service

[Service]
Type=forking
#PIDFile=/var/log/mythtv/backend.pid   : cannot use this line here: not 
allowed in [Service]
Environment=MYTHCONFDIR=/var/log/mythtv
Environment=HOME=/var/log/mythtv
Environment=MYTHBACKEND_USER=mythtv
User=mythtv
ExecStartPre=/usr/local/sbin/pre-start.sh
# note logging turned off
ExecStart=/usr/local/bin/mythbackend --daemon --noupnp --loglevel emerg 
--logpath /var/log/mythtv --pidfile /var/log/mythtv/backend.pid

[Install]
WantedBy=multi-user.target
##########################################

##########################################
#!/bin/bash
# pre-start.sh script for systemd (replacing /etc/init.d/mythbackend)
# DEFAULT user and password: fix mysql if changed!
USERNAME="mythtv"
PASSWORD="mythtv"
export HOME=/var/log/mythtv
export MYTHTV_HOME=/var/log/mythtv
export LC_ALL=en_US.UTF-8
# Required sanity check on required folders
if [ -f /var/log/mythtv ]; then
   rm -f /var/log/mythtv
fi
mkdir -p -m 755 /var/log/mythtv
chmod 666 /var/log/mythtv/*
chown -hR mythtv:mythtv /var/log/mythtv
# An 'is-running' check used to be performed by the old sysinit script
# Instead we will kill any running process.
if [ -e /var/log/mythtv/backend.pid ]; then
     systemctl stop mythbackend.service
     sleep 1
     sudo killall mythbackend 2&>1
     sudo killall mythlogserver 2&>1
     rm -f /var/log/mythtv/backend.pid
fi
################################################

The service files for mysql should be installed when you install mysql.

Geoff


              R. Geoffrey Newbury			
            Mandamus Publishing Inc.
       Suite 106, 150 Lakeshore Road West
          Mississauga, Ontario, L5H 3R2

               www.mandamus.ca

         t416-479-0930 f905-271-1638
               rgn at mandamus.ca


More information about the mythtv-users mailing list