eventlog: add service rebuild/restart/configure events

This commit is contained in:
Girish Ramakrishnan
2021-09-24 10:22:45 -07:00
parent 05e8339555
commit d90beb18d4
7 changed files with 50 additions and 20 deletions
+2 -2
View File
@@ -99,7 +99,7 @@ async function add(volume, auditSource) {
eventlog.add(eventlog.ACTION_VOLUME_ADD, auditSource, { id, name, hostPath: volume.hostPath });
// in theory, we only need to do this mountpoint volumes. but for some reason a restart is required to detect new "mounts"
safe(services.rebuildService('sftp'), { debug });
safe(services.rebuildService('sftp', auditSource), { debug });
const collectdConf = ejs.render(COLLECTD_CONFIG_EJS, { volumeId: id, hostPath: volume.hostPath });
await collectd.addProfile(id, collectdConf);
@@ -152,7 +152,7 @@ async function del(volume, auditSource) {
eventlog.add(eventlog.ACTION_VOLUME_REMOVE, auditSource, { volume });
if (volume.mountType === 'mountpoint' || volume.mountType === 'filesystem') {
safe(services.rebuildService('sftp'), { debug });
safe(services.rebuildService('sftp', auditSource), { debug });
} else {
await safe(mounts.removeMount(volume));
}