Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Dev

run as another system user

 

 

Catalyst dev RSS feed   Index | Next | Previous | View Threaded


chunziatperlchina.org

Jul 16, 2005, 12:51 PM

Post #1 of 2 (1172 views)
Permalink
run as another system user

I am writing a webmail using Catalyst, and wanner it runging as
'vpopmail' user, so it can
read or write some mail files under the Maildirs.

Here is my script, is that right? at least it will print 'vpopmail' when
call system whoami in the script.

BEGIN {
$ENV{CATALYST_ENGINE} ||= 'HTTP';
$ENV{CATALYST_SCRIPT_GEN} = 4;
use User::pwent;
use User::grent;
$pw = getpwnam('vpopmail');
$< = $> = $pw->uid();
$( = $) = $pw->gid();
}

could catalyst support somthing like 'perl myapp_server.pl -u vpopmail'
to let it run as user 'vpopmail' ?


sriatoook.de

Jul 16, 2005, 4:32 PM

Post #2 of 2 (1095 views)
Permalink
run as another system user [In reply to]

Am 16.07.2005 um 12:53 schrieb chunzi:

> I am writing a webmail using Catalyst, and wanner it runging as
> 'vpopmail' user, so it can
> read or write some mail files under the Maildirs.
>
> Here is my script, is that right? at least it will print 'vpopmail'
> when
> call system whoami in the script.
>
> BEGIN {
> $ENV{CATALYST_ENGINE} ||= 'HTTP';
> $ENV{CATALYST_SCRIPT_GEN} = 4;
> use User::pwent;
> use User::grent;
> $pw = getpwnam('vpopmail');
> $< = $> = $pw->uid();
> $( = $) = $pw->gid();
> }
>
> could catalyst support somthing like 'perl myapp_server.pl -u
> vpopmail'
> to let it run as user 'vpopmail' ?

It could, but keep in mind that the built in server is meant mostly
for development, for real deployment i'd only use mod_perl, FastCGI
and the like.
Maybe it's better to have this in Catalyst::Manual::Cookbook!

To add something to the cookbook, just post it to the wiki at http://
dev.catalyst.perl.org , we (Jesse) will merge it in for you. ;)


--
sebastian

Catalyst dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.