Browse files

Specify php path option in init script

On bitnami sugarcrm instances, the path isn't set when the init script executes so I added a new config options to allow an explicit path to be specified.
  • Loading branch information...
1 parent b506fed commit dd670a62c239aade6fae9be6b304acc8598c0cba @blak3r2 blak3r2 committed Jan 10, 2013
Showing with 8 additions and 3 deletions.
  1. +8 −3 misc/asterisk_logger
11 misc/asterisk_logger
@@ -14,12 +14,16 @@
# EDIT the USER and SUGAR_ROOT Variables below and read note in start_logger() below
# USER isn't used unless you use the more secure version in start_logger
+# PHP_BIN - set this to the result of 'which php'. (ex. /usr/bin/php)
+# This will avoid any issues where path isn't set yet before init script runs.
# Shouldn't need to edit any of these...
-DAEMON="php $SUGAR_ROOT/custom/modules/Asterisk/$PROC.php"
+DAEMON="$PHP_BIN $SUGAR_ROOT/custom/modules/Asterisk/$PROC.php"
@@ -30,7 +34,8 @@ set -e
. /lib/lsb/init-functions
start_logger() {
- # Note: the commented line starting with "sudo" is the more secure approach but I've encountered
+ # Note: the lines that are commented out below (starting with "sudo") is the more secure approach as it lets
+ # you specify the user to start the daemon as but I've encountered
# errors such as "sorry, you must have a tty to run sudo" on certain boxes. So, the default method below
# will work more universally. You can try commenting the first line and uncommenting the second line
# and hope it works. Suggestions are welcomed on ways to improve this script.
@@ -72,4 +77,4 @@ case "$1" in
-exit 0
+exit 0

0 comments on commit dd670a6

Please sign in to comment.