Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
eselect not working with doas, but does with sudo [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
keen4e
n00b
n00b


Joined: 20 Nov 2021
Posts: 19

PostPosted: Thu Dec 14, 2023 11:04 pm    Post subject: eselect not working with doas, but does with sudo [SOLVED] Reply with quote

When running for example the command:
Code:
sudo eselect repository --list -i

it does output all my repositories.

When I try:

Code:
doas eselect repository --list -i


I get the following error message:

Code:

find: unrecognized: -newermt
BusyBox v1.36.1 (2023-07-09 22:23:37 EDT) multi-call binary.

Usage: find [-HL] [PATH]... [OPTIONS] [ACTIONS]

Search for files and perform actions on them.
First failed action stops processing of current file.
Defaults: PATH is current directory, action is '-print'

   -L,-follow   Follow symlinks
   -H      ...on command line only
   -xdev      Don't descend directories on other filesystems
   -maxdepth N   Descend at most N levels. -maxdepth 0 applies
         actions to command line arguments only
   -mindepth N   Don't act on first N levels
   -depth      Act on directory *after* traversing it

Actions:
   ( ACTIONS )   Group actions for -o / -a
   ! ACT      Invert ACT's success/failure
   ACT1 [-a] ACT2   If ACT1 fails, stop, else do ACT2
   ACT1 -o ACT2   If ACT1 succeeds, stop, else do ACT2
         Note: -a has higher priority than -o
   -name PATTERN   Match file name (w/o directory name) to PATTERN
   -iname PATTERN   Case insensitive -name
   -path PATTERN   Match path to PATTERN
   -ipath PATTERN   Case insensitive -path
   -regex PATTERN   Match path to regex PATTERN
   -type X      File type is X (one of: f,d,l,b,c,s,p)
   -executable   File is executable
   -perm MASK   At least one mask bit (+MASK), all bits (-MASK),
         or exactly MASK bits are set in file's mode
   -mtime DAYS   mtime is greater than (+N), less than (-N),
         or exactly N days in the past
   -atime DAYS   atime +N/-N/N days in the past
   -ctime DAYS   ctime +N/-N/N days in the past
   -mmin MINS   mtime is greater than (+N), less than (-N),
         or exactly N minutes in the past
   -amin MINS   atime +N/-N/N minutes in the past
   -cmin MINS   ctime +N/-N/N minutes in the past
   -newer FILE   mtime is more recent than FILE's
   -inum N      File has inode number N
   -samefile FILE   File is same as FILE
   -user NAME/ID   File is owned by given user
   -group NAME/ID   File is owned by given group
   -size N[bck]   File size is N (c:bytes,k:kbytes,b:512 bytes(def.))
         +/-N: file size is bigger/smaller than N
   -links N   Number of links is greater than (+N), less than (-N),
         or exactly N
   -empty      Match empty file/directory
   -prune      If current file is directory, don't descend into it
If none of the following actions is specified, -print is assumed
   -print      Print file name
   -print0      Print file name, NUL terminated
   -exec CMD ARG ;   Run CMD with all instances of {} replaced by
         file name. Fails if CMD exits with nonzero
   -exec CMD ARG + Run CMD with {} replaced by list of file names
   -delete      Delete current file/directory. Turns on -depth option
   -quit      Exit
wget: invalid option -- 'N'
BusyBox v1.36.1 (2023-07-09 22:23:37 EDT) multi-call binary.

Usage: wget [-cqS] [--spider] [-O FILE] [-o LOGFILE] [--header STR]
   [--post-data STR | --post-file FILE] [-Y on/off]
   [--no-check-certificate] [-P DIR] [-U AGENT] [-T SEC] URL...

Retrieve files via HTTP or FTP

   --spider   Only check URL existence: $? is 0 if exists
   --header STR   Add STR (of form 'header: value') to headers
   --post-data STR   Send STR using POST method
   --post-file FILE   Send FILE using POST method
   --no-check-certificate   Don't validate the server's certificate
   -c      Continue retrieval of aborted transfer
   -q      Quiet
   -P DIR      Save to DIR (default .)
   -S          Show server response
   -T SEC      Network read timeout is SEC seconds
   -O FILE      Save to FILE ('-' for stdout)
   -o LOGFILE   Log messages to FILE
   -U STR      Use STR for User-Agent header
   -Y on/off   Use proxy
!!! Error: unable to fetch repositories.xml


I don't really now what that means, but it does look like somehow busybox gets some unrecognized flag after this command is executed?

My doas config file is pretty simple it only contains:

Code:

permit persist :wheel

Could someone help me figure out, what could have happened here? Thanks.

EDIT:

I found the solution. It was actually surprisingly easy.

From the archwiki article on doas:
Quote:

Note: By default sudo preserves some environment variables while doas does not, most notably XAUTHORITY, LANG and LC_ALL. This means you will not be able to start graphical applications under X nor to access the user's locale without further configuration. For instance, to allow members of the wheel group to run graphical applications and to access the user's locale using the setenv option:...


Which means in particular my PATH variable wasn't preserved, which confused the eselect command.
By adding:
Code:

setenv {PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin}


to my doas config file, the problem went away.
Back to top
View user's profile Send private message
myga
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jun 2023
Posts: 99

PostPosted: Wed Jan 03, 2024 2:29 am    Post subject: Reply with quote

The correct commands that work are:

Code:

$ sudo eselect repository list -i

$ doas eselect repository list -i
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum