Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Fedora 29 upgrade

by Fletch (Bishop)
on Aug 08, 2019 at 14:22 UTC ( [id://11104181]=note: print w/replies, xml ) Need Help??


in reply to Re: Fedora 29 upgrade
in thread Fedora 29 upgrade

Seconding this advice. The effort is more worth it when you're not scrambling because your application doesn't break when the OS' perl gets changed underneath it because the corporate IT people pushed a newer package to your systems without consulting you.

Not that I speak from experience here or anything . . . *cough*

The cake is a lie.
The cake is a lie.
The cake is a lie.

Replies are listed 'Best First'.
Re^3: Fedora 29 upgrade - perlbrewing
by bliako (Monsignor) on Aug 08, 2019 at 22:44 UTC

    I am at the moment starting some fresh fedora install and I am doing just that with the additional twist that I want perlbrew-managed perls to be installed by superuser(=root) so that all users can use them without each installing their own. Additionally I want root to install a good deal of common modules (e.g. LWP) for all users. After that, if users need to install obscure modules in their own private/home dirs, it is up to them. Or they ask superuser to install it for everybody in public dir.

    I have found that this setup entails some danger.

    Because I do not want root to have in their login/startup script all those perlbrew-related variables. Perhaps that's a purist view but I opted for creating a script for root to use whenever is going to need to do perlbrew-housekeeping and not having that same commands in root's .bashrc. Something like:

    #!/bin/sh # this is bin/use-perlbrew.sh (not part of ~/.bashrc) export PERLBREW_ROOT=/opt/perlbrew export PERLBREW_HOME=${HOME}/.perlbrew source ${PERLBREW_ROOT}/etc/bashrc CMD="perlbrew use perl-5.30.0" echo "$0 : executing: ${CMD}" eval ${CMD} if [ $? -ne 0 ]; then echo "$0 : command has failed ${CMD}"; exit 1; f +i

    So, on login, root uses system perl and does not know about any perlbrew stuff. If root has to install perlbrew-wise modules then runs above script first (EDIT: via source ~/bin/use-perlbrew.sh). I find this cleaner than staffing root's .bashrc with tom, dick and harry.

    I am aware that perlbrew can manage the system perl as well with just a symlink - no need of re-installing it (thanks to https://stackoverflow.com/questions/25188575/switching-to-the-system-perl-using-perlbrew). So one can suggest adding the perlbrew variables+source in root's .bashrc and immediately after that add perlbrew use system.

    I suspect my dislike of that is cargo-culting. Anyone knows better? (I think I will SOPW this)

    45 min EDIT: gaining root access via plain su inherits all env vars from current shell. Which includes all the perlbrew variables the calling user had. su --login stops that and is the proper way to gain root access if not doing it from the login screen.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11104181]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-24 11:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found