[systemd-commits] 5 commits - configure.ac Makefile.am src/cgroup-util.h src/cryptsetup.c src/dbus-common.c src/def.h src/device.c src/execute.c src/execute.h src/main.c src/missing.h src/mount.c src/org.freedesktop.systemd1.conf src/service.c src/socket.c src/swap.c src/systemctl.c src/unit.h TODO

Lennart Poettering lennart at kemper.freedesktop.org
Wed Mar 16 20:06:30 PDT 2011


 Makefile.am                       |    1 
 TODO                              |   12 ++++++++
 configure.ac                      |    3 ++
 src/cgroup-util.h                 |    3 --
 src/cryptsetup.c                  |    3 +-
 src/dbus-common.c                 |    7 ++---
 src/def.h                         |   35 ++++++++++++++++++++++++++
 src/device.c                      |    1 
 src/execute.c                     |    1 
 src/execute.h                     |    4 --
 src/main.c                        |    1 
 src/missing.h                     |   51 +++++++++++++++++++++++++++++---------
 src/mount.c                       |    1 
 src/org.freedesktop.systemd1.conf |    4 ++
 src/service.c                     |    7 ++---
 src/socket.c                      |    1 
 src/swap.c                        |    1 
 src/systemctl.c                   |    6 ++--
 src/unit.h                        |    3 --
 19 files changed, 113 insertions(+), 32 deletions(-)

New commits:
commit d59d0a2b4b41a75eaf618b26b8f8bd1e17de7e2b
Author: cee1 <fykcee1 at gmail.com>
Date:   Thu Mar 17 10:13:01 2011 +0800

    read-ahead: Fix broken systemd-readahead-collect on mips.
    
    This actually adjust the __NR_fanotify* system call numbers to proper
    ones on mips(according userspace ABI).

