Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Slightly OT: FreeBSD migration, what to do with /usr/local
Date: Thu, 12 Oct 2017 06:41:26
Message-Id: 4584856d-7a54-3b1b-04b5-b890338c9c93@gmail.com
In Reply to: [gentoo-user] Slightly OT: FreeBSD migration, what to do with /usr/local by Ian Zimmerman
1 On 12/10/2017 08:29, Ian Zimmerman wrote:
2 > I think I have written here previously that I want to move my _server_
3 > to FreeBSD. I am still thinking about that. But now I hit an
4 > obstacle. For a long time, I have put my local kiddie scripts in
5 > /usr/local. For better or worse, they are written in my dense style
6 > where any code duplication is avoided, and so they call one another a
7 > lot.
8 >
9 > But as you know FreeBSD directory hierarchy is different: /usr/local is
10 > for Packages and Ports. I must move my scripts somewhere else to not
11 > conflict with P & P. So the first problem is to come up with a
12 > location. What does a typical BSD admin do in this situation? I don't
13 > want to put them in my home directory because they're general purpose;
14 > at the very least I use them both as root and as an unprivileged user.
15
16 I have a few hundred FreeBSD servers and I put my own stuff in
17 /usr/local/, just like I would on on Linux. I haven't yet had any
18 filename collisions, that's probably because I'm aware of the problem
19 upfront and I name my scripts in a style that no sane upstream would
20 ever use i.e. be verbose :-)
21
22 So far I've never had a problem. Maybe I've just been lucky - who knows?
23
24 This seems to be the norm, at least amongst the FreeBSD admins I've
25 talked to.
26
27 > A more serious problem is how to find all the situations where
28 > /usr/local is baked in. It's not as simple as grep because when I
29 > could, I relied on the implicit PATH which would be configured somewhere
30 > else, or it might not even be configured - it might be compiled in (I
31 > think this is the case for some programs in the shadow package, and
32 > perhaps PAM modules).
33
34 Not sure what the context is here. Are you talking about packages and
35 ports code, or your own stuff you compiled yourself?
36
37 Either way, what problem were you asking about by writing that paragraphs?
38
39 > I don't think I can expect a simple answer, but if you ever faced such
40 > transition yourself, how did you approach it?
41
42 I approach these problems with backups and test staging machines. But I
43 have fleets of spare hypervisors at my disposal, you might not have that.
44
45
46 --
47 Alan McKinnon
48 alan.mckinnon@×××××.com

Replies

Subject Author
[gentoo-user] Re: Slightly OT: FreeBSD migration, what to do with /usr/local Ian Zimmerman <itz@××××××××××××.org>