From 6ce7d6425e5bcb82b5076cfbbd07a53f6c764283 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: May 26 2011 17:19:27 +0000 Subject: Merge branch 'f15' --- diff --git a/.gitignore b/.gitignore index fa6dc3c..b36ac23 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,9 @@ systemd-*src.rpm /systemd-18.tar.bz2 /systemd-19.tar.bz2 /systemd-20.tar.bz2 +/systemd-21.tar.bz2 +/systemd-22.tar.bz2 +/systemd-23.tar.bz2 +/systemd-24.tar.bz2 +/systemd-25.tar.bz2 +/systemd-26.tar.bz2 diff --git a/0001-dbus-common-fix-segfault-when-a-DBus-message-has-no-.patch b/0001-dbus-common-fix-segfault-when-a-DBus-message-has-no-.patch new file mode 100644 index 0000000..c9efb53 --- /dev/null +++ b/0001-dbus-common-fix-segfault-when-a-DBus-message-has-no-.patch @@ -0,0 +1,37 @@ +From cda2b84a69905aafe2f8c6bd3f1c9eefe92b6bbb Mon Sep 17 00:00:00 2001 +From: Michal Schmidt +Date: Wed, 25 May 2011 16:17:17 +0200 +Subject: [PATCH] dbus-common: fix segfault when a DBus message has no + interface + +dbus_message_get_interface() may return NULL. + +https://bugzilla.redhat.com/show_bug.cgi?id=707483 +--- + src/dbus-common.c | 10 +++++++--- + 1 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/src/dbus-common.c b/src/dbus-common.c +index 9bf0dab..5db077b 100644 +--- a/src/dbus-common.c ++++ b/src/dbus-common.c +@@ -418,9 +418,13 @@ DBusHandlerResult bus_default_message_handler( + return bus_send_error_reply(c, message, &error, -EINVAL); + } + +- } else if (!nulstr_contains(interfaces, dbus_message_get_interface(message))) { +- dbus_set_error_const(&error, DBUS_ERROR_UNKNOWN_INTERFACE, "Unknown interface"); +- return bus_send_error_reply(c, message, &error, -EINVAL); ++ } else { ++ const char *interface = dbus_message_get_interface(message); ++ ++ if (!interface || !nulstr_contains(interfaces, interface)) { ++ dbus_set_error_const(&error, DBUS_ERROR_UNKNOWN_INTERFACE, "Unknown interface"); ++ return bus_send_error_reply(c, message, &error, -EINVAL); ++ } + } + + if (reply) { +-- +1.7.5.2 + diff --git a/0001-pam-downgrade-a-few-log-msgs.patch b/0001-pam-downgrade-a-few-log-msgs.patch new file mode 100644 index 0000000..158fad7 --- /dev/null +++ b/0001-pam-downgrade-a-few-log-msgs.patch @@ -0,0 +1,41 @@ +From 53d5582fa006b0eb528f5dc3f4ba978abd8ac5a3 Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Mon, 16 May 2011 23:31:06 +0200 +Subject: [PATCH] pam: downgrade a few log msgs + +--- + src/pam-module.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/pam-module.c b/src/pam-module.c +index 93eb929..03864fe 100644 +--- a/src/pam-module.c ++++ b/src/pam-module.c +@@ -505,7 +505,7 @@ _public_ PAM_EXTERN int pam_sm_open_session( + goto finish; + } + +- pam_syslog(handle, LOG_INFO, "Moving new user session for %s into control group %s.", username, buf); ++ pam_syslog(handle, LOG_DEBUG, "Moving new user session for %s into control group %s.", username, buf); + + if ((r = create_user_group(handle, SYSTEMD_CGROUP_CONTROLLER, buf, pw, true, true)) != PAM_SUCCESS) + goto finish; +@@ -676,13 +676,13 @@ _public_ PAM_EXTERN int pam_sm_close_session( + } + + if (kill_session && check_user_lists(handle, pw->pw_uid, kill_only_users, kill_exclude_users)) { +- pam_syslog(handle, LOG_INFO, "Killing remaining processes of user session %s of %s.", id, username); ++ pam_syslog(handle, LOG_DEBUG, "Killing remaining processes of user session %s of %s.", id, username); + + /* Kill processes in session cgroup, and delete it */ + if ((r = cg_kill_recursive_and_wait(SYSTEMD_CGROUP_CONTROLLER, session_path, true)) < 0) + pam_syslog(handle, LOG_ERR, "Failed to kill session cgroup: %s", strerror(-r)); + } else { +- pam_syslog(handle, LOG_INFO, "Moving remaining processes of user session %s of %s into control group %s.", id, username, nosession_path); ++ pam_syslog(handle, LOG_DEBUG, "Moving remaining processes of user session %s of %s into control group %s.", id, username, nosession_path); + + /* Migrate processes from session to user + * cgroup. First, try to create the user group +-- +1.7.5.2 + diff --git a/0001-readahead-collect-ignore-EACCES-for-fanotify.patch b/0001-readahead-collect-ignore-EACCES-for-fanotify.patch new file mode 100644 index 0000000..7570e00 --- /dev/null +++ b/0001-readahead-collect-ignore-EACCES-for-fanotify.patch @@ -0,0 +1,27 @@ +From 3afe3725fcf21fab7204243b9485a118e499b4a3 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer +Date: Wed, 25 May 2011 13:09:08 +0200 +Subject: [PATCH] readahead-collect: ignore EACCES for fanotify + +At the start of auditd, we are temporarily not able to read +from the fanotify fd. Ignoring it, seems to work. +--- + src/readahead-collect.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/src/readahead-collect.c b/src/readahead-collect.c +index 3c48a02..913a340 100644 +--- a/src/readahead-collect.c ++++ b/src/readahead-collect.c +@@ -380,7 +380,7 @@ static int collect(const char *root) { + + if ((n = read(fanotify_fd, &data, sizeof(data))) < 0) { + +- if (errno == EINTR || errno == EAGAIN) ++ if (errno == EINTR || errno == EAGAIN || errno == EACCES) + continue; + + log_error("Failed to read event: %m"); +-- +1.7.5.2 + diff --git a/0001-vconsole-use-open_terminal-instead-of-open.patch b/0001-vconsole-use-open_terminal-instead-of-open.patch new file mode 100644 index 0000000..4098069 --- /dev/null +++ b/0001-vconsole-use-open_terminal-instead-of-open.patch @@ -0,0 +1,25 @@ +From a96257af783f1d2c35a957466856e62ebf82bcad Mon Sep 17 00:00:00 2001 +From: Lennart Poettering +Date: Tue, 3 May 2011 17:58:28 +0200 +Subject: [PATCH] vconsole: use open_terminal() instead of open() + +--- + src/vconsole-setup.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/src/vconsole-setup.c b/src/vconsole-setup.c +index 1be260b..68ebac9 100644 +--- a/src/vconsole-setup.c ++++ b/src/vconsole-setup.c +@@ -176,7 +176,7 @@ int main(int argc, char **argv) { + else + vc = "/dev/tty0"; + +- if ((fd = open(vc, O_RDWR|O_CLOEXEC)) < 0) { ++ if ((fd = open_terminal(vc, O_RDWR|O_CLOEXEC)) < 0) { + log_error("Failed to open %s: %m", vc); + goto finish; + } +-- +1.7.5.2 + diff --git a/sources b/sources index 4e11cbc..a640b48 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c1c98eed410ec108b8bf74e4d94d5d66 systemd-20.tar.bz2 +b7c468aa400c64d02d533eba6359e283 systemd-26.tar.bz2 diff --git a/systemd-sysv-convert b/systemd-sysv-convert new file mode 100755 index 0000000..1c3f1a9 --- /dev/null +++ b/systemd-sysv-convert @@ -0,0 +1,148 @@ +#!/usr/bin/python +# -*- Mode: Python; python-indent: 8; indent-tabs-mode: t -*- + +import sys, os, argparse, errno + +def find_service(service, runlevel): + priority = -1 + + for l in os.listdir("/etc/rc%i.d" % runlevel): + if len(l) < 4: + continue + + if l[0] != 'S' or l[3:] != service: + 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) + continue + + if runlevel not in (2, 3, 4, 5): + sys.stderr.write("Runlevel out of bounds in database line %i. Ignoring." % k) + continue + + if priority < 0 or priority > 99: + sys.stderr.write("Priority out of bounds in database line %i. Ignoring." % k) + continue + + 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/rc.d/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.spec b/systemd.spec index 008dd67..5876a9c 100644 --- a/systemd.spec +++ b/systemd.spec @@ -1,8 +1,8 @@ Name: systemd Url: http://www.freedesktop.org/wiki/Software/systemd BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Version: 20 -Release: 1%{?dist} +Version: 26 +Release: 2%{?dist} License: GPLv2+ Group: System Environment/Base Summary: A System and Service Manager @@ -25,23 +25,30 @@ BuildRequires: libtool BuildRequires: make Requires(post): authconfig Requires: systemd-units = %{version}-%{release} -Requires: dbus >= 1.3.2 -Requires: udev >= 160 +Requires: dbus >= 1.4.6-3.fc15 +Requires: udev >= 167 Requires: libudev >= 160 -Requires: initscripts >= 9.22 -Conflicts: selinux-policy < 3.8.7 +Requires: initscripts >= 9.28 +Requires: filesystem >= 2.4.40 +Conflicts: selinux-policy < 3.9.16-12.fc15 Requires: kernel >= 2.6.35.2-9.fc14 Source0: http://www.freedesktop.org/software/systemd/%{name}-%{version}.tar.bz2 # Adds support for the %%{_unitdir} macro Source1: macros.systemd +Source2: systemd-sysv-convert +Patch0: 0001-dbus-common-fix-segfault-when-a-DBus-message-has-no-.patch +Patch1: 0001-readahead-collect-ignore-EACCES-for-fanotify.patch +Patch2: 0001-vconsole-use-open_terminal-instead-of-open.patch +Patch3: 0001-pam-downgrade-a-few-log-msgs.patch + # For sysvinit tools Obsoletes: SysVinit < 2.86-24, sysvinit < 2.86-24 Provides: SysVinit = 2.86-24, sysvinit = 2.86-24 Provides: sysvinit-userspace Provides: systemd-sysvinit Obsoletes: systemd-sysvinit -Obsoletes: upstart < 0.6.5-11 -Obsoletes: upstart-sysvinit < 0.6.5-11 +Obsoletes: upstart < 1.2-3 +Obsoletes: upstart-sysvinit < 1.2-3 Conflicts: upstart-sysvinit Obsoletes: readahead < 1:1.5.7-3 Provides: readahead = 1:1.5.7-3 @@ -76,8 +83,20 @@ Requires: polkit %description gtk Graphical front-end for systemd. +%package sysv +Group: System Environment/Base +Summary: SysV tools for systemd +Requires: %{name} = %{version}-%{release} + +%description sysv +SysV compatibility tools for systemd + %prep %setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build %configure --with-rootdir= --with-distro=fedora @@ -110,20 +129,26 @@ touch %{buildroot}%{_sysconfdir}/systemd/system/runlevel3.target touch %{buildroot}%{_sysconfdir}/systemd/system/runlevel4.target touch %{buildroot}%{_sysconfdir}/systemd/system/runlevel5.target -touch %{buildroot}%{_sysconfdir}/machine-id - # Make sure these directories are properly owned mkdir -p %{buildroot}/lib/systemd/system/basic.target.wants mkdir -p %{buildroot}/lib/systemd/system/default.target.wants mkdir -p %{buildroot}/lib/systemd/system/dbus.target.wants mkdir -p %{buildroot}/lib/systemd/system/syslog.target.wants +# Create new-style configuration files so that we can ghost-own them +touch %{buildroot}%{_sysconfdir}/hostname +touch %{buildroot}%{_sysconfdir}/vconsole.conf +touch %{buildroot}%{_sysconfdir}/locale.conf +touch %{buildroot}%{_sysconfdir}/os-release +touch %{buildroot}%{_sysconfdir}/machine-id +touch %{buildroot}%{_sysconfdir}/machine-info + # Install RPM macros file for systemd mkdir -p %{buildroot}%{_sysconfdir}/rpm/ install -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/rpm/ -# Mask legacy stuff -ln -s rescue.service %{buildroot}/lib/systemd/system/single.service +# Install SysV conversion tool for systemd +install -m 0755 %{SOURCE2} %{buildroot}%{_bindir}/ %clean rm -rf $RPM_BUILD_ROOT @@ -156,10 +181,7 @@ if [ $1 -eq 1 ] ; then # Enable the services we install by default. /bin/systemctl enable \ getty@.service \ - getty.target \ remote-fs.target \ - quotaon.service \ - quotacheck.service \ systemd-readahead-replay.service \ systemd-readahead-collect.service \ hwclock-load.service > /dev/null 2>&1 || : @@ -169,10 +191,7 @@ fi if [ $1 -eq 0 ] ; then /bin/systemctl disable \ getty@.service \ - getty.target \ remote-fs.target \ - quotaon.service \ - quotacheck.service \ systemd-readahead-replay.service \ systemd-readahead-collect.service \ hwclock-load.service > /dev/null 2>&1 || : @@ -188,21 +207,33 @@ fi %files %defattr(-,root,root,-) %config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.systemd1.conf +%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.hostname1.conf %config(noreplace) %{_sysconfdir}/systemd/system.conf %dir %{_sysconfdir}/systemd/user %{_sysconfdir}/xdg/systemd -%{_sysconfdir}/tmpfiles.d/systemd.conf -%{_sysconfdir}/tmpfiles.d/x11.conf +%{_libdir}/../lib/tmpfiles.d/systemd.conf +%{_libdir}/../lib/tmpfiles.d/x11.conf +%{_libdir}/../lib/tmpfiles.d/legacy.conf +%ghost %config(noreplace) %{_sysconfdir}/hostname +%ghost %config(noreplace) %{_sysconfdir}/vconsole.conf +%ghost %config(noreplace) %{_sysconfdir}/locale.conf +%ghost %config(noreplace) %{_sysconfdir}/os-release %ghost %config(noreplace) %{_sysconfdir}/machine-id +%ghost %config(noreplace) %{_sysconfdir}/machine-info /bin/systemd /bin/systemd-notify /bin/systemd-ask-password /bin/systemd-tty-ask-password-agent /bin/systemd-machine-id-setup +/usr/bin/systemd-nspawn +/usr/bin/systemd-stdio-bridge +/usr/bin/systemd-analyze /lib/systemd/systemd-* /lib/udev/rules.d/*.rules %dir /lib/systemd/system-generators +%dir /lib/systemd/system-shutdown /lib/systemd/system-generators/systemd-cryptsetup-generator +/lib/systemd/system-generators/systemd-getty-generator /%{_lib}/security/pam_systemd.so /sbin/init /sbin/reboot @@ -214,23 +245,34 @@ fi %{_bindir}/systemd-cgls %{_mandir}/man1/* %exclude %{_mandir}/man1/systemctl.* +%exclude %{_mandir}/man1/systemadm.* %{_mandir}/man3/* %{_mandir}/man5/* %{_mandir}/man7/* %{_mandir}/man8/* -%{_datadir}/systemd +%{_libdir}/../lib/systemd %{_datadir}/dbus-1/services/org.freedesktop.systemd1.service %{_datadir}/dbus-1/system-services/org.freedesktop.systemd1.service +%{_datadir}/dbus-1/system-services/org.freedesktop.hostname1.service %{_datadir}/dbus-1/interfaces/org.freedesktop.systemd1.*.xml %{_docdir}/systemd +%{_datadir}/polkit-1/actions/org.freedesktop.systemd1.policy +%{_datadir}/polkit-1/actions/org.freedesktop.hostname1.policy %files units %defattr(-,root,root,-) %dir %{_sysconfdir}/systemd %dir %{_sysconfdir}/systemd/system %dir %{_sysconfdir}/tmpfiles.d +%dir %{_sysconfdir}/sysctl.d +%dir %{_sysconfdir}/modules-load.d +%dir %{_sysconfdir}/binfmt.d %dir %{_sysconfdir}/bash_completion.d %dir /lib/systemd +%dir %{_libdir}/../lib/tmpfiles.d +%dir %{_libdir}/../lib/sysctl.d +%dir %{_libdir}/../lib/modules-load.d +%dir %{_libdir}/../lib/binfmt.d /lib/systemd/system /bin/systemctl /bin/systemd-tmpfiles @@ -251,10 +293,60 @@ fi %defattr(-,root,root,-) %{_bindir}/systemadm %{_bindir}/systemd-gnome-ask-password-agent -%{_datadir}/polkit-1/actions/org.freedesktop.systemd1.policy %{_mandir}/man1/systemadm.* +%files sysv +%{_bindir}/systemd-sysv-convert + %changelog +* Wed May 25 2011 Lennart Poettering - 26-2 +- Bugfix release +- https://bugzilla.redhat.com/show_bug.cgi?id=707507 +- https://bugzilla.redhat.com/show_bug.cgi?id=707483 +- https://bugzilla.redhat.com/show_bug.cgi?id=705427 +- https://bugzilla.redhat.com/show_bug.cgi?id=707577 + +* Sat Apr 30 2011 Lennart Poettering - 26-1 +- New upstream release +- https://bugzilla.redhat.com/show_bug.cgi?id=699394 +- https://bugzilla.redhat.com/show_bug.cgi?id=698198 +- https://bugzilla.redhat.com/show_bug.cgi?id=698674 +- https://bugzilla.redhat.com/show_bug.cgi?id=699114 +- https://bugzilla.redhat.com/show_bug.cgi?id=699128 + +* Thu Apr 21 2011 Lennart Poettering - 25-1 +- New upstream release +- https://bugzilla.redhat.com/show_bug.cgi?id=694788 +- https://bugzilla.redhat.com/show_bug.cgi?id=694321 +- https://bugzilla.redhat.com/show_bug.cgi?id=690253 +- https://bugzilla.redhat.com/show_bug.cgi?id=688661 +- https://bugzilla.redhat.com/show_bug.cgi?id=682662 +- https://bugzilla.redhat.com/show_bug.cgi?id=678555 +- https://bugzilla.redhat.com/show_bug.cgi?id=628004 + +* Wed Apr 6 2011 Lennart Poettering - 24-1 +- New upstream release +- https://bugzilla.redhat.com/show_bug.cgi?id=694079 +- https://bugzilla.redhat.com/show_bug.cgi?id=693289 +- https://bugzilla.redhat.com/show_bug.cgi?id=693274 +- https://bugzilla.redhat.com/show_bug.cgi?id=693161 + +* Tue Apr 5 2011 Lennart Poettering - 23-1 +- New upstream release +- Include systemd-sysv-convert + +* Fri Apr 1 2011 Lennart Poettering - 22-1 +- New upstream release + +* Wed Mar 30 2011 Lennart Poettering - 21-2 +- The quota services are now pulled in by mount points, hence no need to enable them explicitly + +* Tue Mar 29 2011 Lennart Poettering - 21-1 +- New upstream release + +* Mon Mar 28 2011 Matthias Clasen - 20-2 +- Apply upstream patch to not send untranslated messages to plymouth + * Tue Mar 8 2011 Lennart Poettering - 20-1 - New upstream release