[systemd-commits] 4 commits - man/hostnamectl.xml man/journalctl.xml man/localectl.xml man/timedatectl.xml src/core src/hostname src/journal src/locale src/shared src/systemctl src/timedate
Zbigniew JÄdrzejewski-Szmek
zbyszek at kemper.freedesktop.org
Tue May 21 06:24:51 PDT 2013
man/hostnamectl.xml | 8 ++++++++
man/journalctl.xml | 10 ++++++++++
man/localectl.xml | 8 ++++++++
man/timedatectl.xml | 8 ++++++++
src/core/service.c | 6 ++----
src/hostname/hostnamectl.c | 1 +
src/journal/coredumpctl.c | 1 +
src/locale/localectl.c | 1 +
src/shared/install.c | 33 +++++++++++++++++++--------------
src/systemctl/systemctl.c | 22 +++++++++++++---------
src/timedate/timedatectl.c | 1 +
11 files changed, 72 insertions(+), 27 deletions(-)
New commits:
commit 2927b326ccf67236e148444679f582ea1437ef5a
Author: Jan Janssen <medhefgo at web.de>
Date: Fri May 17 15:38:13 2013 +0200
man: Document missing options
diff --git a/man/hostnamectl.xml b/man/hostnamectl.xml
index 9efe220..801ab3a 100644
--- a/man/hostnamectl.xml
+++ b/man/hostnamectl.xml
@@ -116,6 +116,14 @@
</varlistentry>
<varlistentry>
+ <term><option>-P</option></term>
+ <term><option>--privileged</option></term>
+
+ <listitem><para>Acquire privileges via PolicyKit
+ before executing the operation.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>-H</option></term>
<term><option>--host</option></term>
diff --git a/man/journalctl.xml b/man/journalctl.xml
index cc7d1a0..d9ca0a6 100644
--- a/man/journalctl.xml
+++ b/man/journalctl.xml
@@ -323,6 +323,16 @@
</varlistentry>
<varlistentry>
+ <term><option>-k</option></term>
+ <term><option>--dmesg</option></term>
+
+ <listitem><para>Show kernel messages from
+ current boot. This implies <option>-b</option>
+ and adds the match <literal>_TRANSPORT=kernel</literal>.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>-u</option></term>
<term><option>--unit=</option></term>
diff --git a/man/localectl.xml b/man/localectl.xml
index 0b13c11..febdeec 100644
--- a/man/localectl.xml
+++ b/man/localectl.xml
@@ -109,6 +109,14 @@
</varlistentry>
<varlistentry>
+ <term><option>-P</option></term>
+ <term><option>--privileged</option></term>
+
+ <listitem><para>Acquire privileges via PolicyKit
+ before executing the operation.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>-H</option></term>
<term><option>--host</option></term>
diff --git a/man/timedatectl.xml b/man/timedatectl.xml
index faccc50..e291f04 100644
--- a/man/timedatectl.xml
+++ b/man/timedatectl.xml
@@ -98,6 +98,14 @@
</varlistentry>
<varlistentry>
+ <term><option>-P</option></term>
+ <term><option>--privileged</option></term>
+
+ <listitem><para>Acquire privileges via PolicyKit
+ before executing the operation.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>-H</option></term>
<term><option>--host</option></term>
diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c
index 064581a..7acd772 100644
--- a/src/hostname/hostnamectl.c
+++ b/src/hostname/hostnamectl.c
@@ -362,6 +362,7 @@ static int help(void) {
" --transient Only set transient hostname\n"
" --static Only set static hostname\n"
" --pretty Only set pretty hostname\n"
+ " -P --privileged Acquire privileges before execution\n"
" --no-ask-password Do not prompt for password\n"
" -H --host=[USER@]HOST Operate on remote host\n\n"
"Commands:\n"
diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c
index 5652c2f..e1bd862 100644
--- a/src/journal/coredumpctl.c
+++ b/src/journal/coredumpctl.c
@@ -84,6 +84,7 @@ static int help(void) {
"Flags:\n"
" -o --output=FILE Write output to FILE\n"
" --no-pager Do not pipe output into a pager\n"
+ " --no-legend Do not print the column headers.\n\n"
"Commands:\n"
" -h --help Show this help\n"
diff --git a/src/locale/localectl.c b/src/locale/localectl.c
index 50250c4..3096d06 100644
--- a/src/locale/localectl.c
+++ b/src/locale/localectl.c
@@ -712,6 +712,7 @@ static int help(void) {
" --version Show package version\n"
" --no-convert Don't convert keyboard mappings\n"
" --no-pager Do not pipe output into a pager\n"
+ " -P --privileged Acquire privileges before execution\n"
" --no-ask-password Do not prompt for password\n"
" -H --host=[USER@]HOST Operate on remote host\n\n"
"Commands:\n"
diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c
index 8d4e560..be3b8b4 100644
--- a/src/timedate/timedatectl.c
+++ b/src/timedate/timedatectl.c
@@ -501,6 +501,7 @@ static int help(void) {
" --adjust-system-clock\n"
" Adjust system clock when changing local RTC mode\n"
" --no-pager Do not pipe output into a pager\n"
+ " -P --privileged Acquire privileges before execution\n"
" --no-ask-password Do not prompt for password\n"
" -H --host=[USER@]HOST Operate on remote host\n\n"
"Commands:\n"
commit 67820a0cbdc9d72a1074debf8b2bc72203c775cc
Author: Michael Tremer <michael.tremer at ipfire.org>
Date: Sun May 19 15:45:48 2013 +0200
systemctl: make systemctl is-enabled work for templated units
Patch resolves the problem that 'systemctl is-enabled' does
not work for templated units.
Without this patch, systemctl is-enabled something at abc.service
returned "No such file or directory", because it first checked
if /usr/lib/systemd/system/something at abc.service, etc. exists.
If systemctl is-enabled is called for templated units, this
check should be omitted and it should search for symlinks in
the .wants dirs right away.
This patch fixes the broken behaviour and resolves
https://bugs.freedesktop.org/show_bug.cgi?id=55318.
[zj: fixed the patch to still check for broken symlinks and
masked instances. Also removed untrue assumptions from
the patch description.]
diff --git a/src/shared/install.c b/src/shared/install.c
index edf4d2a..8f27c6d 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -1609,24 +1609,29 @@ UnitFileState unit_file_get_state(
if (!path)
return -ENOMEM;
+ /*
+ * Search for a unit file in our default paths, to
+ * be sure, that there are no broken symlinks.
+ */
if (lstat(path, &st) < 0) {
r = -errno;
- if (errno == ENOENT)
- continue;
-
- return -errno;
- }
+ if (errno != ENOENT)
+ return r;
- if (!S_ISREG(st.st_mode) && !S_ISLNK(st.st_mode))
- return -ENOENT;
+ if (!unit_name_is_instance(name))
+ continue;
+ } else {
+ if (!S_ISREG(st.st_mode) && !S_ISLNK(st.st_mode))
+ return -ENOENT;
- r = null_or_empty_path(path);
- if (r < 0 && r != -ENOENT)
- return r;
- else if (r > 0) {
- state = path_startswith(*i, "/run") ?
- UNIT_FILE_MASKED_RUNTIME : UNIT_FILE_MASKED;
- return state;
+ r = null_or_empty_path(path);
+ if (r < 0 && r != -ENOENT)
+ return r;
+ else if (r > 0) {
+ state = path_startswith(*i, "/run") ?
+ UNIT_FILE_MASKED_RUNTIME : UNIT_FILE_MASKED;
+ return state;
+ }
}
r = find_symlinks_in_scope(scope, root_dir, name, &state);
commit 9e9c3abcfa6b93500960531d0d7aa64b8b2b0349
Author: Michael Olbrich <m.olbrich at pengutronix.de>
Date: Sun May 19 12:10:55 2013 +0200
service: kill processes with SIGKILL on watchdog failure
Just calling service_enter_dead() does not kill any processes.
As a result, the old process may still be running when the new one is
started.
After a watchdog failure the service is in an undefined state.
Using the normal shutdown mechanism makes no sense. Instead all processes
are just killed and the service can try to restart.
diff --git a/src/core/service.c b/src/core/service.c
index 3617c24..e110a41 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -235,7 +235,7 @@ static void service_stop_watchdog(Service *s) {
s->watchdog_timestamp.monotonic = 0;
}
-static void service_enter_dead(Service *s, ServiceResult f, bool allow_restart);
+static void service_enter_signal(Service *s, ServiceState state, ServiceResult f);
static void service_handle_watchdog(Service *s) {
usec_t offset;
@@ -249,7 +249,7 @@ static void service_handle_watchdog(Service *s) {
offset = now(CLOCK_MONOTONIC) - s->watchdog_timestamp.monotonic;
if (offset >= s->watchdog_usec) {
log_error_unit(UNIT(s)->id, "%s watchdog timeout!", UNIT(s)->id);
- service_enter_dead(s, SERVICE_FAILURE_WATCHDOG, true);
+ service_enter_signal(s, SERVICE_FINAL_SIGKILL, SERVICE_FAILURE_WATCHDOG);
return;
}
@@ -1939,8 +1939,6 @@ fail:
service_enter_dead(s, SERVICE_FAILURE_RESOURCES, false);
}
-static void service_enter_signal(Service *s, ServiceState state, ServiceResult f);
-
static void service_enter_stop_post(Service *s, ServiceResult f) {
int r;
assert(s);
commit 571bfc6c56962dfc926e9bbc1600c511fc8565d1
Author: Mantas MikulÄnas <grawity at gmail.com>
Date: Mon May 20 11:20:15 2013 +0300
systemctl: honor "--no-legend" in 'list-sockets'
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 3cca861..e6bd855 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -655,11 +655,12 @@ static int output_sockets_list(struct socket_info *socket_infos, unsigned cs) {
}
if (cs) {
- printf("%-*s %-*.*s%-*s %s\n",
- pathlen, "LISTEN",
- typelen + arg_show_types, typelen + arg_show_types, "TYPE ",
- socklen, "UNIT",
- "ACTIVATES");
+ if (!arg_no_legend)
+ printf("%-*s %-*.*s%-*s %s\n",
+ pathlen, "LISTEN",
+ typelen + arg_show_types, typelen + arg_show_types, "TYPE ",
+ socklen, "UNIT",
+ "ACTIVATES");
for (s = socket_infos; s < socket_infos + cs; s++) {
char **a;
@@ -678,15 +679,18 @@ static int output_sockets_list(struct socket_info *socket_infos, unsigned cs) {
on = ansi_highlight(true);
off = ansi_highlight(false);
- printf("\n");
+ if (!arg_no_legend)
+ printf("\n");
} else {
on = ansi_highlight_red(true);
off = ansi_highlight_red(false);
}
- printf("%s%u sockets listed.%s\n", on, cs, off);
- if (!arg_all)
- printf("Pass --all to see loaded but inactive sockets, too.\n");
+ if (!arg_no_legend) {
+ printf("%s%u sockets listed.%s\n", on, cs, off);
+ if (!arg_all)
+ printf("Pass --all to see loaded but inactive sockets, too.\n");
+ }
return 0;
}
More information about the systemd-commits
mailing list