5 ms·
Shit can and will break if you mess with your OS. Updating a program I use should never constitute "messing" with my OS, it should constitute "using". Why sho
by dagw 16y ago
Shit can and will break if you mess with your OS.
Updating a program I use should never constitute "messing" with my OS, it should constitute "using". Why should I as an OS user have to constantly worry about upsetting the OS maker? Why should I have to jump through obscure hoops just to install some software without breaking my OS?
Wouldn't a better solution be for the OS makers to wall off their magic python behind some wall where I cannot see, touch nor use it, and let me install whatever python I want without fear.
- nailer 16y agoFirstly: no hoops are required to install any version of python or any required Python module your app needs: * Just use pip and virtualenv. * Your OS remains intact, and you get better deployment for free! Replacing a component of your OS (Python 2.x) with another one (python 2.x +1 ) affects: * The OS installer (Anaconda on RHEL, Ubuntu'sequivalent) * The packaging system (yum) * Many GNOME system admin apps. * The config management tools (puppet sits on ruby)
- dagw 16y agoMy point is that /usr/bin/python probably shouldn't be a core OS component. /usr/bin/python should be whatever I want it to be. The core OS-component should be something like /sys/bin/centos-python which I will never directly use, touch or even necessarily know about. The bottom line I guess is that mixing core OS components and user installed software in the same directory structure with no way of differentiating them is simply bad design.
- munchhausen 16y ago> /usr/bin/python should be whatever I want it to be. Why /usr/bin/python? /usr/bin/ has been for ages the "system" area - why would you want to suddenly usurp it for yourself? /usr/local/bin/python will on most Linux systems be executed ahead of /usr/bin/python, because /usr/local/bin/ usually precedes /usr/bin/ on the $PATH. Thus you can have your cake and eat it too. > The bottom line I guess is that mixing core OS components and user installed software in the same directory structure with no way of differentiating them is simply bad design. Linux distro makers agree with you - if you do not customize environment variables, user-installed software goes into /usr/local/ and the OS package-management (which can be considered "system" I guess) puts executables into /usr/{bin,sbin}. This tends to work well as long as you keep in mind that everything outside of /usr/local/ (or your customized installation path) may at any update change subject to the will of the "system". I think this is a reasonable setup - it gives the OS vendor the ability to update the system, while giving you free reign in your /usr/local/ playground.
- dagw 16y agoOS package-management (which can be considered "system" I guess) This is where I and the distro makers disagree. When I use synaptic to install the latest version of foobar, that is not in anyway "system" and foobar should not be dumped in the same directory as core system binaries. There should be a directory that contains everything core to the OS (like python 2.4), which was only updated by the OS updater routine (which should be different from the update all the software I've installed routine). Then there should be a directory which contains everything I've chosen to install (like python 2.7) which is where everything that I install via whatever is the normal way to install things on that OS ends up. I don't care too much about what these directories are called, but having them be the same, as it is now, is not an ideal solution in my mind.
- lmz 16y agoIt seems like you want BSD ports, or some alternate package repository that has /usr/local as the root. The packages from the OS repository are the OS.
- munchhausen 16y agoWe're getting into the debate of what constitutes a "core system", and I'm afraid there's as many answers to this question as there are debaters. As far as the update routines are concerned - you can already have those, by self-selecting which packages do you want to update. As a pro-active measure, you can even lock down packages which should never be updated. This seems to be fine to me - the advanced user has the means to control the update mechanism, and the casual user can just do an all-encompassing "apt-get upgrade" or an equivalent to make sure that she has all the security fixes.
- nailer 16y agobecause, as the other poster mentions, /usr/bin has been a place for non-essential (not required by the machine to boot) software for thirty five years.
- dagw 16y agoI know, but that doesn't necessarily make it a good solution. I've been a sys admin for several large unix systems and variations on the problem Zed describes needed to be hacked around on each and every one of them.
- nailer 16y agoI think we agree. If I were doing an OS now, I'd also ignore the FHS completely, but more to the point: I wouldn't use anything that remotely resembles it either. / would have one dir: /myos And all OS components are under there: /myos/bin/python People can install anything they want outside /myos, but I'd make it very clear that the OS owns this folder and it should not be modified.
- dagw 16y agoYup, that's basically what I'm looking for.
- nailer 16y agoI did a little work on this a while back - an LFS system is a good place to start. I was a little ambitious though - I wanted a pure C/python system with no shells (at all - just ipython) and no command scraping - just enough to start SSH and nginx. It's a lot of work - I think I ended up trying to write an iproute2 replacement using ctypes and quit. I wonder if anyone else would be interested...
- gaius 16y agoIn the ancient days, stuff the OS relied on was in /usr/sbin and stuff that was "yours" was in /usr/local/bin (or /opt) and stuff that no-one was quite sure whose it was was in /usr/bin. And lo, peace and harmony did reign upon the face of Unix. And the sysadmin did lie down with the developer, and it was good. Who even knows how it works these days?
- nailer 16y agoStuff that belongs to the OS (but runnable by all users) is in /usr/bin. That's FHS. Stuff that's yours is wherever dir you specified when you ran: export WORKON_HOME=$HOME/.virtualenvs Seriously. Use virtualenv (and virtualenvwrapper). http://www.doughellmann.com/projects/virtualenvwrapper/ http://www.doughellmann.com/projects/virtualenvwrapper/
- dagw 16y agoWhat about stuff that belongs to me (the sysadmin) but runnable by all users? /usr/local/bin? /opt/bin? /my/homemade/solution/bin? There is a bunch of stuff that doesn't (shouldn't) belong to the OS, but still be runnable by all users without all of them needing a copy in their $HOME directory.
- munchhausen 16y agoYou answered your own question - /usr/local/bin. I don't know about MacOSX but on Linux, this is the solution to your problem - "stuff that belongs to me (the sysadmin) but runnable by all users".
- gaius 16y agoWell exactly. People who never learnt the old-skool ways always reinvent the wheel in an over-complex way. /usr/local/bin is stuff for the users, but which the sysadmin installs. So /usr/bin/python for the OS and /usr/local/bin/python for your users.
- nailer 16y ago> What about stuff that belongs to me (the sysadmin) but runnable by all users? If you're writing quick ad-hoc scripts and don't have time to package, /usr/local/bin. Per above, Python is used by your OS. It's installed by default, and not uninstallable, because the OS needs it. We can't and probably don't want to change that, so we'll need to live with it. Use virtualenv. if you need to to, install a quick Python 2.6 package that slots alongside your OS package rather than removing it - using RHEL 5 as an example, you'd install 'python26' alongside your existing 'python' package.
- deleted 16y ago[deleted]