mirror of
https://github.com/openclaw/openclaw.ai.git
synced 2026-07-15 12:25:40 -04:00
[PR #12] [MERGED] fix: skip sudo when already running as root #20
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/openclaw/openclaw.ai/pull/12
Author: @Glucksberg
Created: 1/25/2026
Status: ✅ Merged
Merged: 1/27/2026
Merged by: @thewilloftheshadow
Base:
main← Head:fix/sudo-when-root📝 Commits (2)
9c50f08fix: skip sudo when already running as root91b197efix: note sudo handling in installer (#12) (thanks @Glucksberg)📊 Changes
2 files changed (+24 additions, -10 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
public/install.sh(+23 -10)📄 Description
Summary
When running the install script as root (e.g., in a minimal container or VM), the script fails if the
sudobinary isn't installed, even though sudo isn't needed when already running as root.Changes:
maybe_sudo()helper function that runs commands directly when already rootsudowhen running as a normal user-Eflag (preserve environment) correctly in both casesFixes clawdbot/clawdbot#1933
Test plan
Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.