Permalink
Browse files

Fix check_compile with $USER.

Copied use of `sudo` from the PGXN Manager start script.
  • Loading branch information...
1 parent d64d6a8 commit bc94b86fd365db09192e495b68aeebc3ef7206ea @theory theory committed Nov 9, 2011
Showing with 7 additions and 7 deletions.
  1. +7 −7 eg/debian_init
View
@@ -71,17 +71,17 @@ check_running() {
}
check_compile() {
- # if [ -n "$USER" ] ; then
- # if su $USER -c "cd $APPDIR ; perl -Ilib -M$APPNAME -c $PLACKUP" ; then
- # return 0
- # fi
- # return 1
- # else
+ if [ -n "$USER" ] ; then
+ if cd $APPDIR ; sudo -u $USER perl -Ilib -M$APPNAME -c $PLACKUP ; then
+ return 0
+ fi
+ return 1
+ else
if ( cd $APPDIR ; perl -Ilib -M$APPNAME -c $PLACKUP ) ; then
return 0
fi
return 1
- # fi
+ fi
}
_start() {

0 comments on commit bc94b86

Please sign in to comment.