From 4a3d89762a2fe4b17c858a6167fc8f6614db2c66 Mon Sep 17 00:00:00 2001 From: Julien Malik Date: Wed, 19 Mar 2014 22:45:16 +0100 Subject: [PATCH] avoid repeating pid dir path --- TODO.org | 2 +- conf/init-script | 7 ++++--- scripts/install | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/TODO.org b/TODO.org index cc0189a..ddcf4a3 100644 --- a/TODO.org +++ b/TODO.org @@ -8,7 +8,7 @@ ** http://docs.ghost.org/usage/configuration/ * DONE add to ynh service list ** how do i do that ?? -* TODO reduce size of install tree +* DONE reduce size of install tree admin@yunohost:/home/yunohost.app/ghostblog$ du -sh * 50M ghost diff --git a/conf/init-script b/conf/init-script index 9e270bd..7083d52 100644 --- a/conf/init-script +++ b/conf/init-script @@ -22,7 +22,8 @@ GHOST_GROUP=ghostblog GHOST_USER=ghostblog DAEMON=/usr/bin/node DAEMON_ARGS="$GHOST_ROOT/index.js" -PIDFILE=/var/run/yunohost/ghostblog/$NAME.pid +PIDFILEDIR=/var/run/yunohost/ghostblog +PIDFILE=$PIDFILEDIR/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME LOGFILE="YNH_LOGFILE" export NODE_ENV=production @@ -49,8 +50,8 @@ VERBOSE=yes do_start() { # Set up folder structure - mkdir -p /var/run/yunohost/ghostblog - chown -R $GHOST_USER:$GHOST_GROUP /var/run/yunohost/ghostblog + mkdir -p $PIDFILEDIR + chown -R $GHOST_USER:$GHOST_GROUP $PIDFILEDIR # Return # 0 if daemon has been started # 1 if daemon was already running diff --git a/scripts/install b/scripts/install index 7028012..1b7d2ca 100644 --- a/scripts/install +++ b/scripts/install @@ -32,8 +32,8 @@ sudo su --shell /bin/bash --command "cd $final_path/ghost && npm install --produ echo "Cleaning up install tree..." sudo rm -rf $final_path/.npm -find $final_path -type d | grep test$ | xargs sudo rm -rf -find $final_path -type d | grep tests$ | xargs sudo rm -rf +find $final_path -type d | grep "test$" | xargs sudo rm -rf +find $final_path -type d | grep "tests$" | xargs sudo rm -rf sudo rm -rf $final_path/ghost/node_modules/sqlite3/build echo "Deploying configuration..."