Hello community, here is the log from the commit of package insserv for openSUSE:Factory checked in at 2011-11-21 12:34:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/insserv (Old) and /work/SRC/openSUSE:Factory/.insserv.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "insserv", Maintainer is "[email protected]" Changes: -------- --- /work/SRC/openSUSE:Factory/insserv/insserv.changes 2011-10-04 18:12:17.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.insserv.new/insserv.changes 2011-11-21 12:34:44.000000000 +0100 @@ -1,0 +2,6 @@ +Fri Nov 18 14:40:21 UTC 2011 - [email protected] + +- Do not enforce service reload in case of an other root files + system no in case of not having systemd running (bnc#728947) + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ insserv-1.14.0.dif ++++++ --- /var/tmp/diff_new_pack.6hXby2/_old 2011-11-21 12:34:46.000000000 +0100 +++ /var/tmp/diff_new_pack.6hXby2/_new 2011-11-21 12:34:46.000000000 +0100 @@ -1,5 +1,5 @@ --- insserv.c -+++ insserv.c 2011-08-19 13:54:47.816426078 +0000 ++++ insserv.c 2011-11-09 11:39:29.223646323 +0000 @@ -26,6 +26,7 @@ #define MINIMAL_MAKE 1 /* Remove disabled scripts from .depend.boot, * .depend.start, .depend.halt, and .depend.stop */ @@ -8,7 +8,26 @@ #include <pwd.h> #include <string.h> -@@ -389,8 +390,8 @@ static void reversereq(service_t *restri +@@ -36,6 +37,7 @@ + #include <stdlib.h> + #include <fcntl.h> + #include <sys/stat.h> ++#include <sys/statfs.h> + #include <sys/types.h> + #include <sys/param.h> + #include <sys/syscall.h> +@@ -44,6 +46,10 @@ + #include <errno.h> + #include <limits.h> + #include <getopt.h> ++#include <linux/magic.h> ++#if !defined(CGROUP_SUPER_MAGIC) ++# define CGROUP_SUPER_MAGIC 0x27e0eb ++#endif + #if defined(USE_RPMLIB) && (USE_RPMLIB > 0) + # include <rpm/rpmlib.h> + # include <rpm/rpmmacro.h> +@@ -389,8 +395,8 @@ static void reversereq(service_t *restri /* * Check required services for name */ @@ -19,7 +38,7 @@ { boolean ret = true; list_t * pos; -@@ -409,12 +410,23 @@ static boolean chkrequired(service_t *re +@@ -409,12 +415,23 @@ static boolean chkrequired(service_t *re must = getorig(must); if ((must->attr.flags & (SERV_CMDLINE|SERV_ENABLED)) == 0) { @@ -45,7 +64,7 @@ if (serv->attr.flags & (SERV_CMDLINE|SERV_ENABLED)) goto out; np_list_for_each(pos, &serv->sort.rev) { -@@ -425,9 +437,8 @@ static boolean chkrequired(service_t *re +@@ -425,9 +442,8 @@ static boolean chkrequired(service_t *re continue; must = rev->serv; must = getorig(must); @@ -56,7 +75,7 @@ serv->name, rev->serv->name); ret = false; } -@@ -476,7 +487,7 @@ static boolean chkdependencies(service_t +@@ -476,7 +492,7 @@ static boolean chkdependencies(service_t if ((cur->attr.flags & SERV_CMDLINE) && (flags & SERV_CMDLINE)) continue; @@ -65,7 +84,7 @@ name, cur->name); ret = false; } -@@ -738,7 +749,7 @@ static inline void makedep(void) +@@ -738,7 +754,7 @@ static inline void makedep(void) FILE *halt; #endif /* USE_KILL_IN_BOOT */ const char *target; @@ -74,7 +93,7 @@ if (dryrun) { #ifdef USE_KILL_IN_BOOT -@@ -818,6 +829,10 @@ static inline void makedep(void) +@@ -818,6 +834,10 @@ static inline void makedep(void) target = (char*)0; while ((serv = listscripts(&target, 'S', LVL_BOOT|LVL_ALL))) { @@ -85,7 +104,7 @@ boolean mark; list_t * pos; -@@ -841,6 +856,10 @@ static inline void makedep(void) +@@ -841,6 +861,10 @@ static inline void makedep(void) np_list_for_each(pos, &serv->sort.req) { req_t * req = getreq(pos); service_t * dep = req->serv; @@ -96,7 +115,7 @@ const char * name; if (!dep) -@@ -870,7 +889,36 @@ static inline void makedep(void) +@@ -870,7 +894,36 @@ static inline void makedep(void) fprintf(out, "%s:", target); mark = true; } @@ -133,7 +152,7 @@ } if (mark) fputc('\n', out); -@@ -927,6 +975,10 @@ static inline void makedep(void) +@@ -927,6 +980,10 @@ static inline void makedep(void) target = (char*)0; while ((serv = listscripts(&target, 'K', (LVL_NORM|LVL_BOOT)))) { @@ -144,7 +163,7 @@ boolean mark; list_t * pos; -@@ -953,6 +1005,10 @@ static inline void makedep(void) +@@ -953,6 +1010,10 @@ static inline void makedep(void) np_list_for_each(pos, &serv->sort.rev) { req_t * rev = getreq(pos); service_t * dep = rev->serv; @@ -155,7 +174,7 @@ const char * name; if (!dep) -@@ -976,7 +1032,36 @@ static inline void makedep(void) +@@ -976,7 +1037,36 @@ static inline void makedep(void) fprintf(out, "%s:", target); mark = true; } @@ -192,7 +211,7 @@ } if (mark) fputc('\n', out); } -@@ -1378,10 +1463,10 @@ static uchar scan_lsb_headers(const int +@@ -1378,10 +1468,10 @@ static uchar scan_lsb_headers(const int description = empty; } @@ -207,7 +226,7 @@ } else interactive = empty; } -@@ -1416,7 +1501,7 @@ static uchar scan_lsb_headers(const int +@@ -1416,7 +1506,7 @@ static uchar scan_lsb_headers(const int char *name = basename(path); if (*name == 'S' || *name == 'K') name += 3; @@ -216,7 +235,7 @@ if (!ignore) error("exiting now!\n"); } -@@ -1432,7 +1517,7 @@ static uchar scan_lsb_headers(const int +@@ -1432,7 +1522,7 @@ static uchar scan_lsb_headers(const int char *name = basename(path); if (*name == 'S' || *name == 'K') name += 3; @@ -225,7 +244,7 @@ if (!provides) warn("missing `Provides:' entry: please add.\n"); if (provides == empty) -@@ -2336,19 +2421,69 @@ out: +@@ -2336,19 +2426,80 @@ out: } #endif /* SUSE */ @@ -239,10 +258,11 @@ + char *p; + boolean ret = false; + -+ asprintf(&p, SYSTEMD_SERVICE_PATH "/%s.service", service); ++ if (asprintf(&p, SYSTEMD_SERVICE_PATH "/%s.service", service) < 0) ++ error("asprintf(): %s\n", strerror(errno)); + + if (access(p, F_OK) >= 0) -+ ret = true; ++ ret = true; + free(p); + return ret; +} @@ -252,29 +272,39 @@ + + /* systemd isn't installed, skipping */ + if (access(SYSTEMD_BINARY_PATH, F_OK) < 0 || initscript == NULL) -+ return; ++ return; + + if (strncmp("boot.",initscript,5) == 0) -+ name = initscript+5; ++ name = initscript+5; + else -+ name = initscript; ++ name = initscript; + + if (is_overridden_by_systemd (name)) { -+ char *p; -+ int err = 0; -+ if (alternative_root && 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); ++ char *p; ++ int err = 0; ++ ++ if (alternative_root && root) ++ err = asprintf (&p, "/bin/systemctl --no-reload --root %s %s %s.service", root, verb, name); ++ else { ++ struct statfs stfs; ++ if (statfs("/sys/fs/cgroup/systemd", &stfs) < 0 && errno != ENOENT) ++ error("statfs(): %s\n", strerror(errno)); ++ if (errno == 0 && stfs.f_type == CGROUP_SUPER_MAGIC) ++ err = asprintf (&p, "/bin/systemctl %s %s.service", verb, name); ++ else ++ err = asprintf (&p, "/bin/systemctl --no-reload %s %s.service", verb, name); ++ } ++ if (err < 0) ++ error("asprintf(): %s\n", strerror(errno)); ++ ++ 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); + } +} + @@ -306,7 +336,7 @@ }; static void help(const char *restrict const name) attribute((nonnull(1))); -@@ -2364,6 +2499,8 @@ static void help(const char *restrict co +@@ -2364,6 +2515,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"); @@ -315,7 +345,7 @@ printf(" -d, --default Use default runlevels a defined in the scripts\n"); } -@@ -2386,6 +2523,8 @@ int main (int argc, char *argv[]) +@@ -2386,6 +2539,8 @@ int main (int argc, char *argv[]) boolean defaults = false; boolean ignore = false; boolean loadarg = false; @@ -324,7 +354,7 @@ myname = basename(*argv); -@@ -2400,7 +2539,7 @@ int main (int argc, char *argv[]) +@@ -2400,7 +2555,7 @@ int main (int argc, char *argv[]) for (c = 0; c < argc; c++) argr[c] = (char*)0; @@ -333,7 +363,7 @@ size_t l; switch (c) { case 'c': -@@ -2445,6 +2584,9 @@ int main (int argc, char *argv[]) +@@ -2445,6 +2600,9 @@ int main (int argc, char *argv[]) goto err; upstartjob_path = optarg; break; @@ -343,7 +373,7 @@ case '?': err: error("For help use: %s -h\n", myname); -@@ -2566,6 +2708,12 @@ int main (int argc, char *argv[]) +@@ -2566,6 +2724,12 @@ int main (int argc, char *argv[]) printf("Overwrite argument for %s is %s\n", argv[c], argr[c]); #endif /* DEBUG */ @@ -356,7 +386,7 @@ /* * Scan and set our configuration for virtual services. */ -@@ -2612,7 +2760,7 @@ int main (int argc, char *argv[]) +@@ -2612,7 +2776,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. */ @@ -365,7 +395,7 @@ const char *const name = argv[c]; service_t * first = (service_t*)0; char * provides, * begin, * token; -@@ -3000,8 +3148,10 @@ int main (int argc, char *argv[]) +@@ -3000,8 +3164,10 @@ int main (int argc, char *argv[]) if (!del || (del && !isarg)) warn("script %s: service %s already provided!\n", d->d_name, token); @@ -378,7 +408,7 @@ if (!del || (del && !ignore && !isarg)) continue; -@@ -3064,9 +3214,9 @@ int main (int argc, char *argv[]) +@@ -3064,9 +3230,9 @@ int main (int argc, char *argv[]) if (del) ok = chkdependencies(service); else @@ -390,7 +420,7 @@ } if (script_inf.default_start && script_inf.default_start != empty) { -@@ -3357,6 +3507,123 @@ int main (int argc, char *argv[]) +@@ -3357,6 +3523,123 @@ int main (int argc, char *argv[]) active_script(); /* @@ -514,7 +544,7 @@ * Sorry but we support only [KS][0-9][0-9]<name> */ if (maxstart > MAX_DEEP || maxstop > MAX_DEEP) -@@ -3435,13 +3702,16 @@ int main (int argc, char *argv[]) +@@ -3435,13 +3718,16 @@ int main (int argc, char *argv[]) script = (char*)0; while ((serv = listscripts(&script, 'X', lvl))) { @@ -532,7 +562,7 @@ slink = false; if ((serv->start->lvl & lvl) == 0) goto stop; -@@ -3616,7 +3886,7 @@ int main (int argc, char *argv[]) +@@ -3616,7 +3902,7 @@ int main (int argc, char *argv[]) script = (char*)0; while ((serv = listscripts(&script, 'X', seek))) { @@ -541,7 +571,7 @@ boolean found; char * clink; char mode; -@@ -3624,6 +3894,9 @@ int main (int argc, char *argv[]) +@@ -3624,6 +3910,9 @@ int main (int argc, char *argv[]) if (*script == '$') /* Do not link in virtual dependencies */ continue; -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
