Re: doas and */sbin/* commands

"TR Kellers, Sr" <[email protected]>
Newsgroups gmane.os.freebsd.questions
Message-ID <[email protected]>

> On Feb 26, 2026, at 4:17 PM, [email protected] wrote:
> 
> Ok, so I'm trying doas again (it's an on/off affair, I'm not convinced
> of its benefits yet). This has me stumped:
> 
>   2+0 ~$ doas printenv
>  DOAS_USER=itz
>  HOME=/root
>  LOGNAME=root
>  PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
>  SHELL=/bin/sh
>  TERM=alacritty
>  USER=root
>   3+0 ~$ doas which service
>  /usr/sbin/service
>   4+0 ~$ doas service
>  doas: service: command not found
> 
> I know it's trivial to just type the full pathname, but it's still
> inconvenient. So what is happening here, and can I have the sbin things
> in PATH for doas but not otherwise?
> 
> --
> Ian
> 
Mine shows this, what does your doas.conf contain?

Tim

timothyk@nexttroll:~ % doas printenv
DOAS_USER=timothyk
HOME=/root
LOGNAME=root
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SHELL=/bin/sh
TERM=xterm-256color
USER=root
timothyk@nexttroll:~ % doas which service 
/usr/sbin/service
timothyk@nexttroll:~ % doas service

Usage:
service [-j <jail name or id>] -e
service [-j <jail name or id>] [-q] -R
service [-j <jail name or id>] [-v] -l
service [-j <jail name or id>] [-v] -r
service [-j <jail name or id>] [-dqv] [-E var=value] <rc.d script> start|stop|etc.
service -h

-d                Enable debugging of rc.d scripts
-j              Perform actions within the named jail
-E n=val        Set variable n to val before executing the rc.d script
-e              Show services that are enabled
-R              Stop and start enabled /usr/local/etc/rc.d services
-l              List all scripts in /etc/rc.d and /usr/local/etc/rc.d
-r              Show the results of boot time rcorder
-q              quiet
-v              Verbose
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.