diff --git a/TODO.org b/TODO.org index fa4e683..cc0189a 100644 --- a/TODO.org +++ b/TODO.org @@ -6,7 +6,7 @@ * DONE mail in config.js : what's this ? ** mails are working ** http://docs.ghost.org/usage/configuration/ -* BLOCKED add to ynh service list +* DONE add to ynh service list ** how do i do that ?? * TODO reduce size of install tree admin@yunohost:/home/yunohost.app/ghostblog$ du -sh * diff --git a/conf/init-script b/conf/init-script index a3fb78d..9097706 100644 --- a/conf/init-script +++ b/conf/init-script @@ -24,7 +24,7 @@ DAEMON=/usr/bin/node DAEMON_ARGS="$GHOST_ROOT/index.js" PIDFILE=/var/run/yunohost/ghostblog/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME -LOGFILE="/var/log/$NAME.log" +LOGFILE="YNH_LOGFILE" export NODE_ENV=production # Exit if the package is not installed diff --git a/scripts/install b/scripts/install index 27013d1..5ae8e0f 100644 --- a/scripts/install +++ b/scripts/install @@ -46,13 +46,16 @@ sed -i "s@YNH_LOCATION@$path@g" ../conf/nginx.conf sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/ghostblog.conf echo "Init script..." +logfile=/var/log/ghostblog.log sudo touch /var/log/ynh-app-ghostblog.log sudo chown ghostblog: /var/log/ynh-app-ghostblog.log sed -i "s@YNH_FINALPATH@$final_path@g" ../conf/init-script +sed -i "s@YNH_LOGFILE@$logfile@g" ../conf/init-script sudo cp ../conf/init-script /etc/init.d/ynh-app-ghostblog sudo chmod +x /etc/init.d/ynh-app-ghostblog sudo update-rc.d ynh-app-ghostblog defaults sudo service ynh-app-ghostblog start +sudo yunohost app service ynh-app-ghostblog -l $logfile echo "Reloading Nginx..." if [ $is_public = "Yes" ]; diff --git a/scripts/remove b/scripts/remove index 8a6500e..907c2a4 100644 --- a/scripts/remove +++ b/scripts/remove @@ -7,6 +7,7 @@ sudo userdel --remove ghostblog sudo service ynh-app-ghostblog stop sudo update-rc.d ynh-app-ghostblog remove sudo rm /etc/init.d/ynh-app-ghostblog +sudo yunohost app service -R ynh-app-ghostblog sudo rm -f /etc/nginx/conf.d/$domain.d/ghostblog.conf