[PR #15001] fix: exit on critical sudo failures in install.sh #20233

Open
opened 2026-04-16 07:30:58 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15001
Author: @alvinttang
Created: 3/22/2026
Status: 🔄 Open

Base: mainHead: fix/exit-on-sudo-failure


📝 Commits (1)

  • ba71a87 fix: exit on critical sudo failures in install.sh

📊 Changes

1 file changed (+26 additions, -8 deletions)

View changed files

📝 scripts/install.sh (+26 -8)

📄 Description

Summary

  • Fixes the install.sh script silently reporting "Install complete" even when critical sudo commands fail (e.g., sudo timeout, wrong password)
  • Adds explicit || error "..." checks after each critical sudo command in configure_systemd(): useradd, usermod, tee (service file), systemctl daemon-reload, systemctl enable, and systemctl restart
  • Makes the install_success EXIT trap check the exit code ($?) so it does not print a false success message when the script exits due to a prior failure

Fixes #14998

Test plan

  • Run install.sh normally on a Linux system with systemd — verify it completes successfully and prints "Install complete"
  • Run install.sh and let the sudo password prompt time out — verify the script exits with an error message instead of "Install complete"
  • Run install.sh on a system without systemd — verify it still works (the configure_systemd path is skipped)
  • Run sh -n scripts/install.sh to confirm no syntax errors

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/15001 **Author:** [@alvinttang](https://github.com/alvinttang) **Created:** 3/22/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/exit-on-sudo-failure` --- ### 📝 Commits (1) - [`ba71a87`](https://github.com/ollama/ollama/commit/ba71a8757faba4f6f8857e3f5fe5f96463018238) fix: exit on critical sudo failures in install.sh ### 📊 Changes **1 file changed** (+26 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `scripts/install.sh` (+26 -8) </details> ### 📄 Description ## Summary - Fixes the `install.sh` script silently reporting "Install complete" even when critical `sudo` commands fail (e.g., sudo timeout, wrong password) - Adds explicit `|| error "..."` checks after each critical sudo command in `configure_systemd()`: `useradd`, `usermod`, `tee` (service file), `systemctl daemon-reload`, `systemctl enable`, and `systemctl restart` - Makes the `install_success` EXIT trap check the exit code (`$?`) so it does not print a false success message when the script exits due to a prior failure Fixes #14998 ## Test plan - [ ] Run `install.sh` normally on a Linux system with systemd — verify it completes successfully and prints "Install complete" - [ ] Run `install.sh` and let the sudo password prompt time out — verify the script exits with an error message instead of "Install complete" - [ ] Run `install.sh` on a system without systemd — verify it still works (the `configure_systemd` path is skipped) - [ ] Run `sh -n scripts/install.sh` to confirm no syntax errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 07:30:58 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#20233