[GH-ISSUE #9148] systemd service fails to start #5952

Closed
opened 2026-04-12 17:17:50 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @sid314 on GitHub (Feb 16, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/9148

What is the issue?

runs fine when run with ollama serve

Relevant log output

journalctl logs

Feb 09 18:55:00 asus ollama[11630]: Couldn't find '/var/lib/ollama/.ollama/id_ed25519'. Generating new private key.
Feb 09 18:55:00 asus ollama[11630]: Error: could not create directory mkdir /var/lib/ollama: permission denied
Feb 09 18:55:00 asus systemd[1]: ollama.service: Main process exited, code=exited, status=1/FAILURE
Feb 09 18:55:00 asus systemd[1]: ollama.service: Failed with result 'exit-code'.`

OS

Linux

GPU

Nvidia

CPU

Intel

Ollama version

0.5.7

Originally created by @sid314 on GitHub (Feb 16, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/9148 ### What is the issue? runs fine when run with ollama serve ### Relevant log output ```shell journalctl logs Feb 09 18:55:00 asus ollama[11630]: Couldn't find '/var/lib/ollama/.ollama/id_ed25519'. Generating new private key. Feb 09 18:55:00 asus ollama[11630]: Error: could not create directory mkdir /var/lib/ollama: permission denied Feb 09 18:55:00 asus systemd[1]: ollama.service: Main process exited, code=exited, status=1/FAILURE Feb 09 18:55:00 asus systemd[1]: ollama.service: Failed with result 'exit-code'.` ``` ### OS Linux ### GPU Nvidia ### CPU Intel ### Ollama version 0.5.7
GiteaMirror added the bug label 2026-04-12 17:17:50 -05:00
Author
Owner

@rick-github commented on GitHub (Feb 16, 2025):

ls -ld /var /var/lib /var/lib/ollama
<!-- gh-comment-id:2661453202 --> @rick-github commented on GitHub (Feb 16, 2025): ``` ls -ld /var /var/lib /var/lib/ollama ```
Author
Owner

@sid314 commented on GitHub (Feb 16, 2025):

"/var/lib/ollama": No such file or directory (os error 2)
drwxr-xr-x - root 13 Feb 04:57 /var/lib
drwxr-xr-x - root 16 Feb 18:06 /var
<!-- gh-comment-id:2661454747 --> @sid314 commented on GitHub (Feb 16, 2025): ``` "/var/lib/ollama": No such file or directory (os error 2) drwxr-xr-x - root 13 Feb 04:57 /var/lib drwxr-xr-x - root 16 Feb 18:06 /var ```
Author
Owner

@rick-github commented on GitHub (Feb 16, 2025):

sudo mkdir /var/lib/ollama
sudo chown ollama:ollama /var/lib/ollama
<!-- gh-comment-id:2661457760 --> @rick-github commented on GitHub (Feb 16, 2025): ``` sudo mkdir /var/lib/ollama sudo chown ollama:ollama /var/lib/ollama ```
Author
Owner

@sid314 commented on GitHub (Feb 16, 2025):

fixed it thanks

<!-- gh-comment-id:2661466678 --> @sid314 commented on GitHub (Feb 16, 2025): fixed it thanks
Author
Owner

@hczs commented on GitHub (Feb 25, 2025):

sudo mkdir /var/lib/ollama
sudo chown ollama:ollama /var/lib/ollama

I execute the command, but not work.

2月 25 17:49:00 boco-All-Series ollama[3156758]: 2025/02/25 17:49:00 routes.go:1186: INFO server config env="map[CUDA_VISIB>
2月 25 17:49:00 boco-All-Series ollama[3156758]: Error: mkdir /mnt/raid_disk/ollama: permission denied
2月 25 17:49:00 boco-All-Series systemd[1]: ollama.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- An ExecStart= process belonging to unit ollama.service has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 1.
2月 25 17:49:00 boco-All-Series systemd[1]: ollama.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit ollama.service has entered the 'failed' state with result 'exit-code'.
(base) boco@boco-All-Series:/etc/systemd/system$ ls -ld /mnt /mnt/raid_disk /mnt/raid_disk/ollama/
drwxr-xr-x  3 root   root   4096 Feb 17 11:24 /mnt
drwx----w- 35 boco   boco   4096 Feb 17 16:21 /mnt/raid_disk
drwxrwxrwx  3 ollama ollama 4096 Feb 17 16:27 /mnt/raid_disk/ollama/
<!-- gh-comment-id:2681382919 --> @hczs commented on GitHub (Feb 25, 2025): > ``` > sudo mkdir /var/lib/ollama > sudo chown ollama:ollama /var/lib/ollama > ``` I execute the command, but not work. ```log 2月 25 17:49:00 boco-All-Series ollama[3156758]: 2025/02/25 17:49:00 routes.go:1186: INFO server config env="map[CUDA_VISIB> 2月 25 17:49:00 boco-All-Series ollama[3156758]: Error: mkdir /mnt/raid_disk/ollama: permission denied 2月 25 17:49:00 boco-All-Series systemd[1]: ollama.service: Main process exited, code=exited, status=1/FAILURE -- Subject: Unit process exited -- Defined-By: systemd -- Support: http://www.ubuntu.com/support -- -- An ExecStart= process belonging to unit ollama.service has exited. -- -- The process' exit code is 'exited' and its exit status is 1. 2月 25 17:49:00 boco-All-Series systemd[1]: ollama.service: Failed with result 'exit-code'. -- Subject: Unit failed -- Defined-By: systemd -- Support: http://www.ubuntu.com/support -- -- The unit ollama.service has entered the 'failed' state with result 'exit-code'. ``` ```shell (base) boco@boco-All-Series:/etc/systemd/system$ ls -ld /mnt /mnt/raid_disk /mnt/raid_disk/ollama/ drwxr-xr-x 3 root root 4096 Feb 17 11:24 /mnt drwx----w- 35 boco boco 4096 Feb 17 16:21 /mnt/raid_disk drwxrwxrwx 3 ollama ollama 4096 Feb 17 16:27 /mnt/raid_disk/ollama/ ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#5952