Skip Menu |
 

This queue is for tickets about the App-perlbrew CPAN distribution.

Report information
The Basics
Id: 78742
Status: new
Priority: 0/
Queue: App-perlbrew

People
Owner: Nobody in particular
Requestors: ether [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.46
Fixed in: (no value)



Subject: feature request: direct command to use the perlbrew configuration for the given user
Download (untitled) / with headers
text/plain 1.5k
Currently, the only automatic way to access a perlbrew environment is to use a login shell for that user, which is not doable for system processes and daemons, which are frequently started up as another user and then the uid is switched. There needs to be a way of saying "initialize the perlbrew environment for this user" directly through the perlbrew executable, rather than depending on bash scripts which are executed indirectly via the shell. Here's a usecase I'm starting to run into frequently: I start up a process as the root user (e.g. /etc/init.d/my_service start). I don't want root to be using anything but the system perl, so this process doesn't know anything about perlbrew. This service is going to change its uid and exec another process - which is my service that runs under a perlbrew available to that user. We need to have access to that user's $PATH (including the perlbrew paths) in order to even find this service... Right now, I'm doing this: "exec bash -c source /home/$NEWUSER/.perlbrew/init && source $PERLBREW_ROOT/etc/bashrc && my_real_program". (Where my_real_program is in a perlbrew bin directory). However, this is dependent on internal details to perlbrew (knowing where and how it stores its configuration), which I think is too fragile. What would be much nicer is: "exec perlbrew run --user $NEWUSER my_real_program", or perhaps "exec bash -c perlbrew reinit && my_real_program" - which would initialize the perlbrew environment for the current uid (NOT $USER, as that value is not correct - it's still "root"!) and then run the program.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.