From c81d700315da4d223bfb1556811b738c7b14a3d6 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Fri, 4 Nov 2016 09:58:56 -0700 Subject: [PATCH] Fix paths --- man/sysctl.d.xml | 3 +- src/basic/def.h | 21 ++--------- src/basic/locale-util.c | 4 +-- src/basic/path-util.c | 3 +- src/basic/path-util.h | 2 +- src/basic/stat-util.c | 6 ---- src/basic/user-util.c | 1 + src/core/main.c | 13 +++---- src/core/org.freedesktop.systemd1.service | 2 +- src/core/swap.c | 4 +-- src/coredump/coredump.c | 2 +- src/cryptsetup/cryptsetup-generator.c | 4 +-- src/delta/delta.c | 8 +---- src/firstboot/firstboot.c | 7 ---- src/hostname/hostnamed.c | 5 --- .../org.freedesktop.hostname1.service | 2 +- src/import/org.freedesktop.import1.service | 2 +- src/journal-remote/journal-gatewayd.c | 3 +- src/journal/cat.c | 2 +- src/journal/catalog.c | 3 +- src/kernel-install/kernel-install | 1 - src/libsystemd/sd-hwdb/sd-hwdb.c | 4 --- src/libsystemd/sd-path/sd-path.c | 35 ++++++------------- src/locale/org.freedesktop.locale1.service | 2 +- src/login/org.freedesktop.login1.service | 2 +- src/machine/machine-dbus.c | 7 ++-- src/machine/org.freedesktop.machine1.service | 2 +- src/network/networkd-manager.c | 5 +-- src/network/org.freedesktop.network1.service | 2 +- src/nspawn/nspawn-setuid.c | 3 +- src/nspawn/nspawn.c | 10 ++---- src/nss-mymachines/nss-mymachines.c | 4 +-- src/rc-local-generator/rc-local-generator.c | 2 +- src/resolve/org.freedesktop.resolve1.service | 2 +- src/shared/base-filesystem.c | 8 ----- src/shared/install.c | 17 ++------- src/shared/machine-image.c | 3 +- src/sysusers/sysusers.c | 2 +- .../org.freedesktop.timedate1.service | 2 +- src/udev/net/link-config.c | 5 +-- test/TEST-11-ISSUE-3166/test.sh | 2 +- units/emergency.service.in | 6 ++-- units/rescue.service.in | 6 ++-- units/systemd-binfmt.service.in | 4 +-- 44 files changed, 63 insertions(+), 170 deletions(-) diff --git a/man/sysctl.d.xml b/man/sysctl.d.xml index ccf6c8e39fb15..891ef1a730770 100644 --- a/man/sysctl.d.xml +++ b/man/sysctl.d.xml @@ -48,7 +48,6 @@ /etc/sysctl.d/*.conf /run/sysctl.d/*.conf - /usr/lib/sysctl.d/*.conf @@ -128,7 +127,7 @@ ACTION=="add", SUBSYSTEM=="module", KERNEL=="br_netfilter", \ - RUN+="/usr/lib/systemd/systemd-sysctl --prefix=/net/bridge" + RUN+="/run/current-system/sw/lib/systemd/systemd-sysctl --prefix=/net/bridge" /etc/sysctl.d/bridge.conf: diff --git a/src/basic/def.h b/src/basic/def.h index 2266eff650b60..b412dc0ab2984 100644 --- a/src/basic/def.h +++ b/src/basic/def.h @@ -41,18 +41,8 @@ #define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT #define SIGNALS_IGNORE SIGPIPE -#ifdef HAVE_SPLIT_USR -#define KBD_KEYMAP_DIRS \ - "/usr/share/keymaps/\0" \ - "/usr/share/kbd/keymaps/\0" \ - "/usr/lib/kbd/keymaps/\0" \ - "/lib/kbd/keymaps/\0" -#else -#define KBD_KEYMAP_DIRS \ - "/usr/share/keymaps/\0" \ - "/usr/share/kbd/keymaps/\0" \ - "/usr/lib/kbd/keymaps/\0" -#endif +#define KBD_KEYMAP_DIRS \ + "/run/current-system/sw/share/keymaps/\0" #define UNIX_SYSTEM_BUS_ADDRESS "unix:path=/var/run/dbus/system_bus_socket" #define KERNEL_SYSTEM_BUS_ADDRESS "kernel:path=/sys/fs/kdbus/0-system/bus" @@ -72,11 +62,7 @@ #define NOTIFY_FD_MAX 768 #define NOTIFY_BUFFER_MAX PIPE_BUF -#ifdef HAVE_SPLIT_USR -#define _CONF_PATHS_SPLIT_USR(n) "/lib/" n "\0" -#else #define _CONF_PATHS_SPLIT_USR(n) -#endif /* Return a nulstr for a standard cascade of configuration paths, * suitable to pass to conf_files_list_nulstr() or config_parse_many_nulstr() @@ -85,6 +71,5 @@ #define CONF_PATHS_NULSTR(n) \ "/etc/" n "\0" \ "/run/" n "\0" \ - "/usr/local/lib/" n "\0" \ - "/usr/lib/" n "\0" \ + "/run/current-system/sw/lib/" n "\0" \ _CONF_PATHS_SPLIT_USR(n) diff --git a/src/basic/locale-util.c b/src/basic/locale-util.c index ada0a28cd8423..bc3fdd2ec26c2 100644 --- a/src/basic/locale-util.c +++ b/src/basic/locale-util.c @@ -84,7 +84,7 @@ static int add_locales_from_archive(Set *locales) { unsigned i; int r; - fd = open("/usr/lib/locale/locale-archive", O_RDONLY|O_NOCTTY|O_CLOEXEC); + fd = open("/run/current-system/sw/lib/locale/locale-archive", O_RDONLY|O_NOCTTY|O_CLOEXEC); if (fd < 0) return errno == ENOENT ? 0 : -errno; @@ -146,7 +146,7 @@ static int add_locales_from_libdir (Set *locales) { struct dirent *entry; int r; - dir = opendir("/usr/lib/locale"); + dir = opendir("/run/current-system/sw/lib/locale"); if (!dir) return errno == ENOENT ? 0 : -errno; diff --git a/src/basic/path-util.c b/src/basic/path-util.c index fd38f51c4c79f..60b40f3ee268c 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -580,8 +580,7 @@ static int binary_is_good(const char *binary) { return r; return !PATH_IN_SET(d, "true" - "/bin/true", - "/usr/bin/true", + "/run/current-system/sw/bin/true", "/dev/null"); } diff --git a/src/basic/path-util.h b/src/basic/path-util.h index 0ddfa03feecd8..28f6916769878 100644 --- a/src/basic/path-util.h +++ b/src/basic/path-util.h @@ -27,7 +27,7 @@ #include "time-util.h" #define DEFAULT_PATH_NORMAL "/no-such-path" -#define DEFAULT_PATH_SPLIT_USR DEFAULT_PATH_NORMAL ":/sbin:/bin" +#define DEFAULT_PATH_SPLIT_USR DEFAULT_PATH_NORMAL #ifdef HAVE_SPLIT_USR # define DEFAULT_PATH DEFAULT_PATH_SPLIT_USR diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c index 309e84b93d33d..136b5078206fd 100644 --- a/src/basic/stat-util.c +++ b/src/basic/stat-util.c @@ -148,12 +148,6 @@ int path_is_os_tree(const char *path) { assert(path); - /* We use /usr/lib/os-release as flag file if something is an OS */ - p = strjoina(path, "/usr/lib/os-release"); - r = access(p, F_OK); - if (r >= 0) - return 1; - /* Also check for the old location in /etc, just in case. */ p = strjoina(path, "/etc/os-release"); r = access(p, F_OK); diff --git a/src/basic/user-util.c b/src/basic/user-util.c index de6c93056eca7..5278e5e9e8f25 100644 --- a/src/basic/user-util.c +++ b/src/basic/user-util.c @@ -193,6 +193,7 @@ int get_user_creds_clean( if (shell && (isempty(*shell) || PATH_IN_SET(*shell, + "/run/current-system/sw/bin/nologin", "/bin/nologin", "/sbin/nologin", "/usr/bin/nologin", diff --git a/src/core/main.c b/src/core/main.c index 94602611a72ca..4dc7672f5aa9a 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1233,11 +1233,6 @@ static int status_welcome(void) { "PRETTY_NAME", &pretty_name, "ANSI_COLOR", &ansi_color, NULL); - if (r == -ENOENT) - r = parse_env_file("/usr/lib/os-release", NEWLINE, - "PRETTY_NAME", &pretty_name, - "ANSI_COLOR", &ansi_color, - NULL); if (r < 0 && r != -ENOENT) log_warning_errno(r, "Failed to read os-release file: %m"); @@ -1518,7 +1513,7 @@ int main(int argc, char *argv[]) { /* But at the same time, turn off the core_pattern logic by default, so that no coredumps are stored * until the systemd-coredump tool is enabled via sysctl. */ if (!skip_setup) - (void) write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", 0); + (void) write_string_file("/proc/sys/kernel/core_pattern", "|/run/current-system/sw/bin/false", 0); } if (arg_system) { @@ -2091,18 +2086,18 @@ int main(int argc, char *argv[]) { log_warning_errno(errno, "Failed to execute configured init, trying fallback: %m"); } - args[0] = "/sbin/init"; + args[0] = "/no-such-path/init"; (void) execv(args[0], (char* const*) args); if (errno == ENOENT) { - log_warning("No /sbin/init, trying fallback"); + log_warning("No /no-such-path/init, trying fallback"); args[0] = "/bin/sh"; args[1] = NULL; (void) execv(args[0], (char* const*) args); log_error_errno(errno, "Failed to execute /bin/sh, giving up: %m"); } else - log_warning_errno(errno, "Failed to execute /sbin/init, giving up: %m"); + log_warning_errno(errno, "Failed to execute /no-such-path/init, giving up: %m"); } arg_serialization = safe_fclose(arg_serialization); diff --git a/src/core/org.freedesktop.systemd1.service b/src/core/org.freedesktop.systemd1.service index d4df3e93a2af5..04c777e8070cf 100644 --- a/src/core/org.freedesktop.systemd1.service +++ b/src/core/org.freedesktop.systemd1.service @@ -7,5 +7,5 @@ [D-BUS Service] Name=org.freedesktop.systemd1 -Exec=/bin/false +Exec=/run/current-system/sw/bin/false User=root diff --git a/src/core/swap.c b/src/core/swap.c index 2228a254bbc1a..68e68c2550cc2 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -760,7 +760,7 @@ static void swap_enter_activating(Swap *s) { } } - r = exec_command_set(s->control_command, "/sbin/swapon", NULL); + r = exec_command_set(s->control_command, "/run/current-system/sw/bin/swapon", NULL); if (r < 0) goto fail; @@ -799,7 +799,7 @@ static void swap_enter_deactivating(Swap *s) { s->control_command = s->exec_command + SWAP_EXEC_DEACTIVATE; r = exec_command_set(s->control_command, - "/sbin/swapoff", + "/run/current-system/sw/bin/swapoff", s->what, NULL); if (r < 0) diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c index a982c204be9ff..39086a20c12dc 100644 --- a/src/coredump/coredump.c +++ b/src/coredump/coredump.c @@ -1077,7 +1077,7 @@ static int process_kernel(int argc, char* argv[]) { /* If this is PID 1 disable coredump collection, we'll unlikely be able to process it later on. */ if (streq(t, SPECIAL_INIT_SCOPE)) { log_notice("Due to PID 1 having crashed coredump collection will now be turned off."); - (void) write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", 0); + (void) write_string_file("/proc/sys/kernel/core_pattern", "|/run/current-system/sw/bin/false", 0); } /* Let's avoid dead-locks when processing journald and init crashes, as socket activation and logging diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c index e2dc4327fe119..e1dde0654983b 100644 --- a/src/cryptsetup/cryptsetup-generator.c +++ b/src/cryptsetup/cryptsetup-generator.c @@ -172,12 +172,12 @@ static int create_disk( if (tmp) fprintf(f, - "ExecStartPost=/sbin/mke2fs '/dev/mapper/%s'\n", + "ExecStartPost=/run/current-system/sw/bin/mke2fs '/dev/mapper/%s'\n", name); if (swap) fprintf(f, - "ExecStartPost=/sbin/mkswap '/dev/mapper/%s'\n", + "ExecStartPost=/run/current-system/sw/bin/mkswap '/dev/mapper/%s'\n", name); r = fflush_and_check(f); diff --git a/src/delta/delta.c b/src/delta/delta.c index f32744def2955..e3b7c23e0262a 100644 --- a/src/delta/delta.c +++ b/src/delta/delta.c @@ -45,13 +45,7 @@ static const char prefixes[] = "/etc\0" "/run\0" - "/usr/local/lib\0" - "/usr/local/share\0" - "/usr/lib\0" - "/usr/share\0" -#ifdef HAVE_SPLIT_USR - "/lib\0" -#endif + "/run/current-software/sw/lib\0" ; static const char suffixes[] = diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c index c9e8e54ee38f0..db5770e998d05 100644 --- a/src/firstboot/firstboot.c +++ b/src/firstboot/firstboot.c @@ -84,13 +84,6 @@ static void print_welcome(void) { r = parse_env_file(os_release, NEWLINE, "PRETTY_NAME", &pretty_name, NULL); - if (r == -ENOENT) { - - os_release = prefix_roota(arg_root, "/usr/lib/os-release"); - r = parse_env_file(os_release, NEWLINE, - "PRETTY_NAME", &pretty_name, - NULL); - } if (r < 0 && r != -ENOENT) log_warning_errno(r, "Failed to read os-release file: %m"); diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c index 197f905b7dc8b..a9a74aacecaaa 100644 --- a/src/hostname/hostnamed.c +++ b/src/hostname/hostnamed.c @@ -113,11 +113,6 @@ static int context_read_data(Context *c) { "PRETTY_NAME", &c->data[PROP_OS_PRETTY_NAME], "CPE_NAME", &c->data[PROP_OS_CPE_NAME], NULL); - if (r == -ENOENT) - r = parse_env_file("/usr/lib/os-release", NEWLINE, - "PRETTY_NAME", &c->data[PROP_OS_PRETTY_NAME], - "CPE_NAME", &c->data[PROP_OS_CPE_NAME], - NULL); if (r < 0 && r != -ENOENT) return r; diff --git a/src/hostname/org.freedesktop.hostname1.service b/src/hostname/org.freedesktop.hostname1.service index 6041ed60cae86..37fc5d2d435bb 100644 --- a/src/hostname/org.freedesktop.hostname1.service +++ b/src/hostname/org.freedesktop.hostname1.service @@ -7,6 +7,6 @@ [D-BUS Service] Name=org.freedesktop.hostname1 -Exec=/bin/false +Exec=/run/current-system/sw/bin/false User=root SystemdService=dbus-org.freedesktop.hostname1.service diff --git a/src/import/org.freedesktop.import1.service b/src/import/org.freedesktop.import1.service index 8fc4c47881c5c..d7dd2af723001 100644 --- a/src/import/org.freedesktop.import1.service +++ b/src/import/org.freedesktop.import1.service @@ -7,6 +7,6 @@ [D-BUS Service] Name=org.freedesktop.import1 -Exec=/bin/false +Exec=/run/current-system/sw/bin/false User=root SystemdService=dbus-org.freedesktop.import1.service diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c index 7325adee8f7ff..a1ea64f49ff00 100644 --- a/src/journal-remote/journal-gatewayd.c +++ b/src/journal-remote/journal-gatewayd.c @@ -788,8 +788,7 @@ static int request_handler_machine( if (r < 0) return mhd_respondf(connection, r, MHD_HTTP_INTERNAL_SERVER_ERROR, "Failed to determine disk usage: %m"); - if (parse_env_file("/etc/os-release", NEWLINE, "PRETTY_NAME", &os_name, NULL) == -ENOENT) - (void) parse_env_file("/usr/lib/os-release", NEWLINE, "PRETTY_NAME", &os_name, NULL); + (void) parse_env_file("/etc/os-release", NEWLINE, "PRETTY_NAME", &os_name, NULL); get_virtualization(&v); diff --git a/src/journal/cat.c b/src/journal/cat.c index 08c844d44f377..51032d1e9225d 100644 --- a/src/journal/cat.c +++ b/src/journal/cat.c @@ -145,7 +145,7 @@ int main(int argc, char *argv[]) { fd = -1; if (argc <= optind) - (void) execl("/bin/cat", "/bin/cat", NULL); + (void) execl("/run/current-system/sw/bin/cat", "/run/current-system/sw/bin/cat", NULL); else (void) execvp(argv[optind], argv + optind); r = -errno; diff --git a/src/journal/catalog.c b/src/journal/catalog.c index 886f6efd8bd2d..89fc8d949beb1 100644 --- a/src/journal/catalog.c +++ b/src/journal/catalog.c @@ -44,8 +44,7 @@ #include "util.h" const char * const catalog_file_dirs[] = { - "/usr/local/lib/systemd/catalog/", - "/usr/lib/systemd/catalog/", + "/run/current-system/sw/lib/systemd/catalog/", NULL }; diff --git a/src/kernel-install/kernel-install b/src/kernel-install/kernel-install index 0c0ee718accf5..e27a07850a838 100644 --- a/src/kernel-install/kernel-install +++ b/src/kernel-install/kernel-install @@ -107,7 +107,6 @@ ret=0 readarray -t PLUGINS < <( dropindirs_sort ".install" \ "/etc/kernel/install.d" \ - "/usr/lib/kernel/install.d" ) case $COMMAND in diff --git a/src/libsystemd/sd-hwdb/sd-hwdb.c b/src/libsystemd/sd-hwdb/sd-hwdb.c index 488e101ea8a69..d2c847b4cd243 100644 --- a/src/libsystemd/sd-hwdb/sd-hwdb.c +++ b/src/libsystemd/sd-hwdb/sd-hwdb.c @@ -290,10 +290,6 @@ static int trie_search_f(sd_hwdb *hwdb, const char *search) { static const char hwdb_bin_paths[] = "/etc/systemd/hwdb/hwdb.bin\0" "/etc/udev/hwdb.bin\0" - "/usr/lib/systemd/hwdb/hwdb.bin\0" -#ifdef HAVE_SPLIT_USR - "/lib/systemd/hwdb/hwdb.bin\0" -#endif UDEVLIBEXECDIR "/hwdb.bin\0"; _public_ int sd_hwdb_new(sd_hwdb **ret) { diff --git a/src/libsystemd/sd-path/sd-path.c b/src/libsystemd/sd-path/sd-path.c index b7aec1f20a640..6a572eebd3878 100644 --- a/src/libsystemd/sd-path/sd-path.c +++ b/src/libsystemd/sd-path/sd-path.c @@ -225,15 +225,15 @@ static int get_path(uint64_t type, char **buffer, const char **ret) { return from_environment("TMPDIR", "/var/tmp", ret); case SD_PATH_SYSTEM_BINARIES: - *ret = "/usr/bin"; + *ret = "/run/current-system/sw/bin"; return 0; case SD_PATH_SYSTEM_INCLUDE: - *ret = "/usr/include"; + *ret = "/no-such-path/include"; return 0; case SD_PATH_SYSTEM_LIBRARY_PRIVATE: - *ret = "/usr/lib"; + *ret = "/no-such-path/lib"; return 0; case SD_PATH_SYSTEM_LIBRARY_ARCH: @@ -241,15 +241,15 @@ static int get_path(uint64_t type, char **buffer, const char **ret) { return 0; case SD_PATH_SYSTEM_SHARED: - *ret = "/usr/share"; + *ret = "/run/current-system/sw/share"; return 0; case SD_PATH_SYSTEM_CONFIGURATION_FACTORY: - *ret = "/usr/share/factory/etc"; + *ret = "/run/current-system/sw/share/factory/etc"; return 0; case SD_PATH_SYSTEM_STATE_FACTORY: - *ret = "/usr/share/factory/var"; + *ret = "/run/current-system/sw/share/factory/var"; return 0; case SD_PATH_SYSTEM_CONFIGURATION: @@ -488,14 +488,7 @@ static int get_search(uint64_t type, char ***list) { ".local/bin", "PATH", true, - "/usr/local/sbin", - "/usr/local/bin", - "/usr/sbin", - "/usr/bin", -#ifdef HAVE_SPLIT_USR - "/sbin", - "/bin", -#endif + "/run/current-system/sw/bin", NULL); case SD_PATH_SEARCH_LIBRARY_PRIVATE: @@ -504,11 +497,6 @@ static int get_search(uint64_t type, char ***list) { ".local/lib", NULL, false, - "/usr/local/lib", - "/usr/lib", -#ifdef HAVE_SPLIT_USR - "/lib", -#endif NULL); case SD_PATH_SEARCH_LIBRARY_ARCH: @@ -529,8 +517,7 @@ static int get_search(uint64_t type, char ***list) { ".local/share", "XDG_DATA_DIRS", false, - "/usr/local/share", - "/usr/share", + "/run/current-system/sw/share", NULL); case SD_PATH_SEARCH_CONFIGURATION_FACTORY: @@ -539,8 +526,7 @@ static int get_search(uint64_t type, char ***list) { NULL, NULL, false, - "/usr/local/share/factory/etc", - "/usr/share/factory/etc", + "/run/current-system/sw/share/factory/etc", NULL); case SD_PATH_SEARCH_STATE_FACTORY: @@ -549,8 +535,7 @@ static int get_search(uint64_t type, char ***list) { NULL, NULL, false, - "/usr/local/share/factory/var", - "/usr/share/factory/var", + "/run/current-system/sw/share/factory/var", NULL); case SD_PATH_SEARCH_CONFIGURATION: diff --git a/src/locale/org.freedesktop.locale1.service b/src/locale/org.freedesktop.locale1.service index 025f9a0fc2f17..5bff8684062dc 100644 --- a/src/locale/org.freedesktop.locale1.service +++ b/src/locale/org.freedesktop.locale1.service @@ -7,6 +7,6 @@ [D-BUS Service] Name=org.freedesktop.locale1 -Exec=/bin/false +Exec=/run/current-system/sw/bin/false User=root SystemdService=dbus-org.freedesktop.locale1.service diff --git a/src/login/org.freedesktop.login1.service b/src/login/org.freedesktop.login1.service index 762dae2bb3a10..690f37b5f9c51 100644 --- a/src/login/org.freedesktop.login1.service +++ b/src/login/org.freedesktop.login1.service @@ -7,6 +7,6 @@ [D-BUS Service] Name=org.freedesktop.login1 -Exec=/bin/false +Exec=/run/current-system/sw/bin/false User=root SystemdService=dbus-org.freedesktop.login1.service diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c index 5ca18ff87e88c..c532e6355baa9 100644 --- a/src/machine/machine-dbus.c +++ b/src/machine/machine-dbus.c @@ -403,11 +403,8 @@ int bus_machine_method_get_os_release(sd_bus_message *message, void *userdata, s _exit(EXIT_FAILURE); fd = open("/etc/os-release", O_RDONLY|O_CLOEXEC); - if (fd < 0) { - fd = open("/usr/lib/os-release", O_RDONLY|O_CLOEXEC); - if (fd < 0) - _exit(EXIT_FAILURE); - } + if (fd < 0) + _exit(EXIT_FAILURE); r = copy_bytes(fd, pair[1], (uint64_t) -1, false); if (r < 0) diff --git a/src/machine/org.freedesktop.machine1.service b/src/machine/org.freedesktop.machine1.service index d3dc99852b6bd..bd4b06821c972 100644 --- a/src/machine/org.freedesktop.machine1.service +++ b/src/machine/org.freedesktop.machine1.service @@ -7,6 +7,6 @@ [D-BUS Service] Name=org.freedesktop.machine1 -Exec=/bin/false +Exec=/run/current-system/sw/bin/false User=root SystemdService=dbus-org.freedesktop.machine1.service diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c index 9174dcc7f48c7..4c46ef6ab6750 100644 --- a/src/network/networkd-manager.c +++ b/src/network/networkd-manager.c @@ -46,10 +46,7 @@ const char* const network_dirs[] = { "/etc/systemd/network", "/run/systemd/network", - "/usr/lib/systemd/network", -#ifdef HAVE_SPLIT_USR - "/lib/systemd/network", -#endif + "/run/current-system/sw/lib/systemd/network", NULL}; static int setup_default_address_pool(Manager *m) { diff --git a/src/network/org.freedesktop.network1.service b/src/network/org.freedesktop.network1.service index bea885fe53349..312f0e2cb9381 100644 --- a/src/network/org.freedesktop.network1.service +++ b/src/network/org.freedesktop.network1.service @@ -7,6 +7,6 @@ [D-BUS Service] Name=org.freedesktop.network1 -Exec=/bin/false +Exec=/run/current-system/sw/bin/false User=root SystemdService=dbus-org.freedesktop.network1.service diff --git a/src/nspawn/nspawn-setuid.c b/src/nspawn/nspawn-setuid.c index b8e8e091c8f25..4325bd59c86d4 100644 --- a/src/nspawn/nspawn-setuid.c +++ b/src/nspawn/nspawn-setuid.c @@ -74,8 +74,7 @@ static int spawn_getent(const char *database, const char *key, pid_t *rpid) { (void) reset_signal_mask(); close_all_fds(NULL, 0); - execle("/usr/bin/getent", "getent", database, key, NULL, &empty_env); - execle("/bin/getent", "getent", database, key, NULL, &empty_env); + execle("/run/current-system/sw/bin/getent", "getent", database, key, NULL, &empty_env); _exit(EXIT_FAILURE); } diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 2ac199eb44992..f018909f1914d 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -2861,13 +2861,7 @@ static int inner_child( memcpy_safe(a + 1, arg_parameters, m * sizeof(char*)); a[1 + m] = NULL; - a[0] = (char*) "/usr/lib/systemd/systemd"; - execve(a[0], a, env_use); - - a[0] = (char*) "/lib/systemd/systemd"; - execve(a[0], a, env_use); - - a[0] = (char*) "/sbin/init"; + a[0] = (char*) "/no-such-path/systemd"; execve(a[0], a, env_use); } else if (!strv_isempty(arg_parameters)) execvpe(arg_parameters[0], arg_parameters, env_use); @@ -2876,7 +2870,7 @@ static int inner_child( /* If we cannot change the directory, we'll end up in /, that is expected. */ (void) chdir(home ?: "/root"); - execle("/bin/bash", "-bash", NULL, env_use); + execle("/run/current-system/sw/bin/bash", "-bash", NULL, env_use); execle("/bin/sh", "-sh", NULL, env_use); } diff --git a/src/nss-mymachines/nss-mymachines.c b/src/nss-mymachines/nss-mymachines.c index 895f61c462963..2a9ca572e980c 100644 --- a/src/nss-mymachines/nss-mymachines.c +++ b/src/nss-mymachines/nss-mymachines.c @@ -483,7 +483,7 @@ enum nss_status _nss_mymachines_getpwnam_r( pwd->pw_gecos = buffer; pwd->pw_passwd = (char*) "*"; /* locked */ pwd->pw_dir = (char*) "/"; - pwd->pw_shell = (char*) "/sbin/nologin"; + pwd->pw_shell = (char*) "/run/current-system/sw/bin/nologin"; *errnop = 0; return NSS_STATUS_SUCCESS; @@ -562,7 +562,7 @@ enum nss_status _nss_mymachines_getpwuid_r( pwd->pw_gecos = buffer; pwd->pw_passwd = (char*) "*"; /* locked */ pwd->pw_dir = (char*) "/"; - pwd->pw_shell = (char*) "/sbin/nologin"; + pwd->pw_shell = (char*) "/run/current-system/sw/bin/nologin"; *errnop = 0; return NSS_STATUS_SUCCESS; diff --git a/src/rc-local-generator/rc-local-generator.c b/src/rc-local-generator/rc-local-generator.c index 618bbe428de08..afa42b158a249 100644 --- a/src/rc-local-generator/rc-local-generator.c +++ b/src/rc-local-generator/rc-local-generator.c @@ -33,7 +33,7 @@ #endif #ifndef RC_LOCAL_SCRIPT_PATH_STOP -#define RC_LOCAL_SCRIPT_PATH_STOP "/sbin/halt.local" +#define RC_LOCAL_SCRIPT_PATH_STOP "/run/current-system/sw/bin/halt.local" #endif static const char *arg_dest = "/tmp"; diff --git a/src/resolve/org.freedesktop.resolve1.service b/src/resolve/org.freedesktop.resolve1.service index 7ac5c323f06d5..55285984ed14f 100644 --- a/src/resolve/org.freedesktop.resolve1.service +++ b/src/resolve/org.freedesktop.resolve1.service @@ -7,6 +7,6 @@ [D-BUS Service] Name=org.freedesktop.resolve1 -Exec=/bin/false +Exec=/run/current-system/sw/bin/false User=root SystemdService=dbus-org.freedesktop.resolve1.service diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c index 59a34a9d11232..282bad70f7b63 100644 --- a/src/shared/base-filesystem.c +++ b/src/shared/base-filesystem.c @@ -44,17 +44,9 @@ typedef struct BaseFilesystem { } BaseFilesystem; static const BaseFilesystem table[] = { - { "bin", 0, "usr/bin\0", NULL }, - { "lib", 0, "usr/lib\0", NULL }, { "root", 0755, NULL, NULL, true }, - { "sbin", 0, "usr/sbin\0", NULL }, - { "usr", 0755, NULL, NULL }, { "var", 0755, NULL, NULL }, { "etc", 0755, NULL, NULL }, -#if defined(__i386__) || defined(__x86_64__) - { "lib64", 0, "usr/lib/x86_64-linux-gnu\0" - "usr/lib64\0", "ld-linux-x86-64.so.2" }, -#endif }; int base_filesystem_create(const char *root, uid_t uid, gid_t gid) { diff --git a/src/shared/install.c b/src/shared/install.c index 96fba6e25bc52..db60099f8807d 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -261,14 +261,6 @@ static int path_is_vendor(const LookupPaths *p, const char *path) { if (!rpath) return 0; - if (path_startswith(rpath, "/usr")) - return true; - -#ifdef HAVE_SPLIT_USR - if (path_startswith(rpath, "/lib")) - return true; -#endif - return path_equal(rpath, SYSTEM_DATA_UNIT_PATH); } @@ -2578,17 +2570,12 @@ static int read_presets(UnitFileScope scope, const char *root_dir, Presets *pres if (scope == UNIT_FILE_SYSTEM) r = conf_files_list(&files, ".preset", root_dir, "/etc/systemd/system-preset", - "/usr/local/lib/systemd/system-preset", - "/usr/lib/systemd/system-preset", -#ifdef HAVE_SPLIT_USR - "/lib/systemd/system-preset", -#endif + "/run/current-system/sw/lib/systemd/system-preset", NULL); else if (scope == UNIT_FILE_GLOBAL) r = conf_files_list(&files, ".preset", root_dir, "/etc/systemd/user-preset", - "/usr/local/lib/systemd/user-preset", - "/usr/lib/systemd/user-preset", + "/run/current-system/sw/lib/systemd/user-preset", NULL); else { *presets = (Presets){}; diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c index 060f8d50c716b..32a2f3fb4d9dc 100644 --- a/src/shared/machine-image.c +++ b/src/shared/machine-image.c @@ -53,8 +53,7 @@ static const char image_search_path[] = "/var/lib/machines\0" "/var/lib/container\0" /* legacy */ - "/usr/local/lib/machines\0" - "/usr/lib/machines\0"; + "/run/current-system/sw/lib/machines\0"; Image *image_unref(Image *i) { if (!i) diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c index 0684f58fcd099..549368ddb43f0 100644 --- a/src/sysusers/sysusers.c +++ b/src/sysusers/sysusers.c @@ -599,7 +599,7 @@ static int write_files(void) { /* Initialize the shell to nologin, * with one exception: for root we * patch in something special */ - .pw_shell = i->uid == 0 ? (char*) "/bin/sh" : (char*) "/sbin/nologin", + .pw_shell = i->uid == 0 ? (char*) "/run/current-system/sw/bin/sh" : (char*) "/run/current-system/sw/bin/nologin", }; errno = 0; diff --git a/src/timedate/org.freedesktop.timedate1.service b/src/timedate/org.freedesktop.timedate1.service index 875f4bec78157..c37beed5a04db 100644 --- a/src/timedate/org.freedesktop.timedate1.service +++ b/src/timedate/org.freedesktop.timedate1.service @@ -7,6 +7,6 @@ [D-BUS Service] Name=org.freedesktop.timedate1 -Exec=/bin/false +Exec=/run/current-system/sw/bin/false User=root SystemdService=dbus-org.freedesktop.timedate1.service diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index ece9248c2ab40..420add5f1077b 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -57,10 +57,7 @@ struct link_config_ctx { static const char* const link_dirs[] = { "/etc/systemd/network", "/run/systemd/network", - "/usr/lib/systemd/network", -#ifdef HAVE_SPLIT_USR - "/lib/systemd/network", -#endif + "/run/current-system/sw/lib/systemd/network", NULL}; static void link_config_free(link_config *link) { diff --git a/test/TEST-11-ISSUE-3166/test.sh b/test/TEST-11-ISSUE-3166/test.sh index 0f269c8211fd5..6246761de7a30 100755 --- a/test/TEST-11-ISSUE-3166/test.sh +++ b/test/TEST-11-ISSUE-3166/test.sh @@ -59,7 +59,7 @@ Description=Fail on restart [Service] Type=simple -ExecStart=/bin/false +ExecStart=/run/current-system/sw/bin/false Restart=always EOF diff --git a/units/emergency.service.in b/units/emergency.service.in index da68eb8faa028..8657edf15e627 100644 --- a/units/emergency.service.in +++ b/units/emergency.service.in @@ -17,9 +17,9 @@ Before=shutdown.target [Service] Environment=HOME=/root WorkingDirectory=-/root -ExecStartPre=-/bin/plymouth --wait quit -ExecStartPre=-/bin/echo -e 'You are in emergency mode. After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\ntry again to boot into default mode.' -ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --job-mode=fail --no-block default" +ExecStartPre=-/run/current-system/sw/bin/plymouth --wait quit +ExecStartPre=-/run/current-system/sw/bin/echo -e 'You are in emergency mode. After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\ntry again to boot into default mode.' +ExecStart=-/run/current-system/sw/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --job-mode=fail --no-block default" Type=idle StandardInput=tty-force StandardOutput=inherit diff --git a/units/rescue.service.in b/units/rescue.service.in index 5feff69c89a93..4bf7af3473f63 100644 --- a/units/rescue.service.in +++ b/units/rescue.service.in @@ -16,9 +16,9 @@ Before=shutdown.target [Service] Environment=HOME=/root WorkingDirectory=-/root -ExecStartPre=-/bin/plymouth --wait quit -ExecStartPre=-/bin/echo -e 'You are in rescue mode. After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\nboot into default mode.' -ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --job-mode=fail --no-block default" +ExecStartPre=-/run/current-system/sw/bin/plymouth --wait quit +ExecStartPre=-/run/current-system/sw/bin/echo -e 'You are in rescue mode. After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\nboot into default mode.' +ExecStart=-/run/current-system/sw/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --job-mode=fail --no-block default" Type=idle StandardInput=tty-force StandardOutput=inherit diff --git a/units/systemd-binfmt.service.in b/units/systemd-binfmt.service.in index d53073ee616be..1f751801eefb7 100644 --- a/units/systemd-binfmt.service.in +++ b/units/systemd-binfmt.service.in @@ -14,9 +14,7 @@ Conflicts=shutdown.target After=proc-sys-fs-binfmt_misc.automount Before=sysinit.target shutdown.target ConditionPathIsReadWrite=/proc/sys/ -ConditionDirectoryNotEmpty=|/lib/binfmt.d -ConditionDirectoryNotEmpty=|/usr/lib/binfmt.d -ConditionDirectoryNotEmpty=|/usr/local/lib/binfmt.d +ConditionDirectoryNotEmpty=|/run/current-system/sw/lib/binfmt.d ConditionDirectoryNotEmpty=|/etc/binfmt.d ConditionDirectoryNotEmpty=|/run/binfmt.d