]> git.ipfire.org Git - thirdparty/systemd.git/commit - man/systemd.service.xml
systemd: do not require absolute paths in ExecStart
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 25 Mar 2018 18:50:15 +0000 (20:50 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 16 Apr 2018 14:09:46 +0000 (16:09 +0200)
commit5008da1ec1cf2cf8c15b702c4052e3a49583095d
tree68b4ae04a7f7a751ae6c3e4f1e85a83906bb2db5
parentf79cd1a9b2111a228bbb5b6de6fb836ad515c5c8
systemd: do not require absolute paths in ExecStart

Absolute paths make everything simple and quick, but sometimes this requirement
can be annoying. A good example is calling 'test', which will be located in
/usr/bin/ or /bin depending on the distro. The need the provide the full path
makes it harder a portable unit file in such cases.

This patch uses a fixed search path (DEFAULT_PATH which was already used as the
default value of $PATH), and if a non-absolute file name is found, it is
immediately resolved to a full path using this search path when the unit is
loaded. After that, everything behaves as if an absolute path was specified. In
particular, the executable must exist when the unit is loaded.
man/systemd.service.xml
src/basic/path-util.h
src/core/load-fragment.c
src/test/test-execute.c
test/meson.build
test/test-execute/exec-basic.service [new file with mode: 0644]