From 3e53266dbfceeb003713cee4eabcbdd3ed93d3fb Mon Sep 17 00:00:00 2001 From: Austin Burdine Date: Fri, 18 Nov 2016 14:23:35 -0600 Subject: [PATCH] :art: :bug: revert to simple systemd service - due to https://github.com/systemd/systemd/issues/2739, the systemd-notify utility has issues when running as a non-root user. Dropping back to a simple service until a new solution can be figured out --- lib/process/index.js | 6 ++++-- lib/process/systemd/ghost.service.template | 5 ++--- lib/process/systemd/index.js | 6 ------ 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/lib/process/index.js b/lib/process/index.js index 7b3c5f5f4..9a25dd23a 100644 --- a/lib/process/index.js +++ b/lib/process/index.js @@ -41,8 +41,10 @@ module.exports = BaseProcess = CoreObject.extend({ // base implementation - does nothing }, - error: function error() { - // base implementation - does nothing + error: function error(error) { + // To make sure errors get output if there's no error + // implementation, we throw the error here. + throw error; }, setup: function setup() { diff --git a/lib/process/systemd/ghost.service.template b/lib/process/systemd/ghost.service.template index f0e944075..72feb13aa 100644 --- a/lib/process/systemd/ghost.service.template +++ b/lib/process/systemd/ghost.service.template @@ -3,13 +3,12 @@ Description=Ghost systemd service for blog: <%= name %> # Documentation=add documentation link here [Service] -Type=notify -NotifyAccess=all +Type=simple WorkingDirectory=<%= dir %> User=<%= user %> Environment="NODE_ENV=<%= environment %>" ExecStart=<%= ghost_exec_path %> run -Restart=on-failure +Restart=always [Install] WantedBy=multi-user.target diff --git a/lib/process/systemd/index.js b/lib/process/systemd/index.js index de90b7994..472451cf5 100644 --- a/lib/process/systemd/index.js +++ b/lib/process/systemd/index.js @@ -51,11 +51,5 @@ module.exports = BaseProcess.extend({ execSync('systemctl stop ' + this.service, { stdio: ['inherit', 'inherit', 'inherit'] }); - }, - - success: function success() { - // This seems to work better than execSync, probably because it's - // asynchronous and thus doesn't interfere with the event loop - require('child_process').exec('systemd-notify --ready'); } });