[GH-ISSUE #7077] ollama models cannot be started by systemd #82173

Closed
opened 2026-05-09 13:25:07 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @kmorber on GitHub (Oct 2, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7077

What is the issue?

ollama models cannot be started by systemd

OS

Linux

GPU

Nvidia

CPU

Intel

Ollama version

0.3.12

Originally created by @kmorber on GitHub (Oct 2, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7077 ### What is the issue? ollama models cannot be started by systemd ### OS Linux ### GPU Nvidia ### CPU Intel ### Ollama version 0.3.12
GiteaMirror added the questionlinux labels 2026-05-09 13:25:07 -05:00
Author
Owner

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

Server logs will aid in debugging.

<!-- gh-comment-id:2388044564 --> @rick-github commented on GitHub (Oct 2, 2024): [Server logs](https://github.com/ollama/ollama/blob/main/docs/troubleshooting.md#how-to-troubleshoot-issues) will aid in debugging.
Author
Owner

@kmorber commented on GitHub (Oct 2, 2024):

Hello,

where can i find the logs in linux?

<!-- gh-comment-id:2388110074 --> @kmorber commented on GitHub (Oct 2, 2024): Hello, where can i find the logs in linux?
Author
Owner

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

See here.

<!-- gh-comment-id:2388122055 --> @rick-github commented on GitHub (Oct 2, 2024): [See here](https://github.com/ollama/ollama/blob/main/docs/troubleshooting.md#how-to-troubleshoot-issues).
Author
Owner

@kmorber commented on GitHub (Oct 2, 2024):

● ollama3.service - ollama3
Loaded: loaded (/usr/lib/systemd/system/ollama3.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2024-10-02 11:22:18 CEST; 24min ago
Main PID: 536622 (code=exited, status=2)

Okt 02 11:22:18 morber.net ollama[536622]: github.com/ollama/ollama/envconfig.Models()
Okt 02 11:22:18 morber.net ollama[536622]: github.com/ollama/ollama/envconfig/config.go:89 +0xa9
Okt 02 11:22:18 morber.net ollama[536622]: github.com/ollama/ollama/envconfig.AsMap()
Okt 02 11:22:18 morber.net ollama[536622]: github.com/ollama/ollama/envconfig/config.go:241 +0x713
Okt 02 11:22:18 morber.net ollama[536622]: github.com/ollama/ollama/cmd.NewCLI()
Okt 02 11:22:18 morber.net ollama[536622]: github.com/ollama/ollama/cmd/cmd.go:1406 +0xc11
Okt 02 11:22:18 morber.net ollama[536622]: main.main()
Okt 02 11:22:18 morber.net ollama[536622]: github.com/ollama/ollama/main.go:12 +0x13
Okt 02 11:22:18 morber.net systemd[1]: ollama3.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Okt 02 11:22:18 morber.net systemd[1]: ollama3.service: Failed with result 'exit-code'.

logs have been uploaded
ollama.log

<!-- gh-comment-id:2388131116 --> @kmorber commented on GitHub (Oct 2, 2024): ● ollama3.service - ollama3 Loaded: loaded (/usr/lib/systemd/system/ollama3.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Wed 2024-10-02 11:22:18 CEST; 24min ago Main PID: 536622 (code=exited, status=2) Okt 02 11:22:18 morber.net ollama[536622]: github.com/ollama/ollama/envconfig.Models() Okt 02 11:22:18 morber.net ollama[536622]: github.com/ollama/ollama/envconfig/config.go:89 +0xa9 Okt 02 11:22:18 morber.net ollama[536622]: github.com/ollama/ollama/envconfig.AsMap() Okt 02 11:22:18 morber.net ollama[536622]: github.com/ollama/ollama/envconfig/config.go:241 +0x713 Okt 02 11:22:18 morber.net ollama[536622]: github.com/ollama/ollama/cmd.NewCLI() Okt 02 11:22:18 morber.net ollama[536622]: github.com/ollama/ollama/cmd/cmd.go:1406 +0xc11 Okt 02 11:22:18 morber.net ollama[536622]: main.main() Okt 02 11:22:18 morber.net ollama[536622]: github.com/ollama/ollama/main.go:12 +0x13 Okt 02 11:22:18 morber.net systemd[1]: ollama3.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Okt 02 11:22:18 morber.net systemd[1]: ollama3.service: Failed with result 'exit-code'. logs have been uploaded [ollama.log](https://github.com/user-attachments/files/17227617/ollama.log)
Author
Owner

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

What's the output of:

systemctl cat ollama  --no-pager
systemctl cat ollama1 --no-pager
systemctl cat ollama2 --no-pager
systemctl cat ollama3 --no-pager
journalctl -u ollama  --no-pager
journalctl -u ollama1 --no-pager
journalctl -u ollama2 --no-pager
journalctl -u ollama3 --no-pager
<!-- gh-comment-id:2388423588 --> @rick-github commented on GitHub (Oct 2, 2024): What's the output of: ``` systemctl cat ollama --no-pager systemctl cat ollama1 --no-pager systemctl cat ollama2 --no-pager systemctl cat ollama3 --no-pager journalctl -u ollama --no-pager journalctl -u ollama1 --no-pager journalctl -u ollama2 --no-pager journalctl -u ollama3 --no-pager ```
Author
Owner

@kmorber commented on GitHub (Oct 2, 2024):

ollama.log

<!-- gh-comment-id:2388488086 --> @kmorber commented on GitHub (Oct 2, 2024): [ollama.log](https://github.com/user-attachments/files/17229020/ollama.log)
Author
Owner

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

This is not the way to run multiple models. You need one service, ollama.service. Remove all the others. When you need a model, you load it with the client. If you want the model to stay loaded, set OLLAMA_KEEP_ALIVE=-1 in the server environment. If you want to have 4 models loaded at the same time, set OLLAMA_MAX_LOADED_MODELS=4 in the server environment. If you want to preload models, add this to the ollama.service file:

ExecStartPost=sh -c "for i in mistral wizardlm2 llama3.2 ; do ollama run $i '' ; done"
<!-- gh-comment-id:2388612113 --> @rick-github commented on GitHub (Oct 2, 2024): This is not the way to run multiple models. You need one service, `ollama.service`. Remove all the others. When you need a model, you load it with the client. If you want the model to stay loaded, set `OLLAMA_KEEP_ALIVE=-1` in the server environment. If you want to have 4 models loaded at the same time, set `OLLAMA_MAX_LOADED_MODELS=4` in the server environment. If you want to preload models, add this to the ollama.service file: ``` ExecStartPost=sh -c "for i in mistral wizardlm2 llama3.2 ; do ollama run $i '' ; done" ```
Author
Owner

@kmorber commented on GitHub (Oct 2, 2024):

Perfect, thanks so much

<!-- gh-comment-id:2388630654 --> @kmorber commented on GitHub (Oct 2, 2024): Perfect, thanks so much
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#82173