3 ms·
Interesting; how would you isolate the system python from the user in Debian/Ubuntu. Do you have a link where I could learn more about this?
by rolandog 5y ago
Interesting; how would you isolate the system python from the user in Debian/Ubuntu. Do you have a link where I could learn more about this?
- pas 5y agoDon't put the system python in $PATH. Any command that needs the system python can be launched through a shim/wrapper script that sets the PATH. (Or even better to execute python directly to avoid passing the system python in PATH.)
- rolandog 5y agoWow. It never occurred to me to approach it that way, thanks!
- simonh 5y agoYou may not be able to completely, but basically if users can write python scripts and run them using system python that's a side effect. It's purpose is to run system scripts, and any other use must not interfere or compete with that in any way. To be hones that wasn't always the case. In the early days Python was provided on these systems for users just as much as administrators and in the early days there weren't any system script as part of the OS that used it. However now there are, and the packaging and configuration of the system python has in some cases even been mangled somewhat to suit the needs of the distro. It's time to make a clean split between system python and user/developer python.
- dagw 5y agoI would start by putting it in a path that won't be included in the users default $PATH, perhaps /sbin or /usr/sbin
- rolandog 5y agoOoh, this sounds quite nice. And it would also be compliant with the Filesystem Hierarchy Standard.