On Tue, Oct 24, 2023 at 06:56:33PM +1100, Andy Lemin wrote:
> Hi Lyndon,
> That is a good trick, I will try that.
> 
> But it is more of an unexpected nuisance as I’m expecting the default to
> be rdomain 0.

No rdomains are inherited. Once a process runs in rdomain X all childs
will also be in rdomain X. With this logging in via sshd will inherit the
rdomain of the sshd process.

Now you could look into login.conf(5) and try forcing rtable to 0 for your
login class. If the login respects the settings you will get rdomain 0 all
the time.
 
> It seems to switch to use the rdomain with the most default routes which
> breaks things unexpectedly - for example many crontab commands break
> after adding routes, so now have to _always_ prefix with route -T0 exec
> (to support automated route changes etc).

No it does not.
 
> This must be unexpected behaviour to change dynamically like this?

There is no dynamic change. As said the rdomain is inherited over fork.
It is set probably by the rc.d script and from there on it sticks to that.
 
> Thanks for your help, Andy.
> 
> 
> > On 24 Oct 2023, at 14:09, Lyndon Nerenberg (VE7TFX/VE6BBM) 
> > <lyn...@orthanc.ca> wrote:
> > 
> > Andy Lemin writes:
> > 
> >> So I have to run;
> >> ‘route -T0 exec syspatch’ for example.
> >> 
> >> How do I set/override the default rdomain for system level CLI commands?
> > 
> > If you're talking about running a bunch of interactive shell commands
> > in rdomain 0, just 'route -T0 exec sh' to drop into a sub-shell in
> > rdomain 0.
> > 
> > --lyndon
> 

-- 
:wq Claudio

Reply via email to