[GH-ISSUE #7317] ollama won't start as a service, will start using 'serve'? #51160

Closed
opened 2026-04-28 18:41:55 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @MikeB2019x on GitHub (Oct 22, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7317

What is the issue?

I am trying to run ollama after a manual install on an Ubuntu VM with no internet connectivity. There is no GPU at the moment.
I am able to run ollama successfully from the CLI with:

ollama serve

When I try to run ollama as a service with:

sudo systemctl daemon-reload
sudo systemctl enable ollama
sudo systemctl start ollama

ollama fails to start. The only error is using systemctl --failed is:

  UNIT                     LOAD   ACTIVE SUB    DESCRIPTION                        
● zfs-import-scan.service loaded failed failed Import ZFS pools by device scanning

I assumed that if using ollama serve worked then the service would as well b/c both would be using the same services.

OS

Linux

GPU

No response

CPU

AMD

Ollama version

0.3.6

Originally created by @MikeB2019x on GitHub (Oct 22, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7317 ### What is the issue? I am trying to run ollama after a manual install on an Ubuntu VM with no internet connectivity. There is no GPU at the moment. I am able to run ollama successfully from the CLI with: ``` ollama serve ``` When I try to run ollama as a service with: ``` sudo systemctl daemon-reload sudo systemctl enable ollama sudo systemctl start ollama ``` ollama fails to start. The only error is using `systemctl --failed` is: ``` UNIT LOAD ACTIVE SUB DESCRIPTION ● zfs-import-scan.service loaded failed failed Import ZFS pools by device scanning ``` I assumed that if using `ollama serve` worked then the service would as well b/c both would be using the same services. ### OS Linux ### GPU _No response_ ### CPU AMD ### Ollama version 0.3.6
GiteaMirror added the needs more infobug labels 2026-04-28 18:42:02 -05:00
Author
Owner

@rick-github commented on GitHub (Oct 22, 2024):

Seems like a ZFS issue. https://forum.proxmox.com/threads/zfs-pool-import-fails-problem-with-cache-file-how-to-fix.61925/

<!-- gh-comment-id:2429600452 --> @rick-github commented on GitHub (Oct 22, 2024): Seems like a ZFS issue. https://forum.proxmox.com/threads/zfs-pool-import-fails-problem-with-cache-file-how-to-fix.61925/
Author
Owner

@MikeB2019x commented on GitHub (Oct 22, 2024):

@rick-github that suggests starting ollama as a service uses different resources that starting ollama from serve ie. zfs isn't used when starting from the latter?

<!-- gh-comment-id:2429667283 --> @MikeB2019x commented on GitHub (Oct 22, 2024): @rick-github that suggests starting ollama as a `service` uses different resources that starting ollama from `serve` ie. `zfs` isn't used when starting from the latter?
Author
Owner

@rick-github commented on GitHub (Oct 22, 2024):

I don't know anything about ZFS or how it's used in Ubuntu, but the only error we see is for ZFS so it's possible that systemd treats that as a primary dependency and doesn't want to run any other services until that is fixed. You're right in your assumption that ollama doesn't require any extra resources when starting as a service, but it is reliant on the service starting service. If you can offer more details about the version of Ubuntu, how you installed it, what other software you configured, etc, then I can have a go at replicating the problem and perhaps coming up with a solution.

<!-- gh-comment-id:2429686380 --> @rick-github commented on GitHub (Oct 22, 2024): I don't know anything about ZFS or how it's used in Ubuntu, but the only error we see is for ZFS so it's possible that `systemd` treats that as a primary dependency and doesn't want to run any other services until that is fixed. You're right in your assumption that ollama doesn't require any extra resources when starting as a service, but it is reliant on the service starting service. If you can offer more details about the version of Ubuntu, how you installed it, what other software you configured, etc, then I can have a go at replicating the problem and perhaps coming up with a solution.
Author
Owner

@pdevine commented on GitHub (Oct 23, 2024):

@MikeB2019x what's the output of journalctl -u ollama.service? The only service which you showed was zfs-import-scan.service which is unrelated to ollama.

<!-- gh-comment-id:2430737273 --> @pdevine commented on GitHub (Oct 23, 2024): @MikeB2019x what's the output of `journalctl -u ollama.service`? The only service which you showed was `zfs-import-scan.service` which is unrelated to ollama.
Author
Owner

@rick-github commented on GitHub (Oct 23, 2024):

Do you actually use ZFS? If not, try disabling it (sudo systemctl disable zfs-import-scan) and then see if ollama starts.

<!-- gh-comment-id:2432436564 --> @rick-github commented on GitHub (Oct 23, 2024): Do you actually use ZFS? If not, try disabling it (`sudo systemctl disable zfs-import-scan`) and then see if ollama starts.
Author
Owner

@MikeB2019x commented on GitHub (Oct 23, 2024):

@pdevine @rick-github Thank you for the quick response! I'm going to suggest closing this. You're right the service failure is unrelated and using sudo journalctl -u ollama.service has let me see what's going on. Basically just a PATH problem.

<!-- gh-comment-id:2432511572 --> @MikeB2019x commented on GitHub (Oct 23, 2024): @pdevine @rick-github Thank you for the quick response! I'm going to suggest closing this. You're right the service failure is unrelated and using `sudo journalctl -u ollama.service` has let me see what's going on. Basically just a PATH problem.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#51160