summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2019-02-11 22:26:22 -0500
committerGunnar Mills <gmills@us.ibm.com>2019-02-20 12:32:52 -0600
commit8b37263fe11d6b8790121d09828dd57080e4cf29 (patch)
treeb18834f0614a0a3b0a981889dcf9ebc28e32e1ff
parent17c2f70586d94ce79e64a90e89e267983730bad8 (diff)
downloadopenbmc-docs-8b37263fe11d6b8790121d09828dd57080e4cf29.tar.gz
openbmc-docs-8b37263fe11d6b8790121d09828dd57080e4cf29.zip
anti-patterns: application install in /usr/sbin
Many OpenBMC applications install targets incorrectly place applications in /usr/sbin/ Tested: Copied into https://jbt.github.io/markdown-editor/ and app.grammarly.com. Change-Id: Ia18021b68ad2392b3fa5c860af36dba25210ee4b Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
-rw-r--r--anti-patterns.md35
1 files changed, 35 insertions, 0 deletions
diff --git a/anti-patterns.md b/anti-patterns.md
index 1adcaec..f00607f 100644
--- a/anti-patterns.md
+++ b/anti-patterns.md
@@ -160,3 +160,38 @@ launched. For example, given an application in /usr/bin:
```
sed -i s,/usr/bin/env ,/usr/bin/, foo.service
```
+
+## Placement of applications in /sbin or /usr/sbin
+
+### Identification
+OpenBMC applications that are installed in /usr/sbin. $sbindir in bitbake
+metadata, makefiles or configure scripts.
+
+### Description
+Installing OpenBMC applications in /usr/sbin violates the [principle of least
+astonishment](https://en.wikipedia.org/wiki/Principle_of_least_astonishment) and
+more importantly violates the
+[FHS](https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard).
+
+### Background
+The sbin anti-pattern exists because the FHS was misinterpreted at an early point
+in OpenBMC project history, and has proliferated ever since.
+
+From the hier(7) man page:
+
+```
+/usr/bin This is the primary directory for executable programs. Most programs
+executed by normal users which are not needed for booting or for repairing the
+system and which are not installed locally should be placed in this directory.
+
+/usr/sbin This directory contains program binaries for system administration
+which are not essential for the boot process, for mounting /usr, or for system
+repair.
+```
+The FHS description for /usr/sbin refers to "system administration" but the
+de-facto interpretation of the system being administered refers to the OS
+installation and not a system in the OpenBMC sense of managed system. As such
+OpenBMC applications should be installed in /usr/bin.
+
+### Resolution
+Install OpenBMC applications in /usr/bin/.
OpenPOWER on IntegriCloud