[GH-ISSUE #13178] Install script overwrites systemd config #8714

Closed
opened 2026-04-12 21:29:08 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @cwthomas-llu on GitHub (Nov 20, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/13178

What is the issue?

To make Ollama work in our environment, we had to modify the systemd script /etc/systemd/system/ollama.service. The Ollama documentation states that to update Ollama, just re-run the install script. We did that and it overwrote our existing systemd script. Then, Ollama stopped working in our environment.

I think the install script should skip copying the default systemd script, if one already exists.

Relevant log output


OS

No response

GPU

No response

CPU

No response

Ollama version

No response

Originally created by @cwthomas-llu on GitHub (Nov 20, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/13178 ### What is the issue? To make Ollama work in our environment, we had to modify the systemd script `/etc/systemd/system/ollama.service`. The Ollama documentation states that to update Ollama, just re-run the install script. We did that and it overwrote our existing systemd script. Then, Ollama stopped working in our environment. I think the install script should skip copying the default systemd script, if one already exists. ### Relevant log output ```shell ``` ### OS _No response_ ### GPU _No response_ ### CPU _No response_ ### Ollama version _No response_
GiteaMirror added the bug label 2026-04-12 21:29:08 -05:00
Author
Owner

@rick-github commented on GitHub (Nov 20, 2025):

Add your configuration as described in the documentation. Configuration will be preserved across updates.

<!-- gh-comment-id:3559982869 --> @rick-github commented on GitHub (Nov 20, 2025): Add your configuration as [described in the documentation](https://github.com/ollama/ollama/blob/main/docs/faq.mdx#setting-environment-variables-on-linux). Configuration will be preserved across updates.
Author
Owner

@cwthomas-llu commented on GitHub (Nov 21, 2025):

Add your configuration as described in the documentation. Configuration will be preserved across updates.

Without reading the documentation you refer to I did the same thing as the documentation said to do and the install script on upgrade overwrote the file. I will try one more time and see what happens.

<!-- gh-comment-id:3564480789 --> @cwthomas-llu commented on GitHub (Nov 21, 2025): > Add your configuration as [described in the documentation](https://github.com/ollama/ollama/blob/main/docs/faq.mdx#setting-environment-variables-on-linux). Configuration will be preserved across updates. Without reading the documentation you refer to I did the same thing as the documentation said to do and the install script on upgrade overwrote the file. I will try one more time and see what happens.
Author
Owner

@cipri-tom commented on GitHub (Feb 4, 2026):

I did like OP and had the same problem. Expected, since the "upgrade" path is to re-run the same installation script, the script just overwrites the file. See here: df70249520/scripts/install.sh (L155-L170)

I didn't realise until today that systemctl edit ollama.service does more than just editing /etc/systemd/system/ollama.service . It creates a second file which is merged into the original .service when the service is started. Note that in the docs it should be emphasisezd that you need the [Service] header line, in addition to any Environment=... lines

<!-- gh-comment-id:3846863134 --> @cipri-tom commented on GitHub (Feb 4, 2026): I did like OP and had the same problem. Expected, since the "upgrade" path is to re-run the same installation script, the script just overwrites the file. See here: https://github.com/ollama/ollama/blob/df70249520fda991a83f607d485fbf4e64cfe1fd/scripts/install.sh#L155-L170 I didn't realise until today that `systemctl edit ollama.service` does more than just editing `/etc/systemd/system/ollama.service` . It creates a second file which is merged into the original `.service` when the service is started. Note that in the docs it should be emphasisezd that you need the `[Service]` header line, in addition to any `Environment=...` lines
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#8714