Comments (1)
Hello tlaverdure
I've create a linux init'd startup service script.
#!/bin/sh
### BEGIN INIT INFO
# Provides: Laravel Echo Server
# Description: Laravel Echo Server
### END INIT INFO
DAEMON_PATH="/path/to/laravel/root"
DAEMON="/path/to/laravel-echo-server"
NAME="laravel-echo-server"
SERVICE_NAME="Laravel Echo Server"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
start_service() {
echo -n " * Starting $SERVICE_NAME... "
cd "$DAEMON_PATH"
start-stop-daemon -Sq --chdir $DAEMON_PATH --background --quiet --make-pidfile --pidfile $PIDFILE --startas /bin/bash -- -c "exec $DAEMON start > /var/log/$NAME.log 2>&1"
e=$?
if [ $e -eq 1 ]; then
echo "already running"
return
fi
if [ $e -eq 255 ]; then
echo "couldn't start :("
exit 1
fi
echo "done"
}
stop_service() {
echo -n " * Stopping $SERVICE_NAME... "
start-stop-daemon -Kq -R 10 -p $PIDFILE
e=$?
if [ $e -eq 1 ]; then
echo "not running"
return
fi
echo "done"
}
status_service() {
printf "%-50s" "Checking $SERVICE_NAME..."
if [ -f $PIDFILE ]; then
PID=`cat $PIDFILE`
if [ -z "`ps axf | grep ${PID} | grep -v grep`" ]; then
printf "%s\n" "Process dead but pidfile exists"
exit 1
else
echo "Running"
fi
else
printf "%s\n" "Service not running"
exit 3
fi
}
case "$1" in
status)
status_service
;;
start)
start_service
;;
stop)
stop_service
;;
restart)
stop_service
start_service
;;
*)
echo "Usage: service $SERVICE_NAME {start|stop|restart|status}" >&2
exit 1
;;
esac
exit 0
from laravel-echo-server.
Related Issues (20)
- Is the package compromised? HOT 6
- Laravel-echo-server events listeners custom callbacks
- Redis6 ACL Support HOT 1
- 运行一会,就会中断,提示截图显示的错误 HOT 2
- Cannot find module '../dist/cli' - supervisord
- Redis 6 ACL config HOT 1
- Connection refused on docker
- Laravel Echo Server work and client side error only at server HOT 2
- Is there ways to emit data from client (socket.io-client) to laravel-echo-server? HOT 2
- Laravel Echo PresenceChannel vs listen events doesn't work HOT 2
- 使用Laravel 5.8 广播系统,本地研发没有事情,上线后握手阶段,第一次OK,第二次报502,第三次报session id unknown,现在不知道是那个地方出问题了?求帮助 HOT 1
- Is `tlaverdure/laravel-echo-server` abandoned? HOT 6
- Is the cors configuration even working? HOT 1
- echo server socket.io.js error
- support redis cluster
- Redis TTL key is store forever
- CSRF token mismatch after session timeout
- npx laravel-echo-server start HOT 1
- Unable to join channel. Member data for presence channel missing HOT 1
- Is this project compatible with Socket.io v4? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-echo-server.