Skip to content
API Documentation
BastionGuard™
SaneSecurityUpdater.cpp File Reference

Go to the source code of this file.

Functions

static bool reload_clamav_service ()

Function Documentation

◆ reload_clamav_service()

bool reload_clamav_service ( )
static

Definition at line 31 of file SaneSecurityUpdater.cpp.

31 {
32 const std::vector<std::string> services = {
33 "clamav-daemon.service",
34 "clamd@scan.service",
35 "clamd.service"
36 };
37
38 for (const auto& svc : services) {
39 if (bg_process::run({"/usr/libexec/bastionguard/bastionguard-service",
40 "--system", "is-active", svc}).ok() &&
41 bg_process::run({"/usr/libexec/bastionguard/bastionguard-service",
42 "--system", "try-reload-or-restart", svc}).ok())
43 return true;
44 }
45
46 return false;
47}
Result run(const std::vector< std::string > &args, bool merge_stderr=false, std::size_t limit=8U *1024U *1024U, const std::map< std::string, std::string > &environment={}, const std::function< bool(const std::string &)> &on_line={})

References bg_process::Result::ok(), reload_clamav_service(), and bg_process::run().

Referenced by reload_clamav_service(), and SaneSecurityUpdater::runHeadless().