Help starting Mylar Comics at boot with systemd

Hi OSMC,

I have been trying to start mylar comics at boot but haven’t been able to.

$ sudo service mylar status

mylar.service - Mylar
Loaded: loaded (/etc/systemd/system/mylar.service; enabled; vendor preset: enabled)
Active: failed (Result: timeout) since Sun 2018-01-14 03:09:23 -03; 3s ago
Process: 378 ExecStart=/home/osmc/.pyenv/versions/2.7.11/bin/python /opt/Mylar/Mylar.py --daemon --datadir=/opt/Mylar/ --config=/opt/Mylar/config.ini --q

Jan 15 03:07:39 osmc systemd[1]: Starting Mylar…
Jan 15 03:09:23 osmc systemd[1]: mylar.service: Start operation timed out. Terminating.
Jan 15 03:09:23 osmc systemd[1]: Failed to start Mylar.
Jan 15 03:09:23 osmc systemd[1]: mylar.service: Unit entered failed state.
Jan 15 03:09:23 osmc systemd[1]: mylar.service: Failed with result ‘timeout’.

I can successfully start the daemon running sudo systemctl restart mylar

Here’s my config file:

[Unit]
Description=Mylar
After=network.target

[Service]
ExecStart=/home/osmc/.pyenv/versions/2.7.11/bin/python /opt/Mylar/Mylar.py --daemon --datadir=/opt/Mylar/ --config=/opt/Mylar/config.ini --quiet --nolaunch
GuessMainPID=no
GuessMainPID=no
Type=forking
User=osmc
Group=osmc

[Install]
WantedBy=multi-user.target

If someone here that understands systemd could provide me some help, please chime in.

I’m not real good with systemd, but the way you are starting the script seems odd.
Are you using a virtual Python environment? Why don’t you just call /usr/bin/python2

(As a side note, the current version of python is 2.7.13 with the Dec update.)

Thanks for replying.

The reason I am using it is that two years ago when I first setup mylar on OSMC I had to. It only worked running python 2.7.x…

Oddly, if I change to /usr/bin/python2 it fails. Even running it manually.

I’m stuck.

You should contact the developers of Mylar then.

When you say fails when running manually, do you mean running the command (not systemctl start or restart)? If it fails running the command with python2 from the command line the errors you got could he helpful!!