From owner-freebsd-questions@freebsd.org Wed May 13 14:39:37 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 0DACD2F7EBD for ; Wed, 13 May 2020 14:39:37 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Mckw0dx3z47Tt for ; Wed, 13 May 2020 14:39:35 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([94.222.23.183]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPA (Nemesis) id 1N5VXu-1j2h8e0nPe-016zzG; Wed, 13 May 2020 16:39:26 +0200 Date: Wed, 13 May 2020 16:39:24 +0200 From: Polytropon To: Manish Jain Cc: "@lbutlr" , FreeBSD Subject: Re: On a serious note, what I'd change about FreeBSD hier(7) Message-Id: <20200513163924.1a65016c.freebsd@edvax.de> In-Reply-To: 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:FQC5dlrupl+8LqQQ1gt8hLodmI8Hcv6IBMzNAuVTftp4RAYAYVY 45Rubb/vnAs2RLJIs6GHdea+wpwUKmxJBzmWI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4U1 X-Rspamd-Queue-Id: 49Mckw0dx3z47Tt 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.133) smtp.mailfrom=freebsd@edvax.de X-Spamd-Result: default: False [4.67 / 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)[]; FREEMAIL_TO(0.00)[hotmail.com]; 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)[]; RCPT_COUNT_THREE(0.00)[3]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.99)[0.987,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(1.00)[1.000,0]; RCVD_IN_DNSWL_NONE(0.00)[133.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)[133.126.227.212.rep.mailspike.net : 127.0.0.17]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE(0.28)[ip: (0.63), 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:39:37 -0000 On Wed, 13 May 2020 19:21:24 +0530, Manish Jain wrote: > > > On 2020-05-13 17:21, @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. Admin user’s software that is used by the system goes in /usr/local/bin. > > > > I see no need for /opt/bin, what would you put there? > > > > > > User software goes into ~/bin - that's right but with a caveat. What > goes into ~/bin is user-specific. > > If I wrote a system-wide application intended to be available to all > users of this particular computer, /opt/bin would make a good choice. Exactly! Whatever happens in ~/bin is local to the user, and no other user can (per default) access software installed to that place. A special case is /root/bin where the system administrator can keep helper scripts that are not interesting to anyone else. If your program is not managed using the ports collection, but you simply compile it yourself, putting it into /opt/bin is a very convenient approach, especially if all users have a $PATH that includes that non-standard executable directory. The location /opt/bin is also very good for programs that have non-standard naming and structure for their "non-managed" installation. For example: Program "foo": /opt/foo -> directory where it's located /opt/foo/program/foo -> the actual executable /opt/foo/assets/ -> various program components /opt/foo/temp/ -> a non-standard temporary storage Program "bar": /opt/bar -> again, program's base directory /opt/bar/labar.sh -> the executable (a launcher script) /opt/bar/stuff.dat -> program data /opt/bar/blah.txz -> further program data /opt/bar/baz.zip -> even more program data For convenient "program starters": /opt/bin/foo@ -> /opt/foo/program/foo /opt/bin/bar@ -> /opt/bar/labar.sh Now users can execute "foo" and "bar". In case a specific "preparation" is needed, the symlinks can be replaced with shell scripts that can, for example, set certain environment variables, create required dummy files or even change permissions if needed; they can also do "clean up" after the program terminated. As you can see, /opt, as it is not "regulated", can deal with "flat layouts", "custom trees" and anything just fine. :-) > It's of course merely a suggestion, but does help to keep /usr/local/bin > cleanly reserved for what gets installed via pkg/ports. Yes. That is the lesson of "man 7 hier". :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...