Add unbound service

This commit is contained in:
Girish Ramakrishnan
2018-12-02 19:38:21 -08:00
parent 6d128595e7
commit 7c1ef143f9
4 changed files with 44 additions and 0 deletions
+21
View File
@@ -206,6 +206,11 @@ const KNOWN_SERVICES = {
status: statusDocker,
restart: restartDocker,
defaultMemoryLimit: 0
},
unbound: {
status: statusUnbound,
restart: restartUnbound,
defaultMemoryLimit: 0
}
};
@@ -1680,3 +1685,19 @@ function restartDocker(callback) {
callback(null);
}
function statusUnbound(callback) {
assert.strictEqual(typeof callback, 'function');
shell.exec('statusUnbound', 'systemctl is-active unbound', function (error) {
callback(null, { status: error ? exports.ADDON_STATUS_STOPPED : exports.ADDON_STATUS_ACTIVE });
});
}
function restartUnbound(callback) {
assert.strictEqual(typeof callback, 'function');
shell.sudo('restartunbound', [ path.join(__dirname, 'scripts/restartunbound.sh') ], {}, NOOP_CALLBACK);
callback(null);
}