mirror of
https://github.com/YunoHost-Apps/ghost_ynh.git
synced 2024-09-03 19:16:02 +02:00
add log file for node process
This commit is contained in:
parent
821d2e08d2
commit
440d18168f
2 changed files with 6 additions and 2 deletions
|
@ -16,7 +16,7 @@
|
||||||
# PATH should only include /usr/* if it runs after the mountnfs.sh script
|
# PATH should only include /usr/* if it runs after the mountnfs.sh script
|
||||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||||
DESC="Ghost"
|
DESC="Ghost"
|
||||||
NAME=ghost
|
NAME=ynh-app-ghostblog
|
||||||
GHOST_ROOT=/home/yunohost.app/ghostblog/ghost
|
GHOST_ROOT=/home/yunohost.app/ghostblog/ghost
|
||||||
GHOST_GROUP=ghostblog
|
GHOST_GROUP=ghostblog
|
||||||
GHOST_USER=ghostblog
|
GHOST_USER=ghostblog
|
||||||
|
@ -24,6 +24,7 @@ DAEMON=/usr/bin/node
|
||||||
DAEMON_ARGS="$GHOST_ROOT/index.js"
|
DAEMON_ARGS="$GHOST_ROOT/index.js"
|
||||||
PIDFILE=/var/run/yunohost/ghostblog/$NAME.pid
|
PIDFILE=/var/run/yunohost/ghostblog/$NAME.pid
|
||||||
SCRIPTNAME=/etc/init.d/$NAME
|
SCRIPTNAME=/etc/init.d/$NAME
|
||||||
|
LOGFILE="/var/log/$NAME.log"
|
||||||
export NODE_ENV=production
|
export NODE_ENV=production
|
||||||
|
|
||||||
# Exit if the package is not installed
|
# Exit if the package is not installed
|
||||||
|
@ -58,9 +59,10 @@ do_start()
|
||||||
--chuid $GHOST_USER:$GHOST_GROUP --chdir $GHOST_ROOT --background \
|
--chuid $GHOST_USER:$GHOST_GROUP --chdir $GHOST_ROOT --background \
|
||||||
--pidfile $PIDFILE --make-pidfile --exec $DAEMON --test > /dev/null \
|
--pidfile $PIDFILE --make-pidfile --exec $DAEMON --test > /dev/null \
|
||||||
|| return 1
|
|| return 1
|
||||||
|
|
||||||
start-stop-daemon --start --quiet \
|
start-stop-daemon --start --quiet \
|
||||||
--chuid $GHOST_USER:$GHOST_GROUP --chdir $GHOST_ROOT --background \
|
--chuid $GHOST_USER:$GHOST_GROUP --chdir $GHOST_ROOT --background \
|
||||||
--pidfile $PIDFILE --make-pidfile --exec $DAEMON -- $DAEMON_ARGS \
|
--pidfile $PIDFILE --make-pidfile --exec /bin/bash -- -c "exec $DAEMON $DAEMON_ARGS >> $LOGFILE 2>&1" \
|
||||||
|| return 2
|
|| return 2
|
||||||
# Add code here, if necessary, that waits for the process to be ready
|
# Add code here, if necessary, that waits for the process to be ready
|
||||||
# to handle requests from services started subsequently which depend
|
# to handle requests from services started subsequently which depend
|
||||||
|
|
|
@ -44,6 +44,8 @@ sed -i "s@YNH_LOCATION@$path@g" ../conf/nginx.conf
|
||||||
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/ghostblog.conf
|
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/ghostblog.conf
|
||||||
|
|
||||||
echo "Init script..."
|
echo "Init script..."
|
||||||
|
sudo touch /var/log/ynh-app-ghostblog.log
|
||||||
|
sudo chown ghostblog: /var/log/ynh-app-ghostblog.log
|
||||||
sudo cp ../conf/init-script /etc/init.d/ynh-app-ghostblog
|
sudo cp ../conf/init-script /etc/init.d/ynh-app-ghostblog
|
||||||
sudo chmod +x /etc/init.d/ynh-app-ghostblog
|
sudo chmod +x /etc/init.d/ynh-app-ghostblog
|
||||||
sudo update-rc.d ynh-app-ghostblog defaults
|
sudo update-rc.d ynh-app-ghostblog defaults
|
||||||
|
|
Loading…
Add table
Reference in a new issue