forked from pool/systemd
16ef4de12e
- Fix creation of /dev/root link. - Add remount-ro-before-unmount.patch: always remount read-only before unmounting in final shutdown loop. - Add switch-root-try-pivot-root.patch: try pivot_root before overmounting / - links more manpages for migrated tools (from Christopher Yeleighton). - disable boot.localnet service, ypbind service will do the right thing now (bnc#716746) - add xdm-display-manager.patch: pull xdm.service instead of display-manager.service (needed until xdm initscript is migrated to native systemd service). - Add fix-permissions-btmp.patch: ensure btmp is owned only by root (bnc#777405). - Have the udev package create a tape group, as referenced by 50-udev-default.rules and 60-persistent-storage-tape.rules (DimStar). - Add fix-bad-memory-access.patch: fix crash in journal rotation. - Add fix-dbus-crash.patch: fix D-Bus caused crash. - Add sync-on-shutdown.patch: ensure sync is done when initiating shutdown. - Add mount-efivars.patch: mount efivars if booting on UEFI. - Ship a empty systemd-journald initscript in systemd-logger to stop insserv to complain about missing syslog dependency. - Update 0001-service-Fix-dependencies-added-when-parsing-insserv..patch with bug fixes from Debian. OBS-URL: https://build.opensuse.org/request/show/142568 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=115
116 lines
4.8 KiB
Diff
116 lines
4.8 KiB
Diff
Index: systemd-195/src/core/service.c
|
|
===================================================================
|
|
--- systemd-195.orig/src/core/service.c
|
|
+++ systemd-195/src/core/service.c
|
|
@@ -3391,12 +3391,13 @@ static void service_notify_message(Unit
|
|
|
|
#ifdef HAVE_SYSV_COMPAT
|
|
|
|
-#ifdef TARGET_SUSE
|
|
-static void sysv_facility_in_insserv_conf(Manager *mgr) {
|
|
- FILE *f=NULL;
|
|
+#if defined(TARGET_SUSE) || defined(TARGET_DEBIAN)
|
|
+static void sysv_parse_insserv_conf(Manager *mgr, const char* filename) {
|
|
+ FILE *f = NULL;
|
|
int r;
|
|
|
|
- if (!(f = fopen("/etc/insserv.conf", "re"))) {
|
|
+ if (!(f = fopen(filename, "re"))) {
|
|
+ log_error("Failed to open file %s", filename);
|
|
r = errno == ENOENT ? 0 : -errno;
|
|
goto finish;
|
|
}
|
|
@@ -3410,7 +3411,7 @@ static void sysv_facility_in_insserv_con
|
|
break;
|
|
|
|
r = -errno;
|
|
- log_error("Failed to read configuration file '/etc/insserv.conf': %s", strerror(-r));
|
|
+ log_error("Failed to read configuration file '%s': %s", filename, strerror(-r));
|
|
goto finish;
|
|
}
|
|
|
|
@@ -3425,23 +3426,30 @@ static void sysv_facility_in_insserv_con
|
|
Unit *u;
|
|
if (sysv_translate_facility(parsed[0], NULL, &facility) < 0)
|
|
continue;
|
|
+ if (streq(facility, SPECIAL_REMOTE_FS_TARGET)) {
|
|
+ /* insert also a Wants dependency from remote-fs-pre on remote-fs */
|
|
+ u = manager_get_unit(mgr, SPECIAL_REMOTE_FS_TARGET);
|
|
+ unit_add_dependency_by_name(u, UNIT_WANTS, SPECIAL_REMOTE_FS_PRE_TARGET, NULL, true);
|
|
+ free (facility);
|
|
+ facility=strdup(SPECIAL_REMOTE_FS_PRE_TARGET);
|
|
+ }
|
|
if ((u = manager_get_unit(mgr, facility)) && (u->type == UNIT_TARGET)) {
|
|
- UnitDependency e;
|
|
char *dep = NULL, *name, **j;
|
|
|
|
STRV_FOREACH (j, parsed+1) {
|
|
- if (*j[0]=='+') {
|
|
- e = UNIT_WANTS;
|
|
+ if (*j[0] == '+')
|
|
name = *j+1;
|
|
- }
|
|
- else {
|
|
- e = UNIT_REQUIRES;
|
|
+ else
|
|
name = *j;
|
|
- }
|
|
+ if (streq(name, "boot.localfs") ||
|
|
+ streq(name, "boot.crypto"))
|
|
+ continue;
|
|
if (sysv_translate_facility(name, NULL, &dep) < 0)
|
|
continue;
|
|
|
|
- r = unit_add_two_dependencies_by_name(u, UNIT_BEFORE, e, dep, NULL, true);
|
|
+ r = unit_add_two_dependencies_by_name_inverse(u, UNIT_WANTS, UNIT_BEFORE, dep, NULL, true);
|
|
+ if (*j[0] != '+')
|
|
+ r = unit_add_dependency_by_name(u, UNIT_REQUIRES, dep, NULL, true);
|
|
free(dep);
|
|
}
|
|
}
|
|
@@ -3454,6 +3462,35 @@ finish:
|
|
fclose(f);
|
|
|
|
}
|
|
+
|
|
+static void sysv_facility_in_insserv_conf(Manager *mgr) {
|
|
+ DIR *d =NULL;
|
|
+ struct dirent *de;
|
|
+
|
|
+#ifdef TARGET_DEBIAN
|
|
+ if (!(d = opendir("/etc/insserv.conf.d/")))
|
|
+ if (errno != ENOENT) {
|
|
+ log_warning("opendir() failed on /etc/insserv.conf.d/ %s", strerror(errno));
|
|
+ goto finish;
|
|
+ }
|
|
+
|
|
+ while ((de = readdir(d))) {
|
|
+ char *path = NULL;
|
|
+ if (ignore_file(de->d_name))
|
|
+ continue;
|
|
+
|
|
+ path = join("/etc/insserv.conf.d/", de->d_name, NULL);
|
|
+ sysv_parse_insserv_conf(mgr, path);
|
|
+ free(path);
|
|
+ }
|
|
+finish:
|
|
+ if (d)
|
|
+ closedir(d);
|
|
+#endif
|
|
+
|
|
+ sysv_parse_insserv_conf(mgr, "/etc/insserv.conf");
|
|
+}
|
|
+
|
|
#endif
|
|
|
|
static int service_enumerate(Manager *m) {
|
|
@@ -3604,7 +3641,7 @@ static int service_enumerate(Manager *m)
|
|
|
|
r = 0;
|
|
|
|
-#ifdef TARGET_SUSE
|
|
+#if defined(TARGET_SUSE) || defined(TARGET_DEBIAN)
|
|
sysv_facility_in_insserv_conf (m);
|
|
#endif
|
|
|