On Mon, Oct 29, 2018 at 9:19 PM Joseph Mayer <joseph.ma...@protonmail.com> wrote:
> On Tuesday, October 30, 2018 1:56 PM, Philip Guenther <guent...@gmail.com> > wrote: > > On Mon, Oct 29, 2018 at 8:40 PM Joseph Mayer joseph.ma...@protonmail.com > > 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