systemd/revert_insserv_conf_parsing.patch
Frederic Crozat 9fbd97d876 Accepting request 81717 from home:fcrozat:systemd
- Add revert_insserv_conf_parsing.patch and systemd-insserv_conf:
  remove insserv.conf parsing from systemd and use generator
  instead.
- put back default.target creation at package install and remove
  inittab generator, Yast2 is now able to create it.

- Add revert_insserv_conf_parsing.patch and systemd-insserv_conf:
  remove insserv.conf parsing from systemd and use generator
  instead.
- put back default.target creation at package install and remove
  inittab generator, Yast2 is now able to create it.

OBS-URL: https://build.opensuse.org/request/show/81717
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=189
2011-09-09 16:22:08 +00:00

104 lines
3.5 KiB
Diff

From b0ff66c6e92ca9d9458f3236ee37397635bb0f0e Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat@suse.com>
Date: Fri, 9 Sep 2011 11:19:26 +0200
Subject: [PATCH] Revert "service: parse insserv.conf and plugs its system facilities into systemd."
Let's use a generator instead
This reverts commit de3910a324aefcb15c26be27033d6917494e5946.
---
src/service.c | 70 ---------------------------------------------------------
1 files changed, 0 insertions(+), 70 deletions(-)
diff --git a/src/service.c b/src/service.c
index abd8f36..37cb0bc 100644
--- a/src/service.c
+++ b/src/service.c
@@ -2969,72 +2969,6 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags) {
}
#ifdef HAVE_SYSV_COMPAT
-
-#ifdef TARGET_SUSE
-static void sysv_facility_in_insserv_conf(Manager *mgr) {
- FILE *f=NULL;
- int r;
-
- if (!(f = fopen("/etc/insserv.conf", "re"))) {
- r = errno == ENOENT ? 0 : -errno;
- goto finish;
- }
-
- while (!feof(f)) {
- char l[LINE_MAX], *t;
- char **parsed = NULL;
-
- if (!fgets(l, sizeof(l), f)) {
- if (feof(f))
- break;
-
- r = -errno;
- log_error("Failed to read configuration file '/etc/insserv.conf': %s", strerror(-r));
- goto finish;
- }
-
- t = strstrip(l);
- if (*t != '$' && *t != '<')
- continue;
-
- parsed = strv_split(t,WHITESPACE);
- /* we ignore <interactive>, not used, equivalent to X-Interactive */
- if (parsed && !startswith_no_case (parsed[0], "<interactive>")) {
- char *facility;
- Unit *u;
- if (sysv_translate_facility(parsed[0], NULL, &facility) < 0)
- continue;
- if ((u = manager_get_unit(mgr, facility)) && (u->meta.type == UNIT_TARGET)) {
- UnitDependency e;
- char *dep = NULL, *name, **j;
-
- STRV_FOREACH (j, parsed+1) {
- if (*j[0]=='+') {
- e = UNIT_WANTS;
- name = *j+1;
- }
- else {
- e = UNIT_REQUIRES;
- name = *j;
- }
- if (sysv_translate_facility(name, NULL, &dep) < 0)
- continue;
-
- r = unit_add_two_dependencies_by_name(u, UNIT_BEFORE, e, dep, NULL, true);
- free(dep);
- }
- }
- free(facility);
- }
- strv_free(parsed);
- }
-finish:
- if (f)
- fclose(f);
-
-}
-#endif
-
static int service_enumerate(Manager *m) {
char **p;
unsigned i;
@@ -3183,10 +3117,6 @@ static int service_enumerate(Manager *m) {
r = 0;
-#ifdef TARGET_SUSE
- sysv_facility_in_insserv_conf (m);
-#endif
-
finish:
free(path);
free(fpath);
--
1.7.3.4