diff options
| author | Dan Engelbrecht <[email protected]> | 2025-03-14 09:50:00 +0100 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2025-03-14 09:50:00 +0100 |
| commit | 55c67aec301cfc99178ab54c6366cbc88f35d46a (patch) | |
| tree | 84b4c73220f7dd041763b6d1919eedc8d0b90844 /src/zenutil/service.cpp | |
| parent | Merge remote-tracking branch 'origin/de/zen-service-command' into de/zen-serv... (diff) | |
| parent | fix quoted command lines arguments (#306) (diff) | |
| download | zen-55c67aec301cfc99178ab54c6366cbc88f35d46a.tar.xz zen-55c67aec301cfc99178ab54c6366cbc88f35d46a.zip | |
Merge remote-tracking branch 'origin/main' into de/zen-service-command
Diffstat (limited to 'src/zenutil/service.cpp')
| -rw-r--r-- | src/zenutil/service.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/zenutil/service.cpp b/src/zenutil/service.cpp index ea7c2aae6..a2ff93efd 100644 --- a/src/zenutil/service.cpp +++ b/src/zenutil/service.cpp @@ -884,14 +884,14 @@ InstallService(std::string_view ServiceName, const ServiceSpec& Spec) { const std::string UnitName = GetUnitName(ServiceName); const std::filesystem::path ServiceUnitPath = GetServiceUnitPath(UnitName); - std::string UserName = Spec.UserName; + std::string UserName = Spec.UserName; if (UserName == "") { std::pair<int, std::string> UserResult = ExecuteProgram("echo $SUDO_USER"); if (UserResult.first != 0 || UserResult.second.empty()) { - ZEN_ERROR("Unable to determine current user"); + ZEN_ERROR("Unable to determine current user"); return MakeErrorCode(UserResult.first); } @@ -984,14 +984,14 @@ QueryInstalledService(std::string_view ServiceName, ServiceInfo& OutInfo) std::pair<int, std::string> ShowResult = ExecuteProgram(fmt::format("systemctl show -p ExecStart {}", UnitName)); if (ShowResult.first == 0) { - std::regex Regex(R"~(ExecStart=\{ path=(.*?) ; argv\[\]=(.*?) ;)~"); + std::regex Regex(R"~(ExecStart=\{ path=(.*?) ; argv\[\]=(.*?) ;)~"); std::smatch Match; if (std::regex_search(ShowResult.second, Match, Regex)) { - std::string Executable = Match[1].str(); - std::string CommandLine = Match[2].str(); - OutInfo.Spec.ExecutablePath = Executable; + std::string Executable = Match[1].str(); + std::string CommandLine = Match[2].str(); + OutInfo.Spec.ExecutablePath = Executable; OutInfo.Spec.CommandLineOptions = CommandLine.substr(Executable.size(), CommandLine.size()); } else |