From bf1ab619ffd6d86fdc6bf900b61cc0db5d4094f798b662c2cfc1932c97bcf999 Mon Sep 17 00:00:00 2001 From: Frederic Crozat Date: Wed, 12 Oct 2011 10:44:11 +0000 Subject: [PATCH] Accepting request 87491 from home:fcrozat:systemd - Update to release 37: - many bugfixes - ConditionCapability added, useful for containers. - locale mechanism got extend to kbd configuration for both X and the console - don't try to guess PID for SysV services anymore (bnc#723194) - Drop detect-non-running.patch, logind-warning.patch. - Rewrite systemd-sysv-convert in bash (bnc#716939) OBS-URL: https://build.opensuse.org/request/show/87491 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=214 --- detect-non-running.patch | 30 ---- logind-warning.patch | 35 ----- systemd-36.tar.bz2 | 3 - systemd-37.tar.bz2 | 3 + systemd-gtk.changes | 28 ++++ systemd-gtk.spec | 2 +- systemd-sysv-convert | 301 +++++++++++++++++++++------------------ systemd.changes | 11 ++ systemd.spec | 7 +- 9 files changed, 209 insertions(+), 211 deletions(-) delete mode 100644 detect-non-running.patch delete mode 100644 logind-warning.patch delete mode 100644 systemd-36.tar.bz2 create mode 100644 systemd-37.tar.bz2 diff --git a/detect-non-running.patch b/detect-non-running.patch deleted file mode 100644 index eedcac3c..00000000 --- a/detect-non-running.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 8185a5090a34531b9ef0a65ed3e948e7b6839754 Mon Sep 17 00:00:00 2001 -From: Lennart Poettering -Date: Thu, 29 Sep 2011 15:31:53 +0200 -Subject: [PATCH] systemctl: fix detection whether the dbus connection is available - ---- - src/systemctl.c | 7 +++++++ - 1 files changed, 7 insertions(+), 0 deletions(-) - -diff --git a/src/systemctl.c b/src/systemctl.c -index 848d6a8..7af0f73 100644 ---- a/src/systemctl.c -+++ b/src/systemctl.c -@@ -4989,6 +4989,13 @@ static int systemctl_main(DBusConnection *bus, int argc, char *argv[], DBusError - return 0; - } - -+ if (!bus) { -+ log_error("Failed to get D-Bus connection: %s", error->message); -+ return -EIO; -+ } -+ -+ } else { -+ - if (!bus && !avoid_bus()) { - log_error("Failed to get D-Bus connection: %s", error->message); - return -EIO; --- -1.7.3.4 - diff --git a/logind-warning.patch b/logind-warning.patch deleted file mode 100644 index 4ccf2f67..00000000 --- a/logind-warning.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 3887b5abcb3870db9ed53de3875a465c230ddd3f Mon Sep 17 00:00:00 2001 -From: Lennart Poettering -Date: Tue, 4 Oct 2011 01:38:13 +0200 -Subject: [PATCH] logind: properly generate session creation response on dbus - -This fixes the various reported issues with dbus message parsing when -running su. ---- - src/logind-dbus.c | 4 ++++ - 1 files changed, 4 insertions(+), 0 deletions(-) - -diff --git a/src/logind-dbus.c b/src/logind-dbus.c -index b33a096..bc1e49d 100644 ---- a/src/logind-dbus.c -+++ b/src/logind-dbus.c -@@ -405,12 +405,16 @@ static int bus_manager_create_session(Manager *m, DBusMessage *message, DBusMess - goto fail; - } - -+ seat = session->seat ? session->seat->id : ""; -+ vtnr = session->vtnr; - b = dbus_message_append_args( - reply, - DBUS_TYPE_STRING, &session->id, - DBUS_TYPE_OBJECT_PATH, &p, - DBUS_TYPE_STRING, &session->user->runtime_path, - DBUS_TYPE_UNIX_FD, &fifo_fd, -+ DBUS_TYPE_STRING, &seat, -+ DBUS_TYPE_UINT32, &vtnr, - DBUS_TYPE_INVALID); - free(p); - --- -1.7.3.4 - diff --git a/systemd-36.tar.bz2 b/systemd-36.tar.bz2 deleted file mode 100644 index 45d542d5..00000000 --- a/systemd-36.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:693cd0a8ad63c5e22c0fc45115e05180f0d33f60118972c0d5d080957fc69774 -size 921952 diff --git a/systemd-37.tar.bz2 b/systemd-37.tar.bz2 new file mode 100644 index 00000000..6c1ba106 --- /dev/null +++ b/systemd-37.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b38492bde73649cc3520953354ef446c268169c1d342614183655e9ee1a1bbc5 +size 931101 diff --git a/systemd-gtk.changes b/systemd-gtk.changes index 9891b612..133a2383 100644 --- a/systemd-gtk.changes +++ b/systemd-gtk.changes @@ -1,3 +1,31 @@ +------------------------------------------------------------------- +Wed Oct 12 08:38:36 UTC 2011 - fcrozat@suse.com + +- Update to release 37: + - many bugfixes + - ConditionCapability added, useful for containers. + - locale mechanism got extend to kbd configuration for + both X and the console + - don't try to guess PID for SysV services anymore (bnc#723194) +- Drop detect-non-running.patch, logind-warning.patch. +- Rewrite systemd-sysv-convert in bash (bnc#716939) +------------------------------------------------------------------- +Tue Oct 11 13:57:32 UTC 2011 - coolo@suse.com + +- make sure updaters get in the /sbin/init from here - the sub package + of the split package will decide which init wins in update case + +------------------------------------------------------------------- +Tue Oct 11 13:10:27 UTC 2011 - coolo@suse.com + +- under openSUSE if it's not systemd, chances are good it's + sysvinit + +------------------------------------------------------------------- +Tue Oct 11 11:07:02 UTC 2011 - coolo@suse.com + +- do not list specific sbin_init providers + ------------------------------------------------------------------- Wed Oct 5 16:18:48 UTC 2011 - fcrozat@suse.com diff --git a/systemd-gtk.spec b/systemd-gtk.spec index 6cc184cf..900f4dba 100644 --- a/systemd-gtk.spec +++ b/systemd-gtk.spec @@ -20,7 +20,7 @@ Name: systemd-gtk Url: http://www.freedesktop.org/wiki/Software/systemd -Version: 36 +Version: 37 Release: 1 License: GPLv2+ Group: System/Base diff --git a/systemd-sysv-convert b/systemd-sysv-convert index 1cf2b025..3645f435 100644 --- a/systemd-sysv-convert +++ b/systemd-sysv-convert @@ -1,148 +1,175 @@ -#!/usr/bin/python -# -*- Mode: Python; python-indent: 8; indent-tabs-mode: t -*- +#!/bin/bash -import sys, os, argparse, errno +if [ "$UID" != "0" ]; then + echo Need to be root. + exit 1 +fi -def find_service(service, runlevel): - priority = -1 +declare -A results_runlevel +declare -A results_priority - for l in os.listdir("/etc/rc.d/rc%i.d" % runlevel): - if len(l) < 4: +usage() { +cat << EOF +usage: systemd-sysv-convert [-h] [--save] [--show] [--apply] + SERVICE [SERVICE ...] +EOF +} + +help() { +usage +cat << EOF +Save and Restore SusV Service Runlevel Information + +positional arguments: + SERVICE Service names + +optional arguments: + -h, --help show this help message and exit + --save Save SysV runlevel information for one or more services + --show Show saved SysV runlevel information for one or more services + --apply Apply saved SysV runlevel information for one or more services + to systemd counterparts +EOF +} + +find_service() { +local service +local runlevel +declare -i priority +service=$1 +runlevel=$2 +priority=-1 +for l in /etc/rc.d/rc$runlevel.d/* ; do + initscript=$(basename $l) + if [ ${initscript:0:1} != "S" -o ${initscript:3} != "$service" ]; then + continue + fi + if [ ${initscript:1:2} -ge 0 -a ${initscript:1:2} -le 99 -a ${initscript:1:2} -ge $priority ]; then + if [ ${initscript:1:1} == 0 ]; then + priority=${initscript:2:1} + else + priority=${initscript:1:2} + fi + fi +done +if [ $priority -ge 0 ]; then + return $priority +else + return 255 +fi +} + +lookup_database() { +local services +local service +local runlevel +local priority +local -i k +declare -a parsed +services=$@ +k=0 +results_runlevel=() +results_priority=() +while read line ; do + k+=1 + parsed=($line) + service=${parsed[0]} + runlevel=${parsed[1]} + priority=${parsed[2]} + if [ $runlevel -lt 2 -o $runlevel -gt 5 ]; then + echo "Runlevel out of bounds in database line $k. Ignoring" >/dev/stderr continue - - if l[0] != 'S' or l[3:] != service: + fi + if [ $priority -lt 0 -o $priority -gt 99 ]; then + echo "Priority out of bounds in database line $k. Ignoring" >/dev/stderr continue - - p = int(l[1:3]) - - if p >= 0 and p <= 99 and p >= priority: - priority = p; - - return priority - -def lookup_database(services): - try: - database = open("/var/lib/systemd/sysv-convert/database", "r") - except IOError, e: - if e.errno != errno.ENOENT: - raise e - - return {} - - found = {} - k = 0 - - for line in database: - service, r, p = line.strip().split("\t", 3) - k += 1 - - try: - runlevel = int(r) - priority = int(p) - except ValueError, e: - sys.stderr.write("Failed to parse database line %i. Ignoring." % k) + fi + + declare -i found + found=0 + for s in $services ; do + if [ $s == $service ]; then + found=1 + continue + fi + done + if [ $found -eq 0 ]; then continue + fi + results_runlevel[$service]+=" $runlevel" + results_priority[$service]+=" $priority" +done < /var/lib/systemd/sysv-convert/database +} - if runlevel not in (2, 3, 4, 5): - sys.stderr.write("Runlevel out of bounds in database line %i. Ignoring." % k) - continue +case "$1" in + -h|--help) + help + exit 0 + ;; + --save) + shift + for service in $@ ; do + if [ ! -r "/etc/init.d/$service" ]; then + echo "SysV service $service does not exist" >/dev/stderr + exit 1 + fi + for runlevel in 2 3 4 5; do + find_service $service $runlevel + priority=$? + if [ $priority -lt 255 ]; then + echo "$service $runlevel $priority" >> /var/lib/systemd/sysv-convert/database + fi + done + done + ;; + --show) + shift + services=$@ + lookup_database $services + fail=0 + for service in $services; do + if [ -z "${results_runlevel[$service]}" ]; then + echo No information found about service $service found. >/dev/stderr + fail=1 + continue + fi + declare -i count + count=0 + priority=(${results_priority[$service]}) + for runlevel in ${results_runlevel[$service]}; do + echo SysV service $service enabled in runlevel $runlevel at priority ${priority[$count]} + count+=1 + done + done + exit $fail + ;; + --apply) + shift + services=$@ + for service in $services; do + if [ ! -f "/lib/systemd/system/$service.service" ]; then + echo systemd service $service.service does not exist. >/dev/stderr + exit 1 + fi + done + lookup_database $services + for service in $services; do + if [ -z "${results_runlevel[$service]}" ]; then + echo No information found about service $service found. >/dev/stderr + fail=1 + continue + fi + for runlevel in ${results_runlevel[$service]}; do + echo ln -sf /lib/systemd/system/$service.service /etc/systemd/system/runlevel$runlevel.target.wants/$service.service >/dev/stderr + mkdir -p "/etc/systemd/system/runlevel$runlevel.target.wants" + /bin/ln -sf /lib/systemd/system/$service.service /etc/systemd/system/runlevel$runlevel.target.wants/$service.service + done - if priority < 0 or priority > 99: - sys.stderr.write("Priority out of bounds in database line %i. Ignoring." % k) - continue + done + ;; + *) usage + exit 2;; +esac - if service not in services: - continue - if service not in found: - found[service] = {} - if runlevel not in found[service] or found[service][runlevel] < priority: - found[service][runlevel] = priority - - return found - -def mkdir_p(path): - try: - os.makedirs(path, 0755) - except OSError, e: - if e.errno != errno.EEXIST: - raise e - -if os.geteuid() != 0: - sys.stderr.write("Need to be root.\n") - sys.exit(1) - -parser = argparse.ArgumentParser(description='Save and Restore SysV Service Runlevel Information') - -parser.add_argument('services', metavar='SERVICE', type=str, nargs='+', - help='Service names') - -parser.add_argument('--save', dest='save', action='store_const', - const=True, default=False, - help='Save SysV runlevel information for one or more services') - -parser.add_argument('--show', dest='show', action='store_const', - const=True, default=False, - help='Show saved SysV runlevel information for one or more services') - -parser.add_argument('--apply', dest='apply', action='store_const', - const=True, default=False, - help='Apply saved SysV runlevel information for one or more services to systemd counterparts') - -a = parser.parse_args() - -if a.save: - for service in a.services: - if not os.access("/etc/init.d/%s" % service, os.F_OK): - sys.stderr.write("SysV service %s does not exist.\n" % service) - sys.exit(1) - - mkdir_p("/var/lib/systemd/sysv-convert") - database = open("/var/lib/systemd/sysv-convert/database", "a") - - for runlevel in (2, 3, 4, 5): - priority = find_service(service, runlevel) - - if priority >= 0: - database.write("%s\t%s\t%s\n" % (service, runlevel, priority)) - -elif a.show: - found = lookup_database(a.services) - - if len(found) <= 0: - sys.stderr.write("No information about passed services found.\n") - sys.exit(1) - - for service, data in found.iteritems(): - for runlevel, priority in data.iteritems(): - sys.stdout.write("SysV service %s enabled in runlevel %s at priority %s\n" % (service, runlevel, priority)) - -elif a.apply: - for service in a.services: - if not os.access("/lib/systemd/system/%s.service" % service, os.F_OK): - sys.stderr.write("systemd service %s.service does not exist.\n" % service) - sys.exit(1) - - found = lookup_database(a.services) - - if len(found) <= 0: - sys.stderr.write("No information about passed services found.\n") - sys.exit(1) - - for service, data in found.iteritems(): - for runlevel in data.iterkeys(): - - sys.stderr.write("ln -sf /lib/systemd/system/%s.service /etc/systemd/system/runlevel%i.target.wants/%s.service\n" % (service, runlevel, service)) - - mkdir_p("/etc/systemd/system/runlevel%i.target.wants" % runlevel) - - try: - os.symlink("/lib/systemd/system/%s.service" % service, - "/etc/systemd/system/runlevel%i.target.wants/%s.service" % (runlevel, service)) - except OSError, e: - if e.errno != errno.EEXIST: - raise e - -else: - parser.print_help() diff --git a/systemd.changes b/systemd.changes index b45fab37..133a2383 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,4 +1,15 @@ ------------------------------------------------------------------- +Wed Oct 12 08:38:36 UTC 2011 - fcrozat@suse.com + +- Update to release 37: + - many bugfixes + - ConditionCapability added, useful for containers. + - locale mechanism got extend to kbd configuration for + both X and the console + - don't try to guess PID for SysV services anymore (bnc#723194) +- Drop detect-non-running.patch, logind-warning.patch. +- Rewrite systemd-sysv-convert in bash (bnc#716939) +------------------------------------------------------------------- Tue Oct 11 13:57:32 UTC 2011 - coolo@suse.com - make sure updaters get in the /sbin/init from here - the sub package diff --git a/systemd.spec b/systemd.spec index bec7ce20..60b1bfbd 100644 --- a/systemd.spec +++ b/systemd.spec @@ -21,7 +21,7 @@ Name: systemd Url: http://www.freedesktop.org/wiki/Software/systemd -Version: 36 +Version: 37 Release: 1 License: GPLv2+ Group: System/Base @@ -71,8 +71,6 @@ Patch15: support-sysvinit.patch # Never add any patches to this package without the upstream commit id # in the patch. Any patches added here without a very good reason to make # an exception will be silently removed with the next version update. -Patch12: detect-non-running.patch -Patch14: logind-warning.patch %description Systemd is a system and service manager, compatible with SysV and LSB @@ -120,9 +118,7 @@ Plymouth integration for systemd %patch6 -p1 %patch8 -p1 %patch10 -p1 -%patch12 -p1 %patch13 -p1 -%patch14 -p1 %patch15 -p1 %build @@ -298,6 +294,7 @@ rm -rf %{buildroot} %{_datadir}/polkit-1 %{_datadir}/polkit-1/actions %{_datadir}/polkit-1/actions/org.freedesktop.systemd1.policy +%{_datadir}/systemd %if %{build_plymouth} # Packaged in plymouth subpackage %exclude /lib/systemd/system/plymouth-*.service