fix: support ExecSearchPath to prevent systemd from not finding binaries
In NixOS, maintainer used a patch to modify the DEFAULT_PATH macro of systemd. However, systemd can only find its own binaries under that path. At this point, if you take the relative path of the binary as a parameter to StartTransientUnit, systemd will use DEFAULT_PATH to look for the binary, which will cause systemd to not find it. There may be other Linux distributions that change this path, so add ExecSearchPath to prevent systemd from not finding the binary. Signed-off-by: ComixHe <heyuming@deepin.org>
This commit is contained in:
@ -142,7 +142,8 @@ int processExecStart(msg_ptr &msg, const std::deque<std::string_view> &execArgs)
|
||||
DBusValueType getPropType(std::string_view key)
|
||||
{
|
||||
static std::unordered_map<std::string_view, DBusValueType> map{{"Environment", DBusValueType::ArrayOfString},
|
||||
{"WorkingDirectory", DBusValueType::String}};
|
||||
{"WorkingDirectory", DBusValueType::String},
|
||||
{"ExecSearchPath", DBusValueType::ArrayOfString}};
|
||||
|
||||
if (auto it = map.find(key); it != map.cend()) {
|
||||
return it->second;
|
||||
|
Reference in New Issue
Block a user