Hello community, here is the log from the commit of package insserv for openSUSE:Factory checked in at Thu Aug 4 14:46:11 CEST 2011. -------- --- insserv/insserv.changes 2011-08-02 09:57:09.000000000 +0200 +++ /mounts/work_src_done/STABLE/insserv/insserv.changes 2011-08-04 12:15:03.000000000 +0200 @@ -1,0 +2,5 @@ +Tue Aug 2 12:18:51 UTC 2011 - werner@suse.de + +- Enable insserv to support systemd services if shadowed by systemd + +------------------------------------------------------------------- calling whatdependson for head-i586 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ insserv.spec ++++++ --- /var/tmp/diff_new_pack.mK3Wo9/_old 2011-08-04 14:45:49.000000000 +0200 +++ /var/tmp/diff_new_pack.mK3Wo9/_new 2011-08-04 14:45:49.000000000 +0200 @@ -24,7 +24,7 @@ Provides: aaa_base:/sbin/insserv AutoReqProv: on Version: 1.14.0 -Release: 24 +Release: 28 Summary: A Program to Arrange Initialization Scripts Url: http://savannah.nongnu.org/projects/sysvinit/ Source0: http://download.savannah.gnu.org/releases/sysvinit/insserv-%{version}.tar.bz2 ++++++ insserv-1.14.0.dif ++++++ --- /var/tmp/diff_new_pack.mK3Wo9/_old 2011-08-04 14:45:49.000000000 +0200 +++ /var/tmp/diff_new_pack.mK3Wo9/_new 2011-08-04 14:45:49.000000000 +0200 @@ -1,5 +1,5 @@ --- insserv.c -+++ insserv.c 2011-02-25 16:37:28.887927611 +0000 ++++ insserv.c 2011-08-02 12:15:27.879924899 +0000 @@ -26,6 +26,7 @@ #define MINIMAL_MAKE 1 /* Remove disabled scripts from .depend.boot, * .depend.start, .depend.halt, and .depend.stop */ @@ -225,8 +225,59 @@ if (!provides) warn("missing `Provides:' entry: please add.\n"); if (provides == empty) -@@ -2338,17 +2423,18 @@ out: +@@ -2336,19 +2421,69 @@ out: + } + #endif /* SUSE */ ++/* ++ * systemd integration ++ */ ++#define SYSTEMD_SERVICE_PATH "/lib/systemd/system" ++#define SYSTEMD_BINARY_PATH "/bin/systemd" ++ ++static boolean is_overridden_by_systemd(const char *service) { ++ char *p; ++ boolean ret = false; ++ ++ asprintf(&p, SYSTEMD_SERVICE_PATH "/%s.service", service); ++ ++ if (access(p, F_OK) >= 0) ++ ret = true; ++ free(p); ++ return ret; ++} ++ ++static void forward_to_systemd (const char *initscript, const char *verb, boolean alternative_root) { ++ const char *name; ++ ++ /* systemd isn't installed, skipping */ ++ if (access(SYSTEMD_BINARY_PATH, F_OK) < 0 || initscript == NULL) ++ return; ++ ++ if (strncmp("boot.",initscript,5) == 0) ++ name = initscript+5; ++ else ++ name = initscript; ++ ++ if (is_overridden_by_systemd (name)) { ++ char *p; ++ int err = 0; ++ if (alternative_root) ++ asprintf (&p, "/bin/systemctl --root %s %s %s.service", root, verb, name); ++ else ++ asprintf (&p, "/bin/systemctl %s %s.service", verb, name); ++ ++ warn("Note: sysvinit service %s is shadowed by systemd %s.service,\nForwarding request to '%s'.\n", initscript, name, p); ++ if (!dryrun) ++ err = system(p); ++ if (err < 0) ++ warn("Failed to forward service request to systemctl: %m\n"); ++ else if (err > 0) ++ warn("Forward service request to systemctl returned error status : %d\n",err); ++ free (p); ++ } ++} ++ static struct option long_options[] = { - {"verbose", 0, (int*)0, 'v'}, @@ -255,7 +306,7 @@ }; static void help(const char *restrict const name) attribute((nonnull(1))); -@@ -2364,6 +2450,8 @@ static void help(const char *restrict co +@@ -2364,6 +2499,8 @@ static void help(const char *restrict co printf(" -o <path>, --override <path> Path to replace " OVERRIDEDIR ".\n"); printf(" -c <config>, --config <config> Path to config file.\n"); printf(" -n, --dryrun Do not change the system, only talk about it.\n"); @@ -264,7 +315,7 @@ printf(" -d, --default Use default runlevels a defined in the scripts\n"); } -@@ -2386,6 +2474,8 @@ int main (int argc, char *argv[]) +@@ -2386,6 +2523,8 @@ int main (int argc, char *argv[]) boolean defaults = false; boolean ignore = false; boolean loadarg = false; @@ -273,7 +324,7 @@ myname = basename(*argv); -@@ -2400,7 +2490,7 @@ int main (int argc, char *argv[]) +@@ -2400,7 +2539,7 @@ int main (int argc, char *argv[]) for (c = 0; c < argc; c++) argr[c] = (char*)0; @@ -282,7 +333,7 @@ size_t l; switch (c) { case 'c': -@@ -2445,6 +2535,9 @@ int main (int argc, char *argv[]) +@@ -2445,6 +2584,9 @@ int main (int argc, char *argv[]) goto err; upstartjob_path = optarg; break; @@ -292,7 +343,17 @@ case '?': err: error("For help use: %s -h\n", myname); -@@ -2612,7 +2705,7 @@ int main (int argc, char *argv[]) +@@ -2566,6 +2708,9 @@ int main (int argc, char *argv[]) + printf("Overwrite argument for %s is %s\n", argv[c], argr[c]); + #endif /* DEBUG */ + ++ for (c = 0; c < argc; c++) ++ forward_to_systemd (argv[c], del ? "disable": "enable", path != ipath); ++ + /* + * Scan and set our configuration for virtual services. + */ +@@ -2612,7 +2757,7 @@ int main (int argc, char *argv[]) * Scan scripts found in the command line to be able to resolve * all dependcies given within those scripts. */ @@ -301,7 +362,7 @@ const char *const name = argv[c]; service_t * first = (service_t*)0; char * provides, * begin, * token; -@@ -3000,8 +3093,10 @@ int main (int argc, char *argv[]) +@@ -3000,8 +3145,10 @@ int main (int argc, char *argv[]) if (!del || (del && !isarg)) warn("script %s: service %s already provided!\n", d->d_name, token); @@ -314,7 +375,7 @@ if (!del || (del && !ignore && !isarg)) continue; -@@ -3064,9 +3159,9 @@ int main (int argc, char *argv[]) +@@ -3064,9 +3211,9 @@ int main (int argc, char *argv[]) if (del) ok = chkdependencies(service); else @@ -326,7 +387,7 @@ } if (script_inf.default_start && script_inf.default_start != empty) { -@@ -3357,6 +3452,123 @@ int main (int argc, char *argv[]) +@@ -3357,6 +3504,123 @@ int main (int argc, char *argv[]) active_script(); /* @@ -450,7 +511,7 @@ * Sorry but we support only [KS][0-9][0-9]<name> */ if (maxstart > MAX_DEEP || maxstop > MAX_DEEP) -@@ -3435,13 +3647,16 @@ int main (int argc, char *argv[]) +@@ -3435,13 +3699,16 @@ int main (int argc, char *argv[]) script = (char*)0; while ((serv = listscripts(&script, 'X', lvl))) { @@ -468,7 +529,7 @@ slink = false; if ((serv->start->lvl & lvl) == 0) goto stop; -@@ -3616,7 +3831,7 @@ int main (int argc, char *argv[]) +@@ -3616,7 +3883,7 @@ int main (int argc, char *argv[]) script = (char*)0; while ((serv = listscripts(&script, 'X', seek))) { @@ -477,7 +538,7 @@ boolean found; char * clink; char mode; -@@ -3624,6 +3839,9 @@ int main (int argc, char *argv[]) +@@ -3624,6 +3891,9 @@ int main (int argc, char *argv[]) if (*script == '$') /* Do not link in virtual dependencies */ continue; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org