[systemd-commits] 2 commits - src/job.c src/systemctl.c TODO
Lennart Poettering
lennart at kemper.freedesktop.org
Fri Apr 15 18:30:04 PDT 2011
TODO | 29 +++++++++++++++--------------
src/job.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++------
src/systemctl.c | 9 +++++++++
3 files changed, 71 insertions(+), 20 deletions(-)
New commits:
commit 3d3961f26770b2949a30a72457e1660969bc17b8
Author: Lennart Poettering <lennart at poettering.net>
Date: Sat Apr 16 03:29:54 2011 +0200
systemctl: always consider unit files with no [Install] section but stored in /lib enabled
diff --git a/TODO b/TODO
index 6c94a42..2070a74 100644
--- a/TODO
+++ b/TODO
@@ -7,8 +7,6 @@ F15:
* NM should pull in network.target (PENDING)
https://bugzilla.redhat.com/show_bug.cgi?id=692008
-* ntpd should pull in time-sync.target. (PENDING)
-
* bluetooth should be possible to disable (PENDING)
* add fstab fields to add wait timeouts, change Wants to Requires by local-fs.target
@@ -19,16 +17,25 @@ F15:
* 0595f9a1c182a84581749823ef47c5f292e545f9 is borked, freezes shutdown
(path: after installing inotify watches, recheck file again to fix race)
-* be nice to ingo
-
* get writev() /dev/kmsg support into the F15 kernel
https://lkml.org/lkml/2011/4/6/473
patched merged into -mm
* fix sd_is_socket() invocation in dbus
+* fix default timeout values mentioned in man page
+
+* New CK release, with sysinit.target dropping and TTY loop
+
+* New Avahi package, enable it by default
+
+* don't trim empty cgroups
+ https://bugzilla.redhat.com/show_bug.cgi?id=678555
+
Features:
+* use pivot_root on shutdown so that we can unmount the root directory.
+
* make sure multiple sockets in a .socket file appear in the order they are listed
currently we get:
[Socket]
@@ -37,15 +44,12 @@ Features:
* fix alsa mixer restore to not print error when no config is stored
-* don't trim empty cgroups
- https://bugzilla.redhat.com/show_bug.cgi?id=678555
-
* show enablement status in systemctl status
* write blog stories about:
- - the blame game: systemd-analyze
- enabling dbus services
- status update
+ - you are a distro: why switch?
* allow port = 0 in .socket units
@@ -53,8 +57,6 @@ Features:
* introduce /usr/lib/binfmt.d/, /usr/lib/tmpfiles.d/
-* in pam_systemd: don't rely on /proc/self/loginuid in a container (check if audit caps are there)
-
* take BSD file lock on tty devices when using them?
* avoid any flag files, or readahead files in /, we need to support r/o /
@@ -113,8 +115,6 @@ Features:
* Support --test based on current system state
-* consider services with no [Install] section and stored in /lib enabled by "systemctl is-enabled"
-
* systemctl enable as D-Bus call
* consider services with any kind of link in /etc/systemd/system enabled
@@ -150,8 +150,9 @@ Features:
* configurable jitter for timer events
-* Support ProcessNeededForShutdown=true to allow stuff like mdmon
- to be killed very late after the rootfs is read only (?)
+* Support ProcessNeededForShutdown=true to allow stuff like mdmon to
+ be killed very late after the rootfs is read only? If implement pass
+ this to shutdown binary via command line argument.
* Integrate "mdadm --wait-clean". Maybe just let SIGTERM to mdmon trigger the
needed action
diff --git a/src/systemctl.c b/src/systemctl.c
index 0a72874..39901c3 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -4152,6 +4152,15 @@ static int install_info_apply(const char *verb, LookupPaths *paths, InstallInfo
return -ENOENT;
}
+ /* Consider unit files stored in /lib and /usr always enabled
+ * if they have no [Install] data. */
+ if (streq(verb, "is-enabled") &&
+ strv_isempty(i->aliases) &&
+ strv_isempty(i->wanted_by) &&
+ (path_startswith(filename, "/lib") ||
+ path_startswith(filename, "/usr")))
+ return 1;
+
i->path = filename;
if ((r = config_parse(filename, f, NULL, items, true, i)) < 0) {
commit e02cd6f7e039b020a2782c61ea7a84c3ad85ca17
Author: Lennart Poettering <lennart at poettering.net>
Date: Sat Apr 16 03:07:38 2011 +0200
job: also print status messages when we successfully started a unit
diff --git a/src/job.c b/src/job.c
index dcfa323..26e1a7c 100644
--- a/src/job.c
+++ b/src/job.c
@@ -476,6 +476,52 @@ int job_run_and_invalidate(Job *j) {
return r;
}
+static void job_print_status_message(Unit *u, JobType t, JobResult result) {
+ assert(u);
+
+ if (t == JOB_START) {
+
+ switch (result) {
+
+ case JOB_DONE:
+ unit_status_printf(u, "Started %s.\n", unit_description(u));
+ break;
+
+ case JOB_FAILED:
+ unit_status_printf(u, "Starting %s " ANSI_HIGHLIGHT_ON "failed" ANSI_HIGHLIGHT_OFF ", see 'systemctl status %s' for details.\n", unit_description(u), u->meta.id);
+ break;
+
+ case JOB_DEPENDENCY:
+ unit_status_printf(u, "Starting %s " ANSI_HIGHLIGHT_ON "aborted" ANSI_HIGHLIGHT_OFF " because a dependency failed.\n", unit_description(u));
+ break;
+
+ case JOB_TIMEOUT:
+ unit_status_printf(u, "Starting %s " ANSI_HIGHLIGHT_ON "timed out" ANSI_HIGHLIGHT_OFF ".\n", unit_description(u), u->meta.id);
+ break;
+
+ default:
+ ;
+ }
+
+ } else if (t == JOB_STOP) {
+
+ switch (result) {
+
+ case JOB_TIMEOUT:
+ unit_status_printf(u, "Stopping %s " ANSI_HIGHLIGHT_ON "timed out" ANSI_HIGHLIGHT_OFF ".\n", unit_description(u), u->meta.id);
+ break;
+
+ case JOB_DONE:
+ case JOB_FAILED:
+ unit_status_printf(u, "Stopped %s.\n", unit_description(u));
+ break;
+
+ default:
+ ;
+ }
+ }
+}
+
int job_finish_and_invalidate(Job *j, JobResult result) {
Unit *u;
Unit *other;
@@ -512,12 +558,7 @@ int job_finish_and_invalidate(Job *j, JobResult result) {
t = j->type;
job_free(j);
- if (result == JOB_FAILED && t == JOB_START)
- unit_status_printf(u, "Starting %s " ANSI_HIGHLIGHT_ON "failed" ANSI_HIGHLIGHT_OFF ", see 'systemctl status %s' for details.\n", unit_description(u), u->meta.id);
- else if (result == JOB_TIMEOUT && t == JOB_START)
- unit_status_printf(u, "Starting %s " ANSI_HIGHLIGHT_ON "timed out" ANSI_HIGHLIGHT_OFF ".\n", unit_description(u), u->meta.id);
- else if (result == JOB_TIMEOUT && t == JOB_STOP)
- unit_status_printf(u, "Stopping %s " ANSI_HIGHLIGHT_ON "timed out" ANSI_HIGHLIGHT_OFF ".\n", unit_description(u), u->meta.id);
+ job_print_status_message(u, t, result);
/* Fail depending jobs on failure */
if (result != JOB_DONE) {
More information about the systemd-commits
mailing list