[Unit] Description=UPnP MediaServer After=network-online.target network.target [Service] Type=forking EnvironmentFile=/etc/default/mediatomb PIDFile=/run/mediatomb.pid Environment="MT_INTERFACE=lo" "MT_PORT=50500" "MT_USER=mediatomb" "MT_GROUP=mediatomb" "MT_LOGFILE=/var/log/mediatomb.log" "MT_HOME=/etc" "MT_CFGDIR=mediatomb" ExecStartPre=-/sbin/route add -net 239.0.0.0 netmask 255.0.0.0 $MT_INTERFACE ExecStartPre=-/sbin/ifconfig $MT_INTERFACE allmulti ExecStart=/usr/bin/mediatomb -d -u $MT_USER -g $MT_GROUP -P /run/mediatomb.pid -l $MT_LOGFILE -m $MT_HOME -f $MT_CFGDIR -p $MT_PORT -e $MT_INTERFACE ExecStopPost=-/sbin/route del -net 239.0.0.0 netmask 255.0.0.0 $MT_INTERFACE ExecStopPost=-/sbin/ifconfig $MT_INTERFACE -allmulti ExecReload=/bin/kill -HUP $MAINPID [Install] WantedBy=multi-user.target