How can I setup Ombi to run as a startup service ? Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
LeVraiRoiDHyrule
Posts: 55
Joined: Tue Apr 28, 2020 3:00 pm

How can I setup Ombi to run as a startup service ?

Post by LeVraiRoiDHyrule »

Hi,

I am planning to use Ombi for my Jellyfin server. https://github.com/Ombi-app/Ombi

I tried using this guide https://www.dexterindustries.com/howto/ ... t-startup/
to setup Ombi as a startup service and to manage it with systemctl start/stop.

I successfully created the ombi.service file in /lib/systemd/system that contains :

[Unit]
Description=Ombi
After=network.target

[Service]
ExecStart=/mnt/dietpi_userdata/ombi/Ombi
StandardOutput=inherit
StandardError=inherit
Restart=always
User=pi

[Install]
WantedBy=multi-user.target


I correctly updated the systemctl process. But even with that, Ombi still doesn't launch at startup and isn't turn on/off with systemctl commands. Am I doing something wrong ? All guides are telling me the same method.

Thanks in advance for any answer,
Have a great day
User avatar
Joulinar
Posts: 5149
Joined: Sat Nov 16, 2019 12:49 am

Re: How can I setup Ombi to run as a startup service ?

Post by Joulinar »

do you have created a User=pi on your system? usually it is not present by default
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
LeVraiRoiDHyrule
Posts: 55
Joined: Tue Apr 28, 2020 3:00 pm

Re: How can I setup Ombi to run as a startup service ?

Post by LeVraiRoiDHyrule »

You're right, I didn't notice this.

I changed it to the "dietpi" user as this one already exists.

But even with that and reloading the systemctl process, it still doesn't command the program
User avatar
Joulinar
Posts: 5149
Joined: Sat Nov 16, 2019 12:49 am

Re: How can I setup Ombi to run as a startup service ?

Post by Joulinar »

how is it behaving if you change to user root for testing.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
LeVraiRoiDHyrule
Posts: 55
Joined: Tue Apr 28, 2020 3:00 pm

Re: How can I setup Ombi to run as a startup service ?

Post by LeVraiRoiDHyrule »

It still doesn't launch the program when changing it to root.

What's strange is that when I try to exexute a systemctl start ombi, it immediatly exexutes the command. Normally, it takes 1-2 secs to launch a program with this, before being able to enter another command.

I can confirm Ombi can be correctly executed when going to its folder with cd then ./
User avatar
Joulinar
Posts: 5149
Joined: Sat Nov 16, 2019 12:49 am

Re: How can I setup Ombi to run as a startup service ?

Post by Joulinar »

does it start if you run /mnt/dietpi_userdata/ombi/Ombi
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
LeVraiRoiDHyrule
Posts: 55
Joined: Tue Apr 28, 2020 3:00 pm

Re: How can I setup Ombi to run as a startup service ?

Post by LeVraiRoiDHyrule »

Yes, it is working if I go to the folder with cd /mnt/dietpi_userdata/ombi/ then if I do ./Ombi
User avatar
Joulinar
Posts: 5149
Joined: Sat Nov 16, 2019 12:49 am

Re: How can I setup Ombi to run as a startup service ?

Post by Joulinar »

btw why are you trying to create the service yourself?

I simply installed the apt package as described on ombi docs and it will create a service directly

https://docs.ombi.app/guides/installati ... n-apt-repo

Code: Select all

root@DietPi4:~# systemctl status ombi
● ombi.service - Ombi - PMS Requests System
   Loaded: loaded (/lib/systemd/system/ombi.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2021-02-08 21:46:03 CET; 86ms ago
 Main PID: 3004 (Ombi)
    Tasks: 6 (limit: 4915)
   CGroup: /system.slice/ombi.service
           └─3004 /opt/Ombi/Ombi --storage /etc/Ombi/

Feb 08 21:46:03 DietPi4 systemd[1]: Started Ombi - PMS Requests System.
root@DietPi4:~#
That's how service file /lib/systemd/system/ombi.service looks like

Code: Select all

[Unit]
Description=Ombi - PMS Requests System
After=network-online.target

[Service]
User=ombi
Group=nogroup
WorkingDirectory=/opt/Ombi/
ExecStart=/opt/Ombi/Ombi --storage /etc/Ombi/
Type=simple
TimeoutStopSec=30
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
LeVraiRoiDHyrule
Posts: 55
Joined: Tue Apr 28, 2020 3:00 pm

Re: How can I setup Ombi to run as a startup service ?

Post by LeVraiRoiDHyrule »

Hi,

Thanks for your answer.
I found out Ombi had an apt package just before seeing your last message. I installed it with it and it solved the problem. Thanks a lot for your help.

But I'm having a similar problem with another software : jfa-go https://github.com/hrfee/jfa-go
This small program doesn't have an apt package and I would like to have as a service manageable with systemctl like the others.

I've extracted the archive to my /opt/ folder, and I can confirm it runs by executing ./jfa-go

But I can't manage to add it as service. Here is the content of my jfa-go.service :

Code: Select all

[Unit]
Description=jfa-go
After=network-online.target

[Service]
User=root
Group=nogroup
ExecStart=/opt/jfa-go/jfa-go
Type=simple
TimeoutStopSec=30
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target
But doing that doesn't allow me to control it with systemctl, I am running into this error :

Code: Select all

root@DietPi:~# systemctl start jfa-go.service
root@DietPi:~# systemctl status jfa-go.service
● jfa-go.service - jfa-go
   Loaded: loaded (/etc/systemd/system/jfa-go.service; disabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Tue 2021-02-09 15:46:19 GMT; 4s ago
  Process: 24821 ExecStart=/opt/jfa-go/jfa-go (code=exited, status=1/FAILURE)
 Main PID: 24821 (code=exited, status=1/FAILURE)

févr. 09 15:46:19 DietPi systemd[1]: jfa-go.service: Failed with result 'exit-code'.
Is there something I missed during the configuration ? I correctly reloaded systemctl daemon.
LeVraiRoiDHyrule
Posts: 55
Joined: Tue Apr 28, 2020 3:00 pm

Re: How can I setup Ombi to run as a startup service ?

Post by LeVraiRoiDHyrule »

I succeeded to fix this myself !

I've installed it in mnt/dieti_userdata instead of /opt , and now it works and systemctl works perfectly. It correctly boots at launch and I can control it easily. I don't know it didn't work earlier but now it's perfect.
Post Reply