diff --git a/configure.ac b/configure.ac
index cae2dce..8a28c8e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,6 +28,9 @@ AC_SUBST(PACKAGE_URL, [http://www.freedesktop.org/wiki/Software/systemd])
 
 AC_CANONICAL_HOST
 AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
+AS_IF([test "x$host_cpu" = "xmips" || test "x$host_cpu" = "xmipsel" ||
+       test "x$host_cpu" = "xmips64" || test "x$host_cpu" = "xmips64el"],
+      [AC_DEFINE(ARCH_MIPS, [], [Whether on mips arch])])
 
 AM_SILENT_RULES([yes])
 
diff --git a/src/missing.h b/src/missing.h
index c0cb3ea..35e209f 100644
--- a/src/missing.h
+++ b/src/missing.h
@@ -36,6 +36,10 @@
 
 #include "macro.h"
 
+#ifdef ARCH_MIPS
+#include <asm/sgidefs.h>
+#endif
+
 #ifndef RLIMIT_RTTIME
 #define RLIMIT_RTTIME 15
 #endif
@@ -77,19 +81,42 @@ static inline int pivot_root(const char *new_root, const char *put_old) {
 }
 
 #ifdef __x86_64__
-#ifndef __NR_fanotify_init
-#define __NR_fanotify_init 300
-#endif
-#ifndef __NR_fanotify_mark
-#define __NR_fanotify_mark 301
-#endif
+#  ifndef __NR_fanotify_init
+#    define __NR_fanotify_init 300
+#  endif
+#  ifndef __NR_fanotify_mark
+#    define __NR_fanotify_mark 301
+#  endif
+#elif defined _MIPS_SIM
+#  if _MIPS_SIM == _MIPS_SIM_ABI32
+#    ifndef __NR_fanotify_init
+#      define __NR_fanotify_init 4336
+#    endif
+#    ifndef __NR_fanotify_mark
+#      define __NR_fanotify_mark 4337
+#    endif
+#  elif _MIPS_SIM == _MIPS_SIM_NABI32
+#    ifndef __NR_fanotify_init
+#      define __NR_fanotify_init 6300
+#    endif
+#    ifndef __NR_fanotify_mark
+#      define __NR_fanotify_mark 6301
+#    endif
+#  elif _MIPS_SIM == _MIPS_SIM_ABI64
+#    ifndef __NR_fanotify_init
+#      define __NR_fanotify_init 5295
+#    endif
+#    ifndef __NR_fanotify_mark
+#      define __NR_fanotify_mark 5296
+#    endif
+#  endif
 #else
-#ifndef __NR_fanotify_init
-#define __NR_fanotify_init 338
-#endif
-#ifndef __NR_fanotify_mark
-#define __NR_fanotify_mark 339
-#endif
+#  ifndef __NR_fanotify_init
+#    define __NR_fanotify_init 338
+#  endif
+#  ifndef __NR_fanotify_mark
+#    define __NR_fanotify_mark 339
+#  endif
 #endif
 
 static inline int fanotify_init(unsigned int flags, unsigned int event_f_flags) {

commit f6a6225e414858ff222d2b175369cc42459abf9a
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Mar 17 04:02:35 2011 +0100

    def: centralize definition of default timeout in one place

diff --git a/Makefile.am b/Makefile.am
index 3bac478..8d23430 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -501,6 +501,7 @@ EXTRA_DIST += \
 	${libsystemd_core_la_SOURCES:.c=.h} \
 	${libsystemd_daemon_la_SOURCES:.c=.h} \
 	src/macro.h \
+        src/def.h \
 	src/ioprio.h \
 	src/missing.h \
 	src/list.h \
diff --git a/src/cgroup-util.h b/src/cgroup-util.h
index 1eccbc9..d142af3 100644
--- a/src/cgroup-util.h
+++ b/src/cgroup-util.h
@@ -27,8 +27,7 @@
 #include <dirent.h>
 
 #include "set.h"
-
-#define SYSTEMD_CGROUP_CONTROLLER "name=systemd"
+#include "def.h"
 
 int cg_enumerate_processes(const char *controller, const char *path, FILE **_f);
 int cg_enumerate_tasks(const char *controller, const char *path, FILE **_f);
diff --git a/src/cryptsetup.c b/src/cryptsetup.c
index 989734b..3aa822a 100644
--- a/src/cryptsetup.c
+++ b/src/cryptsetup.c
@@ -31,6 +31,7 @@
 #include "util.h"
 #include "strv.h"
 #include "ask-password-api.h"
+#include "def.h"
 
 static const char *opt_type = NULL; /* LUKS1 or PLAIN */
 static char *opt_cipher = NULL;
@@ -308,7 +309,7 @@ int main(int argc, char *argv[]) {
                 if (opt_readonly)
                         flags |= CRYPT_ACTIVATE_READONLY;
 
-                until = now(CLOCK_MONOTONIC) + (opt_timeout > 0 ? opt_timeout : 60 * USEC_PER_SEC);
+                until = now(CLOCK_MONOTONIC) + (opt_timeout > 0 ? opt_timeout : DEFAULT_TIMEOUT_USEC);
 
                 opt_tries = opt_tries > 0 ? opt_tries : 3;
                 opt_key_size = (opt_key_size > 0 ? opt_key_size : 256);
diff --git a/src/dbus-common.c b/src/dbus-common.c
index bb9cf2e..e352b8c 100644
--- a/src/dbus-common.c
+++ b/src/dbus-common.c
@@ -30,6 +30,7 @@
 #include "log.h"
 #include "dbus-common.h"
 #include "util.h"
+#include "def.h"
 
 int bus_check_peercred(DBusConnection *c) {
         int fd;
@@ -57,8 +58,6 @@ int bus_check_peercred(DBusConnection *c) {
         return 1;
 }
 
-#define TIMEOUT_USEC (60*USEC_PER_SEC)
-
 static int sync_auth(DBusConnection *bus, DBusError *error) {
         usec_t begin, tstamp;
 
@@ -71,13 +70,13 @@ static int sync_auth(DBusConnection *bus, DBusError *error) {
         begin = tstamp = now(CLOCK_MONOTONIC);
         for (;;) {
 
-                if (tstamp > begin + TIMEOUT_USEC)
+                if (tstamp > begin + DEFAULT_TIMEOUT_USEC)
                         break;
 
                 if (dbus_connection_get_is_authenticated(bus))
                         break;
 
-                if (!dbus_connection_read_write_dispatch(bus, ((begin + TIMEOUT_USEC - tstamp) + USEC_PER_MSEC - 1) / USEC_PER_MSEC))
+                if (!dbus_connection_read_write_dispatch(bus, ((begin + DEFAULT_TIMEOUT_USEC - tstamp) + USEC_PER_MSEC - 1) / USEC_PER_MSEC))
                         break;
 
                 tstamp = now(CLOCK_MONOTONIC);
diff --git a/src/def.h b/src/def.h
new file mode 100644
index 0000000..c23cd33
--- /dev/null
+++ b/src/def.h
@@ -0,0 +1,35 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+#ifndef foodefhfoo
+#define foodefhfoo
+
+/***
+  This file is part of systemd.
+
+  Copyright 2010 Lennart Poettering
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include "util.h"
+
+#define DEFAULT_TIMEOUT_USEC (3*USEC_PER_MINUTE)
+#define DEFAULT_RESTART_USEC (100*USEC_PER_MSEC)
+
+#define SYSTEMD_CGROUP_CONTROLLER "name=systemd"
+
+#define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT
+#define SIGNALS_IGNORE SIGKILL,SIGPIPE
+
+#endif
diff --git a/src/device.c b/src/device.c
index ccf2935..41c96ce 100644
--- a/src/device.c
+++ b/src/device.c
@@ -29,6 +29,7 @@
 #include "log.h"
 #include "unit-name.h"
 #include "dbus-device.h"
+#include "def.h"
 
 static const UnitActiveState state_translation_table[_DEVICE_STATE_MAX] = {
         [DEVICE_DEAD] = UNIT_INACTIVE,
diff --git a/src/execute.c b/src/execute.c
index 556ff9b..c1edf61 100644
--- a/src/execute.c
+++ b/src/execute.c
@@ -55,6 +55,7 @@
 #include "exit-status.h"
 #include "missing.h"
 #include "utmp-wtmp.h"
+#include "def.h"
 
 /* This assumes there is a 'tty' group */
 #define TTY_MODE 0620
diff --git a/src/execute.h b/src/execute.h
index e77cdcf..755dea3 100644
--- a/src/execute.h
+++ b/src/execute.h
@@ -42,10 +42,6 @@ struct CGroupBonding;
 /* Abstract namespace! */
 #define LOGGER_SOCKET "/dev/.run/systemd/logger"
 
-/* This doesn't really belong here, but I couldn't find a better place to put this. */
-#define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT
-#define SIGNALS_IGNORE SIGKILL,SIGPIPE
-
 typedef enum KillMode {
         KILL_CONTROL_GROUP = 0,
         KILL_PROCESS_GROUP,
diff --git a/src/main.c b/src/main.c
index 5154b57..7edd6b5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -51,6 +51,7 @@
 #include "label.h"
 #include "build.h"
 #include "strv.h"
+#include "def.h"
 
 static enum {
         ACTION_RUN,
diff --git a/src/mount.c b/src/mount.c
index 0078010..39525b6 100644
--- a/src/mount.c
+++ b/src/mount.c
@@ -37,6 +37,7 @@
 #include "special.h"
 #include "bus-errors.h"
 #include "exit-status.h"
+#include "def.h"
 
 static const UnitActiveState state_translation_table[_MOUNT_STATE_MAX] = {
         [MOUNT_DEAD] = UNIT_INACTIVE,
diff --git a/src/service.c b/src/service.c
index e7a9e7c..0f28312 100644
--- a/src/service.c
+++ b/src/service.c
@@ -35,13 +35,12 @@
 #include "special.h"
 #include "bus-errors.h"
 #include "exit-status.h"
-
-#define COMMENTS "#;\n"
-#define NEWLINES "\n\r"
+#include "def.h"
+#include "util.h"
 
 #ifdef HAVE_SYSV_COMPAT
 
-#define DEFAULT_SYSV_TIMEOUT_USEC (3*USEC_PER_MINUTE)
+#define DEFAULT_SYSV_TIMEOUT_USEC (5*USEC_PER_MINUTE)
 
 typedef enum RunlevelType {
         RUNLEVEL_UP,
diff --git a/src/socket.c b/src/socket.c
index 130f51c..9045a2f 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -42,6 +42,7 @@
 #include "bus-errors.h"
 #include "label.h"
 #include "exit-status.h"
+#include "def.h"
 
 static const UnitActiveState state_translation_table[_SOCKET_STATE_MAX] = {
         [SOCKET_DEAD] = UNIT_INACTIVE,
diff --git a/src/swap.c b/src/swap.c
index f59b0fb..035efba 100644
--- a/src/swap.c
+++ b/src/swap.c
@@ -37,6 +37,7 @@
 #include "special.h"
 #include "bus-errors.h"
 #include "exit-status.h"
+#include "def.h"
 
 static const UnitActiveState state_translation_table[_SWAP_STATE_MAX] = {
         [SWAP_DEAD] = UNIT_INACTIVE,
diff --git a/src/unit.h b/src/unit.h
index 9b7eb5e..4245f3c 100644
--- a/src/unit.h
+++ b/src/unit.h
@@ -40,9 +40,6 @@ typedef enum UnitDependency UnitDependency;
 #include "execute.h"
 #include "condition.h"
 
-#define DEFAULT_TIMEOUT_USEC (3*USEC_PER_MINUTE)
-#define DEFAULT_RESTART_USEC (100*USEC_PER_MSEC)
-
 enum UnitType {
         UNIT_SERVICE = 0,
         UNIT_SOCKET,

commit b74949bcdc65982a5eaca64c836f4d2a3b8a8d0c
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Mar 17 03:42:25 2011 +0100

    chkconfig: check against runlevel 5 instead of 3, since it is a superset of the latter

diff --git a/src/systemctl.c b/src/systemctl.c
index 87ecf03..5e34d03 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -4098,7 +4098,7 @@ static int install_info_apply(const char *verb, LookupPaths *paths, InstallInfo
                                 argv[1] = file_name_from_path(sysv);
                                 argv[2] =
                                         streq(verb, "enable") ? "on" :
-                                        streq(verb, "disable") ? "off" : "--level=3";
+                                        streq(verb, "disable") ? "off" : "--level=5";
 
                                 log_info("Executing %s %s %s", argv[0], argv[1], strempty(argv[2]));
 

commit a76f7be2b02416ff430625766619f4443f2141cf
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Mar 17 03:41:51 2011 +0100

    systemctl: accept condstop as alias for stop

diff --git a/src/systemctl.c b/src/systemctl.c
index 5db094f..87ecf03 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -1420,7 +1420,8 @@ static int start_unit(DBusConnection *bus, char **args, unsigned n) {
 
         if (arg_action == ACTION_SYSTEMCTL) {
                 method =
-                        streq(args[0], "stop")                  ? "StopUnit" :
+                        streq(args[0], "stop") ||
+                        streq(args[0], "condstop")              ? "StopUnit" :
                         streq(args[0], "reload")                ? "ReloadUnit" :
                         streq(args[0], "restart")               ? "RestartUnit" :
 
@@ -5235,6 +5236,7 @@ static int systemctl_main(DBusConnection *bus, int argc, char *argv[], DBusError
                 { "cancel",                MORE,  2, cancel_job        },
                 { "start",                 MORE,  2, start_unit        },
                 { "stop",                  MORE,  2, start_unit        },
+                { "condstop",              MORE,  2, start_unit        }, /* For compatibility with ALTLinux */
                 { "reload",                MORE,  2, start_unit        },
                 { "restart",               MORE,  2, start_unit        },
                 { "try-restart",           MORE,  2, start_unit        },

commit e677657e8dddb33d1f1e32eda0ebc126e08a538d
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Mar 17 03:41:29 2011 +0100

    dbus: allow LoadUnit to unprivileged users

diff --git a/TODO b/TODO
index 307d023..1a373cc 100644
--- a/TODO
+++ b/TODO
@@ -28,6 +28,18 @@ F15:
 
 * serialize condition execution information
 
+* rework syslog.service being up logic in PID 1
+
+* rsyslog.service should hook itself into syslog.target?
+
+* syslog.target should be pulled in by multi-user.target
+
+* don't strip facility from kmsg log messages as soon as that is possible.
+
+* pull in .service from meta .targers AND vice versa too. i.e. syslog.target ←→ rsyslog.service, rpcbind similarly
+
+* drop Names= option?
+
 Features:
 
 * optionally create watched directories in .path units
diff --git a/src/org.freedesktop.systemd1.conf b/src/org.freedesktop.systemd1.conf
index 6db71e2..8008f0f 100644
--- a/src/org.freedesktop.systemd1.conf
+++ b/src/org.freedesktop.systemd1.conf
@@ -52,6 +52,10 @@
 
                 <allow send_destination="org.freedesktop.systemd1"
                        send_interface="org.freedesktop.systemd1.Manager"
+                       send_member="LoadUnit"/>
+
+                <allow send_destination="org.freedesktop.systemd1"
+                       send_interface="org.freedesktop.systemd1.Manager"
                        send_member="GetJob"/>
 
                 <allow send_destination="org.freedesktop.systemd1"



More information about the systemd-commits mailing list