[GH-ISSUE #1278] Install clobbers /etc/systemd/system/ollama.service file destroying any custom configurations like specifying IP or PORT being served or preventing cors errors #657

Closed
opened 2026-04-12 10:20:53 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @Dougie777 on GitHub (Nov 26, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/1278

Upgrading to the latest version clobbers my /etc/systemd/system/ollama.service file. If the file exists it should not be overwritten. Or the distro should only include a sample file like so /etc/systemd/system/ollama.service.sample

To Reproduce

1 Install ollama as a service using docs.
2 Customize /etc/systemd/system/ollama.service like adding:
Environment=OLLAMA_HOST=0.0.0.0
Environment=OLLAMA_ORIGINS=*
3 Upgrade to the latest ollama version

Expected behavior

/etc/systemd/system/ollama.service is overwritten, destroying any customizations to this file.

Originally created by @Dougie777 on GitHub (Nov 26, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/1278 Upgrading to the latest version clobbers my /etc/systemd/system/ollama.service file. If the file exists it should not be overwritten. Or the distro should only include a sample file like so /etc/systemd/system/ollama.service.sample To Reproduce 1 Install ollama as a service using docs. 2 Customize /etc/systemd/system/ollama.service like adding: Environment=OLLAMA_HOST=0.0.0.0 Environment=OLLAMA_ORIGINS=* 3 Upgrade to the latest ollama version Expected behavior /etc/systemd/system/ollama.service is overwritten, destroying any customizations to this file.
Author
Owner

@jmorganca commented on GitHub (Nov 26, 2023):

Sorry this happened. Will look into it what can be done to avoid losing any customizations!

<!-- gh-comment-id:1826842878 --> @jmorganca commented on GitHub (Nov 26, 2023): Sorry this happened. Will look into it what can be done to avoid losing any customizations!
Author
Owner

@wrapss commented on GitHub (Nov 26, 2023):

As specified in the faq, you can enter your environment variables in /etc/systemd/system/ollama.service.d/environment.conf and they will not be overwritten

<!-- gh-comment-id:1826882493 --> @wrapss commented on GitHub (Nov 26, 2023): As specified in the faq, you can enter your environment variables in /etc/systemd/system/ollama.service.d/environment.conf and they will not be overwritten
Author
Owner

@will-wright-eng commented on GitHub (Nov 27, 2023):

/etc/systemd/system/ollama.service is set up as a read only file -- as mentioned above, the faq suggests setting up a separate service unit directory. what is the benefit of creating an additional unit directory and file?

<!-- gh-comment-id:1827460703 --> @will-wright-eng commented on GitHub (Nov 27, 2023): /etc/systemd/system/ollama.service is set up as a read only file -- as mentioned above, the faq suggests setting up a separate service unit directory. what is the benefit of creating an additional unit directory and file?
Author
Owner

@Dougie777 commented on GitHub (Nov 27, 2023):

I will move my customations to etc/systemd/system/ollama.service.d/environment.conf

Thanks all!

<!-- gh-comment-id:1827667352 --> @Dougie777 commented on GitHub (Nov 27, 2023): I will move my customations to etc/systemd/system/ollama.service.d/environment.conf Thanks all!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#657