Working with doas instead of sudo #33

Open
opened 2024-10-30 13:54:31 +00:00 by mainrs · 1 comment

The installer script tries to elevate privileges using sudo. On systems that run doas, the installation script fails. I used the specified install command on the website: curl -sSf -L https://install.lix.systems/lix | sh -s -- install. Would be great to have the script also try doas if sudo fails.

I ran it on Gentoo.

The installer script tries to elevate privileges using `sudo`. On systems that run `doas`, the installation script fails. I used the specified install command on the website: `curl -sSf -L https://install.lix.systems/lix | sh -s -- install`. Would be great to have the script also try `doas` if `sudo` fails. I ran it on Gentoo.
Member

This isn't actually an issue with the script (or at least, the one on main); installer itself uses sudo, in one place:

let sudo_cstring = CString::new("sudo").wrap_err("Making C string of `sudo`")?;

This makes for a very easy fix: just check if sudo is in PATH, and check for doas if it's not.

Does modern Debian installation come with sudo, actually? When I tried it years ago, it only had su; that might also be something to check for.

This isn't actually an issue with the script (or at least, the one on `main`); installer itself uses `sudo`, in one place: https://git.lix.systems/lix-project/lix-installer/src/commit/12a8592afe0cd5f29e20f03ba2fd433ca5354004/src/cli/mod.rs#L170 This makes for a very easy fix: just check if `sudo` is in PATH, and check for `doas` if it's not. Does modern Debian installation come with `sudo`, actually? When I tried it years ago, it only had `su`; that might also be something to check for.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/lix-installer#33
No description provided.