mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 07:22:57 +02:00
helpers.cpp: fix fallback to 'service' as default command
Our buildsystem/image (Yocto/OE) is using systemctl as default and we have defined 'systemctl' as
3rd parameter (e.g. see drivers/lcd4l.cpp), but users of our source could
use systems without 'systemctl' in their own buildsystems/images,
therefore it makes sense to have a fallback to 'service'.
This should avoid patching the sources.
Thx GetAway for hint.
Origin commit data
------------------
Branch: ni/coolstream
Commit: 8870512979
Author: Thilo Graf <dbt@novatux.de>
Date: 2021-07-13 (Tue, 13 Jul 2021)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -581,11 +581,11 @@ bool exec_initscript(std::string script, std::string command, std::string system
|
||||
const std::string sysctl_bin = "systemctl";
|
||||
bool use_systemd = !find_executable(sysctl_bin.c_str()).empty();
|
||||
|
||||
std::string sys_command = use_systemd ? sysctl_bin : system_command;
|
||||
std::string sys_command = use_systemd ? sysctl_bin : "service"; // fallback to 'service' if no 'systemctl' was found
|
||||
std::string cmd = command;
|
||||
int ret = 1;
|
||||
|
||||
if (!use_systemd) // 'service' or what ever
|
||||
if (!use_systemd) // default
|
||||
{
|
||||
dprintf(DEBUG_DEBUG, "executing %s %s %s\n", sys_command.c_str(), script.c_str(), cmd.c_str());
|
||||
ret = my_system(3, sys_command.c_str(), script.c_str(), cmd.c_str());
|
||||
|
Reference in New Issue
Block a user