-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Service: Php Fastcgi #14
Comments
I've updated description and replaced the init.d scripts with upstart equivalent. chmod +x /usr/local/bin/php-fastcgi
-Create `/etc/init.d/php-fastcgi` with:
+Create `/etc/init/php-fastcgi.conf` with:
- #!/bin/bash
+ description "PHP Fastcgi daemon"
- PHP_SCRIPT=/usr/local/bin/php-fastcgi
- FASTCGI_USER=deploy
- FASTCGI_GROUP=deploy
- PID_DIR=/var/run/php-fastcgi
- PID_FILE=/var/run/php-fastcgi/php-fastcgi.pid
- RET_VAL=0
+ start on (local-filesystems and net-device-up)
+ stop on runlevel [!2345]
+
+ expect daemon
+ respawn
- case "$1" in
- start)
- if [[ ! -d $PID_DIR ]]
- then
- mkdir $PID_DIR
- chown $FASTCGI_USER:$FASTCGI_GROUP $PID_DIR
- chmod 0770 $PID_DIR
- fi
- if [[ -r $PID_FILE ]]
- then
- echo "php-fastcgi already running with PID `cat $PID_FILE`"
- RET_VAL=1
- else
- $PHP_SCRIPT
- RET_VAL=$?
- fi
- ;;
- stop)
- if [[ -r $PID_FILE ]]
- then
- kill `cat $PID_FILE`
- rm $PID_FILE
- RET_VAL=$?
- else
- echo "Could not find PID file $PID_FILE"
- RET_VAL=1
- fi
- ;;
- restart)
- if [[ -r $PID_FILE ]]
- then
- kill `cat $PID_FILE`
- rm $PID_FILE
- RET_VAL=$?
- else
- echo "Could not find PID file $PID_FILE"
- fi
- $PHP_SCRIPT
- RET_VAL=$?
- ;;
- status)
- if [[ -r $PID_FILE ]]
- then
- echo "php-fastcgi running with PID `cat $PID_FILE`"
- RET_VAL=$?
- else
- echo "Could not find PID file $PID_FILE, php-fastcgi does not appear
-to be running"
- fi
- ;;
- *)
- echo "Usage: php-fastcgi {start|stop|restart|status}"
- RET_VAL=1
- ;;
- esac
- exit $RET_VAL
+ exec /usr/local/bin/php-fastcgi
Run:
- chmod +x /etc/init.d/php-fastcgi
- update-rc.d php-fastcgi defaults
- service php-fastcgi start
+ start php-fastcgi |
Branch is created from issue-12 and issue-13 branch |
Changed PID folder to /var/run as /var/run/php-fastcgi dissapears on reboot. |
No problem. |
I've updated the description with: Create
The previous |
Depends on Php and Fastcgi.
Create
/etc/init/php-fastcgi.conf
with:Run:
The text was updated successfully, but these errors were encountered: