How effectiate login.conf changes in console? ("ksh -l" does not)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How effectiate login.conf changes in console? ("ksh -l" does not)

Joseph Mayer
Hi,

After having changed /etc/login.conf I'd like to effectuate the
changes directly in the console, without doing a logout-relogin
cycle.

Running "ksh -l" does *not* effectuate login.conf changes but only
re-runs the profile script [1].

Running "login" asks for username and password which seems less
efficient than possible.

Is there any way to do this?

Joseph

[1] http://man.openbsd.org/ksh#DESCRIPTION

Reply | Threaded
Open this post in threaded view
|

Re: How effectiate login.conf changes in console? ("ksh -l" does not)

Philip Guenther-2
On Mon, Oct 29, 2018 at 8:40 PM Joseph Mayer <[hidden email]>
wrote:

> After having changed /etc/login.conf I'd like to effectuate the
> changes directly in the console, without doing a logout-relogin
> cycle.
>
> Running "ksh -l" does *not* effectuate login.conf changes but only
> re-runs the profile script [1].
>
> Running "login" asks for username and password which seems less
> efficient than possible.
>
> Is there any way to do this?


Since changes to login.conf may mean raising/increasing hard limits, which
can only be done by privileged processes, the only sure fire way to have
login.conf changes take effect is to logout and log back in.


Philip Guenther
Reply | Threaded
Open this post in threaded view
|

Re: How effectiate login.conf changes in console? ("ksh -l" does not)

Joseph Mayer
On Tuesday, October 30, 2018 1:56 PM, Philip Guenther <[hidden email]> wrote:

> On Mon, Oct 29, 2018 at 8:40 PM Joseph Mayer [hidden email]
> wrote:
>
> > After having changed /etc/login.conf I'd like to effectuate the
> > changes directly in the console, without doing a logout-relogin
> > cycle.
> > Running "ksh -l" does not effectuate login.conf changes but only
> > re-runs the profile script [1].
> > Running "login" asks for username and password which seems less
> > efficient than possible.
> > Is there any way to do this?
>
> Since changes to login.conf may mean raising/increasing hard limits, which
> can only be done by privileged processes, the only sure fire way to have
> login.conf changes take effect is to logout and log back in.
>
> Philip Guenther

Hi Philip,

Thanks for responding.

What about "su -l" [1]?

I understand that the privileged process aspect needs you to be root to
effectuate new login.conf changes.

If I'm root and do "su -l", will root's login.conf settings be applied?

su.c [2] uses setusercontext() [3], and because emlogin is 0,
LOGIN_SETRESOURCES is specified as flag, and so is LOGIN_SETUMASK -
meaning login.conf settings are indeed effectuated by root doing
"su -l" (relogin as root) or "su -l someuser" (login as someuser).

Correct?

Joseph

Reply | Threaded
Open this post in threaded view
|

Re: How effectiate login.conf changes in console? ("ksh -l" does not)

Philip Guenther-2
On Mon, Oct 29, 2018 at 9:19 PM Joseph Mayer <[hidden email]>
wrote:

> On Tuesday, October 30, 2018 1:56 PM, Philip Guenther <[hidden email]>
> wrote:
> > On Mon, Oct 29, 2018 at 8:40 PM Joseph Mayer [hidden email]
> > wrote:
> >
> > > After having changed /etc/login.conf I'd like to effectuate the
> > > changes directly in the console, without doing a logout-relogin
> > > cycle.
> > > Running "ksh -l" does not effectuate login.conf changes but only
> > > re-runs the profile script [1].
> > > Running "login" asks for username and password which seems less
> > > efficient than possible.
> > > Is there any way to do this?
> >
> > Since changes to login.conf may mean raising/increasing hard limits,
> which
> > can only be done by privileged processes, the only sure fire way to have
> > login.conf changes take effect is to logout and log back in.
>
...

> What about "su -l" [1]?
>
...

> If I'm root and do "su -l", will root's login.conf settings be applied?
>
> su.c [2] uses setusercontext() [3], and because emlogin is 0,
> LOGIN_SETRESOURCES is specified as flag, and so is LOGIN_SETUMASK -
> meaning login.conf settings are indeed effectuated by root doing
> "su -l" (relogin as root) or "su -l someuser" (login as someuser).
>
> Correct?
>

I guess?  Frankly, this is not an area I really care about: if I wanted to
test a login.conf change I would either logout/login if I had the password
for the account, or I suppose if it came up that I didn't, "su -c class" as
root.    If 'su -l' works for you in your testing (you did test it, yes?),
then use it.


Philip Guenther