Skip to content

Commit

Permalink
🎨 🐛 revert to simple systemd service
Browse files Browse the repository at this point in the history
- due to systemd/systemd#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
  • Loading branch information
acburdine committed Nov 18, 2016
1 parent fc65f04 commit 3e53266
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
6 changes: 4 additions & 2 deletions lib/process/index.js
Expand Up @@ -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() {
Expand Down
5 changes: 2 additions & 3 deletions lib/process/systemd/ghost.service.template
Expand Up @@ -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
6 changes: 0 additions & 6 deletions lib/process/systemd/index.js
Expand Up @@ -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');
}
});

0 comments on commit 3e53266

Please sign in to comment.