Created
May 25, 2012 15:17
-
-
Save riywo/2788722 to your computer and use it in GitHub Desktop.
perlbrew+extlibなアプリのcronとdaemontools
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* * * * * /home/riywo/MyApp/env perl -e 'print "$@"' > /tmp/hoge 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
export HOME=/home/riywo | |
cd ~/MyApp | |
source ~/perl5/perlbrew/etc/bashrc | |
perlbrew use perl-5.14.2 | |
export PERL5OPT="-Mlib=./extlib/lib/perl5" | |
export PATH="./extlib/bin:$PATH" | |
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
exec 2>&1 | |
exec setuidgid riywo \ | |
/home/riywo/MyApp/env \ | |
plackup -r -s Starman --workers 10 -a app.psgi |
そもそも共通化できたのと、sh -c使ってるとうまくシグナルが届いてなかった。
sh -c 'exec hogehoge'だったら多分シグナル大丈夫。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cronの方もsetuidgid使ってもいいのかも。