From owner-freebsd-questions@freebsd.org Wed May 13 14:29:09 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B18F92F79D2 for ; Wed, 13 May 2020 14:29:09 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49McVr5PYnz46ls for ; Wed, 13 May 2020 14:29:08 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([94.222.23.183]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPA (Nemesis) id 1N7iOw-1j4t9t29r8-014iCI; Wed, 13 May 2020 16:28:51 +0200 Date: Wed, 13 May 2020 16:28:47 +0200 From: Polytropon To: "@lbutlr" Cc: FreeBSD Subject: Re: On a serious note, what I'd change about FreeBSD hier(7) Message-Id: <20200513162847.329d42d3.freebsd@edvax.de> In-Reply-To: <6CA92BC4-DB17-4B6E-ACC9-9759BB6AC4F7@kreme.com> References: <83788746a7d8a802d8af4b582e00827166febd1a.camel@tom.com> <20200506172115.cb3b572b.freebsd@edvax.de> <20200506214540.247500820cf8701968ac01c9@sohara.org> <20200512190812259650810@bob.proulx.com> <6CA92BC4-DB17-4B6E-ACC9-9759BB6AC4F7@kreme.com> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:WYWS4OighAo1YFEShOJmTR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rKgrP95w4tV4UpnKXMJ iRUL3LkbQZRwvJIu7DncWMZAwnDo30OqAw+CMH5DIMRc1oY841CLauoYksoZu9jgyaviRGL X-Rspamd-Queue-Id: 49McVr5PYnz46ls X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@edvax.de has no SPF policy when checking 212.227.126.130) smtp.mailfrom=freebsd@edvax.de X-Spamd-Result: default: False [4.85 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; TO_DN_ALL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; RECEIVED_SPAMHAUS_PBL(0.00)[183.23.222.94.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(1.00)[0.995,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(1.00)[1.000,0]; RCVD_IN_DNSWL_NONE(0.00)[130.126.227.212.list.dnswl.org : 127.0.5.0]; MID_CONTAINS_FROM(1.00)[]; R_SPF_NA(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[130.126.227.212.rep.mailspike.net : 127.0.0.17]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE(0.45)[ip: (1.47), ipnet: 212.227.0.0/16(-1.20), asn: 8560(2.00), country: DE(-0.02)] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 14:29:09 -0000 On Wed, 13 May 2020 05:51:26 -0600, @lbutlr wrote: > On 12 May 2020, at 23:33, Manish Jain wrote: > > Perhaps you might like to remember another location : /opt > > > > That is entirely unused in the default config in FreeBSD, > > and I think /opt/bin makes a good location for the user's own software. > > User software goes in ~/bin. Correct - that is "user-locally installed software", out of the scope of system administration. In many cases, it's user scripts, but can also be actual binary programs built from source by the user. > Admin user’s software that is used by the system goes in /usr/local/bin. In my opinion, and following "man 7 hier" and the ideas and concepts it tries to convey, /usr/local, being a subtree of /usr, emphasizes that what is contained in there is managed by the system, i. e., 3rd party software installed via pkg or from source using the ports collection. This software is typically installed by the system administrator as it does require UID 0 permissions. Additionally, /usr/local is "regulated" - it uses the same layout as the base system, so there's /usr/local/bin with the same purpose as /usr/bin, and similarly for lib/, share/, include/ and so on. The manual page explains this. So /usr/local emphasizes the fact that stuff located there is tied to the system, and managed by the system (pkg). > I see no need for /opt/bin, what would you put there? The idea behind /opt is that is _out of reach_ of the OS-managed package system. Here a system administrator (!) can add programs and scripts that are not part of the ports collection, but shall be available to all users (unlike his own set of scripts, to be used by root only, which are in /root/bin). User can make /opt/bin a part of their $PATH (or there is a system-wide setting to do so). Software in /opt also has to be updated and recompiled manually; pkg will not be there to deal with them. As /opt is not covered in system layout trees, it can be any other non-assigned name, like /local or /apps or whatever you wish. Another concept is that if /opt is a separate filesystem or partition, it can be mounted with -o noexec, so for example during installation or updates, users cannot execute programs that reside there. There is no specific layout for /opt. The idea of /opt/bin is for convenience and central application access. In many cases, you'll find /opt/ for each additionally installed software package, and what happens inside there is none of the system's business - any program can decide on its own. Linking the binary or launcher to /opt/bin is just convenient. It is also possible to use /opt to install software that is run by tools like wine, SimH, or Hercules (but managed outside their local program directories in /usr/local or user directories such as ~/.wine). Programs executed by other programs, such as custom print filters, can go to /opt/libexec. /opt/src can hold sources for building "non-managed" programs. That is of course only _one_ possible interpretation of how to use /opt. The idea is to differentiate /opt as being totally optional from /usr/local being dealt with by pkg, but _both_ are locations accessible by _all_ users. Of course, it is technically possible to also maintain stuff in /opt using pkg, but why should someone do that? ;-) Please see my earlier reply on this topic for more description. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...