Ubuntu 18.04 Run at Start

Post any problems / bugs / issues that are Mylar-related in here.
Post Reply
User avatar
MIghtyThor460
Posts: 32
Joined: Mon Apr 20, 2015 1:26 pm

Ubuntu 18.04 Run at Start

Post by MIghtyThor460 »

Hi all,

I followed the instructions to set up the systemd service:
Instructions on setting up mylar as a systemd serivce that will run on startup/via systemctl commands...

1 - copy the mylar.service to /lib/systemd/system/mylar.service
2 - create a symbolic link to it: ln -s /lib/systemd/system/mylar.service /etc/systemd/system/mylar.service
3 - copy mylar.default to /etc/default/mylar (make sure it's renamed from mylar.default to just mylar)
4 - copy mylar.initd to /etc/init.d/mylar (rename it to just mylar) and then 'sudo chmod +x /etc/init.d/mylar'
5 - edit the /etc/default/mylar file to your defaults (make sure to set MYLAR_USER & MYLAR_HOME as they're required)
6 - make systemd aware of new services: sudo sytemctl daemon-reload
7 - sudo systemctl enable mylar
8 - sudo systemctl start mylar
9 - to check to see if running/status - sudo sytemctl status mylar
When I do this and try to enable the service I get the following error:
Synchronizing: command not found
root@Jarvis:/home/sean# Executing: /lib/systemd/systemd-sysv-install enable mylar
Executing:: command not found
root@Jarvis:/home/sean# update-rc.d: error: mylar Default-Start contains no runlevels, aborting
Any thoughts on how to fix this?

Thank you!
User avatar
evilhero
Site Admin
Posts: 2883
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Ubuntu 18.04 Run at Start

Post by evilhero »

I think the init.d script is messed up (I don't run Ubuntu 18), but something looks abit off with it.

Go here and paste the mylar.init.d into your init.d (ie. use the one in the link instead of what you have). Then try to enable mylar again and see if that helps.
User avatar
MIghtyThor460
Posts: 32
Joined: Mon Apr 20, 2015 1:26 pm

Re: Ubuntu 18.04 Run at Start

Post by MIghtyThor460 »

That did the trick!

Thank you!
User avatar
MIghtyThor460
Posts: 32
Joined: Mon Apr 20, 2015 1:26 pm

Re: Ubuntu 18.04 Run at Start

Post by MIghtyThor460 »

I hate to resurrect this but after moving to a new server I've suddenly run into a new problem.

I can manually start Mylar without issue with the
python /opt/Mylar/Mylar.py -d
command.

But, if I follow the steps in the read.me file to create the auto start I am greeted with this error:
Jan 29 18:15:45 Jarvis systemd[1]: Starting starts instance of Mylar...
Jan 29 18:15:45 Jarvis mylar[8723]: * Starting mylar
Jan 29 18:15:45 Jarvis mylar[8723]: /usr/bin/python: can't open file 'Mylar.py': [Errno 2] No such file or directory
Jan 29 18:15:45 Jarvis mylar[8723]: ...fail!
Jan 29 18:15:45 Jarvis systemd[1]: mylar.service: Control process exited, code=exited status=1
Jan 29 18:15:45 Jarvis systemd[1]: mylar.service: Failed with result 'exit-code'.
Jan 29 18:15:45 Jarvis systemd[1]: Failed to start starts instance of Mylar.
Do I need to manually create that directory or did something go sideways in my install?
User avatar
MIghtyThor460
Posts: 32
Joined: Mon Apr 20, 2015 1:26 pm

Re: Ubuntu 18.04 Run at Start

Post by MIghtyThor460 »

I figured it out.

It was due to a capitalization issue in the directory. The default is /opt/mylar but for whatever reason mine is /opt/Mylar.
Post Reply