[systemd-commits] 2 commits - TODO src/core units/systemd-journald.service.in units/systemd-logind.service.in units/systemd-udevd.service.in

Lennart Poettering lennart at kemper.freedesktop.org
Tue Jul 17 17:33:28 PDT 2012


 TODO                              |    8 --------
 src/core/service.c                |   14 ++++++++++----
 units/systemd-journald.service.in |    1 +
 units/systemd-logind.service.in   |    1 +
 units/systemd-udevd.service.in    |    1 +
 5 files changed, 13 insertions(+), 12 deletions(-)

New commits:
commit 47ec118473c864b6ae550fd7ee56d6f4982e5363
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jul 18 02:31:52 2012 +0200

    units: don't enforce a holdoff time for journald, logind, udevd
    
    These services should be restarted as quickly as possible if they fail,
    and the extra safety net of the holdoff time is not necessary.

diff --git a/units/systemd-journald.service.in b/units/systemd-journald.service.in
index 3899745..366655b 100644
--- a/units/systemd-journald.service.in
+++ b/units/systemd-journald.service.in
@@ -16,6 +16,7 @@ After=systemd-journald.socket syslog.socket
 [Service]
 ExecStart=@rootlibexecdir@/systemd-journald
 Restart=always
+RestartSec=0
 NotifyAccess=all
 StandardOutput=null
 CapabilityBoundingSet=CAP_SYS_ADMIN CAP_DAC_OVERRIDE CAP_SYS_PTRACE CAP_SYSLOG CAP_AUDIT_CONTROL CAP_CHOWN CAP_DAC_READ_SEARCH CAP_FOWNER CAP_SETUID CAP_SETGID
diff --git a/units/systemd-logind.service.in b/units/systemd-logind.service.in
index 4acca63..b59809d 100644
--- a/units/systemd-logind.service.in
+++ b/units/systemd-logind.service.in
@@ -14,6 +14,7 @@ After=nss-user-lookup.target
 [Service]
 ExecStart=@rootlibexecdir@/systemd-logind
 Restart=always
+RestartSec=0
 BusName=org.freedesktop.login1
 CapabilityBoundingSet=CAP_AUDIT_CONTROL CAP_CHOWN CAP_KILL CAP_DAC_READ_SEARCH CAP_DAC_OVERRIDE CAP_FOWNER CAP_SYS_TTY_CONFIG
 
diff --git a/units/systemd-udevd.service.in b/units/systemd-udevd.service.in
index 3bf33e5..2fe7822 100644
--- a/units/systemd-udevd.service.in
+++ b/units/systemd-udevd.service.in
@@ -19,4 +19,5 @@ Type=notify
 OOMScoreAdjust=-1000
 Sockets=systemd-udevd-control.socket systemd-udevd-kernel.socket
 Restart=always
+RestartSec=0
 ExecStart=@rootlibexecdir@/systemd-udevd

commit a8bb2e6503fa2a4ed608aa958480d27a696f5146
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Jul 18 02:28:08 2012 +0200

    service: make start jobs wait, not fail, when an automatic restart is queued
    
    When an automatic restart is already queued, then make subsequent start
    jobs wait until the restart can be handled (i.e. after the holdhoff
    time), instead of simply fail.

diff --git a/TODO b/TODO
index 86a2463..172c35b 100644
--- a/TODO
+++ b/TODO
@@ -36,10 +36,6 @@ Features:
 
 * syscall filter: add knowledge about compat syscalls
 
-* flush jobs when switching root
-
-* autorestart of journald after switch-root is broken
-
 * logind: wakelock/opportunistic suspend support
 
 * switch-root: sockets need relabelling
@@ -56,8 +52,6 @@ Features:
 
 * refuse taking lower-case variable names in sd_journal_send() and friends.
 
-* when running as user instance: implicitly default to WorkingDirectory=$HOME for all services.
-
 * Merge KillUnit()'s mode and who params into one
 
 * load-fragment: when loading a unit file via a chain of symlinks
@@ -101,8 +95,6 @@ Features:
 
 * change Requires=basic.target to RequisiteOverride=basic.target
 
-* exclude processes marked with argv[0][0]=@ from the normal service killing too
-
 * support rd.luks.allow-discards= kernel cmdline params in cryptsetup generator
 
 * systemctl: when stopping a service which has triggres and warning about it actually check the TriggeredBy= deps fields
diff --git a/src/core/service.c b/src/core/service.c
index 7a7e25f..cf480ab 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -2258,10 +2258,12 @@ static void service_enter_restart(Service *s) {
         assert(s);
         dbus_error_init(&error);
 
-        if (UNIT(s)->job) {
-                log_info("Job pending for unit, delaying automatic restart.");
+        if (UNIT(s)->job && UNIT(s)->job->type == JOB_STOP) {
+                /* Don't restart things if we are going down anyway */
+                log_info("Stop job pending for unit, delaying automatic restart.");
 
-                if ((r = unit_watch_timer(UNIT(s), s->restart_usec, &s->timer_watch)) < 0)
+                r = unit_watch_timer(UNIT(s), s->restart_usec, &s->timer_watch);
+                if (r < 0)
                         goto fail;
 
                 return;
@@ -2275,6 +2277,10 @@ static void service_enter_restart(Service *s) {
         if (r < 0)
                 goto fail;
 
+        /* Note that we stay in the SERVICE_AUTO_RESTART state here,
+         * it will be canceled as part of the service_stop() call that
+         * is executed as part of JOB_RESTART. */
+
         log_debug("%s scheduled restart job.", UNIT(s)->id);
         return;
 
@@ -2473,7 +2479,7 @@ static int service_start(Unit *u) {
          * service should be manually restarted, not started. */
         if (s->state == SERVICE_AUTO_RESTART) {
                 log_warning("%s automatic restart is pending, must be stopped before issuing start request.", UNIT(s)->id);
-                return -ECANCELED;
+                return -EAGAIN;
         }
 
         assert(s->state == SERVICE_DEAD || s->state == SERVICE_FAILED);



More information about the systemd-commits mailing list