3 ms·
> * Install NPM in a way that you can upgrade easily. Your package manager was designed to do this, so use it. Never ever put untracked files in the system dire
by nailer 11y ago
> * Install NPM in a way that you can upgrade easily. Your package manager was designed to do this, so use it. Never ever put untracked files in the system directories.
The articles uses the package manager - specifically, the article directs people to install node using nodesource's RPM and dpkg node packages (npm is included with node), and only mentions tarballs if these don't exist for your OS.
> * Schedule when and how you upgrade your operating system, NPM, and your application. To do this you need a way to take an application out of production, which brings us to...
> You generally want a load balancer or some sort of web server between the world and your application.
Hence covering that and load balancing with HAProxy in the article. This is mentioned in the introduction.
> * And most importantly, document this down to every command in the internal wiki! Even better, write a Puppet/Salt/Ansible file and put it under version control.
Hence mentioning exactly that in the opening few paragraphs.
It's very clear you didn't read the article before commenting.
- kiallmacinnes 11y ago>> * Install NPM in a way that you can upgrade easily. Your package manager was designed to do this, so use it. Never ever put untracked files in the system directories. > The articles uses the package manager - specifically, the article directs people to install node using nodesource's RPM and dpkg node packages (npm is included with node), and only mentions tarballs if these don't exist for your OS. Sure, but it also advises users that it's generally OK to extract tarballs into /usr/local. While this clearly is OK in some circumstances, the target audience for this article clearly aren't in a position to make that decision, or understand the consequences of doing this. The article could have suggested "/opt/node" for example and avoided the issue at the expense of explaining how PATH variables work.
- nailer 11y agoSo you'd prefer, if no packages are available, unpackaged software be installed to /opt rather than /usr/local? OK. The FHS forbids distros from installing software to either location. See http://www.pathname.com/fhs/2.2/fhs-4.9.html http://www.pathname.com/fhs/2.2/fhs-4.9.html: > "The /usr/local hierarchy is for use by the system administrator when installing software locally. It needs to be safe from being overwritten when the system software is updated. It may be used for programs and data that are shareable amongst a group of hosts, but not found in /usr."
- kiallmacinnes 11y ago> So you'd prefer, if no packages are available, unpackaged software be installed to /opt rather than /usr/local? OK. Ah, I did miss the subfolder. This is a very unusual convention for installation into /usr/local. Typically, this is what modern day usage of /opt looks like. > The FHS forbids distros from installing software to either location. > See http://www.pathname.com/fhs/2.2/fhs-4.9.html http://www.pathname.com/fhs/2.2/fhs-4.9.html: Correct, both options are valid per the FHS. Yet, the description for /opt describes the pattern used in your example. See http://www.pathname.com/fhs/2.2/fhs-3.12.html http://www.pathname.com/fhs/2.2/fhs-3.12.html: "A package to be installed in /opt must locate its static files in a separate /opt/<package> directory tree, where <package> is a name that describes the software package."
- nailer 11y agoI see your point - I used to be reticent to use /opt since it was a bit of a Solaris-ism (it only got added to the FHS because the proprietary Unixes kept asking for it). I'm thinking about changing it to /opt instead (and will credit you if I do it), alas /opt/bin isn't in $PATH on most distros.
- merb 11y agoThey can't just add /opt/bin to $PATH Read the link he wrote down: > Programs to be invoked by users must be located in the > directory /opt/<package>/bin. If the package includes UNIX > manual pages, they must be located in /opt/<package>/man > and the same substructure as /usr/share/man must be used. Static packages should be kept together as /opt/myprogramm and mostly follow the same structure as /usr than so like: /opt/myprogramm/bin /opt/myprogramm/include /opt/myprogramm/lib ... Mostly I put my programs there, too. /opt/app1 /opt/app2
- nailer 11y agonod that's the thing - you'll break the interpreter for every node app - '#!/usr/bin/env node' - if you don't have node in $PATH. And as you say. /opt apps normally aren't in $PATH. Looks like /usr/local wins.