Running bin/app.pl with cleaner %ENV
Hello, I am playing with Dancer on my hobby project. On my hobby Debian Wheezy VPS. Now during development, of course I thousand times start and stop bin/app.pl just as it is described in the Quick Start. As real_me@here. Now set aside that this is not very good from security point (clean unprivileged user would be better), other thing that bothers me is extremely polluted %ENV---I like to inspect this variable from time to time and I'm definitely not interested in TERMCAP and LS_COLORS :) What is the correct way to run it? I have tried creating new (--system) user and suid-ing, but at this point * perl refused to run app.pl until I removed the env part. from the shebang line (i.e. `#!/usr/bin/perl` instead of `#!/usr/bin/env perl` * %ENV was polluted anyway I'm not the Linux pro as I would like to be, so maybe the above are not problems specific to Dancer. However, I think I got the message correctly that I was headed incorrect way. And since I was not able to find it in doc (sorry if I just suck at it), I thought asking would not hurt. So: What would be The Right Way of stop/running bin/app.pl thousand times a day (read: easily), provided I'm at a wild development stage? Thanks, aL. -- Alois Mahdal
Read <http://man.cx/env>. Start with empty environment: env -i /absolute/path/to/bin/perl -Mautodie=:all \ -e'exec($^X, "/absolute/path/to/bin/app.pl")' Empty, but keep certain useful variables: env -i PATH=$PATH LANG=$LANG /absolute/path/to/bin/perl \ -Mautodie=:all -e'exec($^X, "/absolute/path/to/bin/app.pl")' Delete certain variables, but keep the rest: perl -Mautodie=:all -e' delete @ENV{qw(LS_COLORS TERM)}; exec($^X, "/absolute/path/to/bin/app.pl"); ' All code is untested.
On 13-03-04 11:05 PM, Alois Mahdal wrote:
So: What would be The Right Way of stop/running bin/app.pl thousand times a day (read: easily), provided I'm at a wild development stage?
small note: in the early stages of development, you can always enable the 'auto_reload' configuration parameter (see Dancer::Config), which will auto-reload code as soon as the files change. If you are the type to add a method, try it, add another line, try it again, it might spare you doing the start/stop dance a couple of gazillion times. :-) Joy, `/anick
participants (3)
-
Alois Mahdal -
Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 -
Yanick Champoux