Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: modifying the system path

14 views
Skip to first unread message

Lowell Gilbert

unread,
Apr 23, 2013, 5:03:13 PM4/23/13
to
John Bleichert <jblei...@gmail.com> writes:

> Well after over a decade of FreeBSD use I finally want to modify the
> system PATH and can't figure out how to do it, or even what the
> "blessed" method is. I need to add some custom software to the path
> for users and also for daemons (nologin).
>
> Can anyone give me a suggested manual to read? I've been up and down and back and forth on the rc* and login.conf man pages.

It's just the 'path' variable in login.conf(5).

It already has a setting in the default installed file.

--
Lowell Gilbert, embedded/networking software engineer
http://be-well.ilk.org/~lowell/

Bob Eager

unread,
Apr 23, 2013, 6:33:03 PM4/23/13
to
On Tue, 23 Apr 2013 17:03:13 -0400, Lowell Gilbert wrote:

> John Bleichert <jblei...@gmail.com> writes:
>
>> Well after over a decade of FreeBSD use I finally want to modify the
>> system PATH and can't figure out how to do it, or even what the
>> "blessed" method is. I need to add some custom software to the path for
>> users and also for daemons (nologin).
>>
>> Can anyone give me a suggested manual to read? I've been up and down
>> and back and forth on the rc* and login.conf man pages.
>
> It's just the 'path' variable in login.conf(5).
>
> It already has a setting in the default installed file.

Will that work for daemons that never log in?



--
Using UNIX since v6 (1975)...

Use the BIG mirror service in the UK:
http://www.mirrorservice.org

Lowell Gilbert

unread,
Apr 24, 2013, 7:59:09 AM4/24/13
to
Bob Eager <news...@eager.cx> writes:

> On Tue, 23 Apr 2013 17:03:13 -0400, Lowell Gilbert wrote:
>
>> John Bleichert <jblei...@gmail.com> writes:
>>
>>> Well after over a decade of FreeBSD use I finally want to modify the
>>> system PATH and can't figure out how to do it, or even what the
>>> "blessed" method is. I need to add some custom software to the path for
>>> users and also for daemons (nologin).
>>>
>>> Can anyone give me a suggested manual to read? I've been up and down
>>> and back and forth on the rc* and login.conf man pages.
>>
>> It's just the 'path' variable in login.conf(5).
>>
>> It already has a setting in the default installed file.
>
> Will that work for daemons that never log in?

If by "never log in" you mean never start a login shell, then it depends
on how they do get started. For rc.d scripts started at boot, I'm pretty
sure the answer is generally "yes". However, I wouldn't ever use that
mechanism for the path; if a default, stripped-down path isn't good
enough for a particular daemon, I'd recommend specifying it in a startup
script. For process limits, I think there's more room to argue.

John Bleichert

unread,
Apr 24, 2013, 9:51:55 AM4/24/13
to
On Tuesday, April 23, 2013 5:03:13 PM UTC-4, Lowell Gilbert wrote:
> It's just the 'path' variable in login.conf(5).
>
>
>
> It already has a setting in the default installed file.
>

I tried changing the path in login.conf and ran cap_mkdb without seeing an effect for any users.

To be fair, I didn't beat on this too hard. It was more of an "exercise" than "necessary" and I was curious that system ENV variables at startup isn't detailed in the handbook. Way back in the 4.x days I used to do this in rc.local iirc but that is deprecated. And didn't work...

If login.conf is the blessed method I will get back to it at work today. Perhaps I rebuilt the database incorrectly.

Thanks!

John

John Bleichert

unread,
Apr 24, 2013, 9:57:58 AM4/24/13
to
On Wednesday, April 24, 2013 7:59:09 AM UTC-4, Lowell Gilbert wrote:
> Bob Eager writes:
>
> > Will that work for daemons that never log in?
>
> ...
> However, I wouldn't ever use that
>
> mechanism for the path; if a default, stripped-down path isn't good
>
> enough for a particular daemon, I'd recommend specifying it in a startup
>
> script. For process limits, I think there's more room to argue.
>

I was able to specify a path addition for the daemon easily. I was trying to make it all available to users as well without making a million symlinks in /usr/local/bin. User login scripts are fine,
though.

John

Lowell Gilbert

unread,
Apr 24, 2013, 10:51:29 AM4/24/13
to
John Bleichert <jblei...@gmail.com> writes:

> To be fair, I didn't beat on this too hard. It was more of an
> "exercise" than "necessary" and I was curious that system ENV
> variables at startup isn't detailed in the handbook. Way back in the
> 4.x days I used to do this in rc.local iirc but that is
> deprecated. And didn't work...

rc.conf never supported that.

Maybe you were thinking of the root conf files,
/.cshrc and /.profile (or /etc/profile and /etc cschrc).
But I'm just guessing here).

> If login.conf is the blessed method I will get back to it at work today. Perhaps I rebuilt the database incorrectly.

There *are* lots of ways; they're all useful at times, but it depends on
your needs and on what your existing users already have configured. For
regular users, I would set up the path in the skeleton files that are
automatically moved in by adduser(8).

Also, su(1) and login(1) interact with login.conf in different ways
based on how they are invoked. Particularly note the differences
between login shells and otherwise.

Torfinn Ingolfsen

unread,
Apr 25, 2013, 1:54:24 AM4/25/13
to
On 04/24/2013 04:51 PM, Lowell Gilbert wrote:
> John Bleichert <jblei...@gmail.com> writes:
>
>> To be fair, I didn't beat on this too hard. It was more of an
>> "exercise" than "necessary" and I was curious that system ENV
>> variables at startup isn't detailed in the handbook. Way back in the
>> 4.x days I used to do this in rc.local iirc but that is
>> deprecated. And didn't work...
>
> rc.conf never supported that.
>
> Maybe you were thinking of the root conf files,
> /.cshrc and /.profile (or /etc/profile and /etc cschrc).
> But I'm just guessing here).

AFAIK, FreeBSD is still a System V type system, so the "canonical" place
to change the PATH variable for the system is /etc/profile.

HTH
--
Torfinn Ingolfsen,
Norway
0 new messages