Add nginx service

We had a case where nginx was not picking up renewed certs. Not sure
if it's a bug in our code or nginx.
This commit is contained in:
Girish Ramakrishnan
2019-04-12 09:47:05 -07:00
parent d170a3e5e1
commit e31d413551

View File

@@ -221,6 +221,11 @@ const KNOWN_SERVICES = {
status: statusGraphite,
restart: restartContainer.bind(null, 'graphite'),
defaultMemoryLimit: 75 * 1024 * 1024
},
nginx: {
status: statusNginx,
restart: restartNginx,
defaultMemoryLimit: 0
}
};
@@ -1726,6 +1731,22 @@ function restartUnbound(callback) {
callback(null);
}
function statusNginx(callback) {
assert.strictEqual(typeof callback, 'function');
shell.exec('statusNginx', 'systemctl is-active nginx', function (error) {
callback(null, { status: error ? exports.SERVICE_STATUS_STOPPED : exports.SERVICE_STATUS_ACTIVE });
});
}
function restartNginx(callback) {
assert.strictEqual(typeof callback, 'function');
shell.sudo('reloadnginx', [ path.join(__dirname, 'scripts/reloadnginx.sh') ], {}, NOOP_CALLBACK);
callback(null);
}
function statusSftp(callback) {
assert.strictEqual(typeof callback, 'function');