[systemd-devel] [PATCH 1/3] journal: add int↔audit type name mapping

2015-04-14 Thread Zbigniew Jędrzejewski-Szmek
---
 Makefile.am  | 23 +--
 src/journal/.gitignore   |  4 
 src/journal/audit-type.c | 42 ++
 src/journal/audit-type.h | 26 ++
 4 files changed, 93 insertions(+), 2 deletions(-)
 create mode 100644 src/journal/audit-type.c
 create mode 100644 src/journal/audit-type.h

diff --git Makefile.am Makefile.am
index 72a2c3c220..4c8812bba0 100644
--- Makefile.am
+++ Makefile.am
@@ -215,6 +215,7 @@ AM_CPPFLAGS = \
-I $(top_srcdir)/src/network \
-I $(top_srcdir)/src/login \
-I $(top_srcdir)/src/journal \
+   -I $(top_builddir)/src/journal \
-I $(top_srcdir)/src/timedate \
-I $(top_srcdir)/src/timesync \
-I $(top_srcdir)/src/resolve \
@@ -1311,12 +1312,23 @@ src/shared/cap-from-name.h: 
src/shared/cap-from-name.gperf
$(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_capability 
-H hash_capability_name -p -C <$< >$@
 
 
+src/journal/audit_type-list.txt:
+   $(AM_V_at)$(MKDIR_P) $(dir $@)
+   $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include 
linux/audit.h - $@
+
+src/journal/audit_type-to-name.h: src/journal/audit_type-list.txt
+   $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char *audit_type_to_string(int 
type) {\n\tswitch(type) {" } {printf "case AUDIT_%s: return \"%s\";\n", 
$$1, $$1 } END{ print "default: return NULL;\n\t}\n}\n" }' <$< >$@
+
+src/journal/audit_type-from-name.gperf: src/journal/audit_type-list.txt
+   $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct audit_type_name { const char* 
name; int id; };"; print "%null-strings"; print "%%";} { s=$$1; sub(/_/, "-", 
s); printf "%s, ", $$s; printf "AUDIT_%s\n", $$1 }' <$< >$@
+
+
 src/resolve/dns_type-list.txt: src/resolve/dns-type.h
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_GEN)$(SED) -n -r 's/.* DNS_TYPE_(\w+).*/\1/p' <$< >$@
 
 src/resolve/dns_type-to-name.h: src/resolve/dns_type-list.txt
-   $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char *dns_type_to_string(int 
type) {\n\tswitch(type) {" } {printf "case DNS_TYPE_%s: return ", $$1; 
sub(/_/, "-"); printf "\"%s\";\n", $$1 } END{ print "\ndefault: return 
NULL;\n\t}\n}\n" }' <$< >$@
+   $(AM_V_GEN)$(AWK) 'BEGIN{ print "const char *dns_type_to_string(int 
type) {\n\tswitch(type) {" } {printf "case DNS_TYPE_%s: return ", $$1; 
sub(/_/, "-"); printf "\"%s\";\n", $$1 } END{ print "default: return 
NULL;\n\t}\n}\n" }' <$< >$@
 
 src/resolve/dns_type-from-name.gperf: src/resolve/dns_type-list.txt
$(AM_V_GEN)$(AWK) 'BEGIN{ print "struct dns_type_name { const char* 
name; int id; };"; print "%null-strings"; print "%%";} { s=$$1; sub(/_/, "-", 
s); printf "%s, ", $$s; printf "DNS_TYPE_%s\n", $$1 }' <$< >$@
@@ -4629,7 +4641,14 @@ libsystemd_journal_internal_la_SOURCES = \
src/journal/catalog.h \
src/journal/mmap-cache.c \
src/journal/mmap-cache.h \
-   src/journal/compress.c
+   src/journal/compress.c \
+   src/journal/audit-type.h \
+   src/journal/audit-type.c \
+   src/journal/audit_type-from-name.h \
+   src/journal/audit_type-to-name.h
+
+gperf_txt_sources += \
+   src/journal/audit_type-list.txt
 
 # using _CFLAGS = in the conditional below would suppress AM_CFLAGS
 libsystemd_journal_internal_la_CFLAGS = \
diff --git src/journal/.gitignore src/journal/.gitignore
index d6a79460cd..9488fcd0ff 100644
--- src/journal/.gitignore
+++ src/journal/.gitignore
@@ -1,2 +1,6 @@
 /journald-gperf.c
 /libsystemd-journal.pc
+/audit_type-list.txt
+/audit_type-from-name.h
+/audit_type-from-name.gperf
+/audit_type-to-name.h
diff --git src/journal/audit-type.c src/journal/audit-type.c
new file mode 100644
index 00..9e6d4cb76b
--- /dev/null
+++ src/journal/audit-type.c
@@ -0,0 +1,42 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+/***
+  This file is part of systemd.
+
+  Copyright 2015 Zbigniew Jędrzejewski-Szmek
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 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
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public License
+  along with systemd; If not, see .
+***/
+
+#include 
+
+#include "audit-type.h"
+
+static const struct audit_type_name *
+lookup_audit_type(register const char *str, register unsigned int len);
+
+#include "audit_type-from-name.h"
+#include "audit_type-to-name.h"
+
+int audit_type_from_string(const char *s) {
+const struct audit_type_name *sc;
+
+assert(s);
+
+sc

[systemd-devel] [PATCH 3/3] journal: include user space audit types in the list

2015-04-14 Thread Zbigniew Jędrzejewski-Szmek
---
 Makefile.am  | 6 +-
 configure.ac | 1 +
 src/journal/audit-type.c | 3 +++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git Makefile.am Makefile.am
index 2d82fd12c1..b8cb9cbfd2 100644
--- Makefile.am
+++ Makefile.am
@@ -1311,10 +1311,14 @@ src/shared/cap-from-name.gperf: src/shared/cap-list.txt
 src/shared/cap-from-name.h: src/shared/cap-from-name.gperf
$(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_capability 
-H hash_capability_name -p -C <$< >$@
 
+audit_list_includes = -include linux/audit.h
+if HAVE_AUDIT
+audit_list_includes += -include libaudit.h
+endif
 
 src/journal/audit_type-list.txt:
$(AM_V_at)$(MKDIR_P) $(dir $@)
-   $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include 
linux/audit.h - $@
+   $(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM 
$(audit_list_includes) - $@
 
 src/journal/audit_type-to-name.h: src/journal/audit_type-list.txt
$(AM_V_GEN)$(AWK) 'BEGIN{ print "const char *audit_type_to_string(int 
type) {\n\tswitch(type) {" } {printf "case AUDIT_%s: return \"%s\";\n", 
$$1, $$1 } END{ print "default: return NULL;\n\t}\n}\n" }' <$< >$@
diff --git configure.ac configure.ac
index 4ff70950f2..dad3428f11 100644
--- configure.ac
+++ configure.ac
@@ -781,6 +781,7 @@ else
 AUDIT_LIBS=
 fi
 AC_SUBST(AUDIT_LIBS)
+AM_CONDITIONAL([HAVE_AUDIT], [test "x$have_audit" != xno])
 
 # 
--
 AC_ARG_ENABLE([elfutils],
diff --git src/journal/audit-type.c src/journal/audit-type.c
index 03830c94f1..5f2a898746 100644
--- src/journal/audit-type.c
+++ src/journal/audit-type.c
@@ -21,6 +21,9 @@
 
 #include 
 #include 
+#ifdef HAVE_AUDIT
+#  include 
+#endif
 
 #include "audit-type.h"
 
-- 
2.3.5

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 2/3] journal: use audit event names instead of numbers

2015-04-14 Thread Zbigniew Jędrzejewski-Szmek
 is replaced by AVC, etc.

A fallback mechanism is provided for unlisted event types.
Occasionally new types are added to the kernel, but not too often.

Add a simple "test", which simply prints the mapping.
---
 .gitignore|  1 +
 Makefile.am   |  9 -
 src/journal/audit-type.c  | 14 ++
 src/journal/audit-type.h  |  5 +
 src/journal/journald-audit.c  | 11 +++
 src/journal/test-audit-type.c | 40 
 6 files changed, 75 insertions(+), 5 deletions(-)
 create mode 100644 src/journal/test-audit-type.c

diff --git .gitignore .gitignore
index bcf21feddd..9da5122339 100644
--- .gitignore
+++ .gitignore
@@ -141,6 +141,7 @@
 /systemd-vconsole-setup
 /tags
 /test-architecture
+/test-audit-type
 /test-async
 /test-barrier
 /test-boot-timestamp
diff --git Makefile.am Makefile.am
index 4c8812bba0..2d82fd12c1 100644
--- Makefile.am
+++ Makefile.am
@@ -4527,6 +4527,12 @@ test_compress_benchmark_LDADD = \
libsystemd-journal-internal.la \
libsystemd-shared.la
 
+test_audit_type_SOURCES = \
+   src/journal/test-audit-type.c
+
+test_audit_type_LDADD = \
+   libsystemd-journal-core.la
+
 libsystemd_journal_core_la_SOURCES = \
src/journal/journald-kmsg.c \
src/journal/journald-kmsg.h \
@@ -4609,7 +4615,8 @@ tests += \
test-journal-interleaving \
test-journal-flush \
test-mmap-cache \
-   test-catalog
+   test-catalog \
+   test-audit-type
 
 if HAVE_COMPRESSION
 tests += \
diff --git src/journal/audit-type.c src/journal/audit-type.c
index 9e6d4cb76b..03830c94f1 100644
--- src/journal/audit-type.c
+++ src/journal/audit-type.c
@@ -19,6 +19,7 @@
   along with systemd; If not, see .
 ***/
 
+#include 
 #include 
 
 #include "audit-type.h"
@@ -40,3 +41,16 @@ int audit_type_from_string(const char *s) {
 
 return sc->id;
 }
+
+const char *audit_type_name(int type,
+char buf[AUDIT_NAME_BUF_SIZE]) {
+const char *s;
+
+s = audit_type_to_string(type);
+if (s)
+return s;
+
+/* This is inspired by DNS TYPEnnn formatting */
+snprintf(buf, AUDIT_NAME_BUF_SIZE, "AUDIT%04i", type);
+return buf;
+}
diff --git src/journal/audit-type.h src/journal/audit-type.h
index 9f37716cd6..a2c98cee80 100644
--- src/journal/audit-type.h
+++ src/journal/audit-type.h
@@ -21,6 +21,11 @@
   along with systemd; If not, see .
 ***/
 
+#include "macro.h"
 
 const char *audit_type_to_string(int type);
 int audit_type_from_string(const char *s);
+
+#define AUDIT_NAME_BUF_SIZE sizeof("AUDIT")-1 + DECIMAL_STR_MAX(int)
+const char *audit_type_name(int type,
+char buf[AUDIT_NAME_BUF_SIZE]);
diff --git src/journal/journald-audit.c src/journal/journald-audit.c
index 46eb82fa34..6677670161 100644
--- src/journal/journald-audit.c
+++ src/journal/journald-audit.c
@@ -21,6 +21,7 @@
 
 #include "missing.h"
 #include "journald-audit.h"
+#include "audit-type.h"
 
 typedef struct MapField {
 const char *audit_field;
@@ -336,11 +337,12 @@ static void process_audit_string(Server *s, int type, 
const char *data, size_t s
 size_t n_iov_allocated = 0;
 unsigned n_iov = 0, k;
 uint64_t seconds, msec, id;
-const char *p;
+const char *p, *type_name;
 unsigned z;
 char id_field[sizeof("_AUDIT_ID=") + DECIMAL_STR_MAX(uint64_t)],
  type_field[sizeof("_AUDIT_TYPE=") + DECIMAL_STR_MAX(int)],
- source_time_field[sizeof("_SOURCE_REALTIME_TIMESTAMP=") + 
DECIMAL_STR_MAX(usec_t)];
+ source_time_field[sizeof("_SOURCE_REALTIME_TIMESTAMP=") + 
DECIMAL_STR_MAX(usec_t)],
+ type_name_buf[AUDIT_NAME_BUF_SIZE];
 char *m;
 
 assert(s);
@@ -396,8 +398,9 @@ static void process_audit_string(Server *s, int type, const 
char *data, size_t s
 IOVEC_SET_STRING(iov[n_iov++], "SYSLOG_FACILITY=32");
 IOVEC_SET_STRING(iov[n_iov++], "SYSLOG_IDENTIFIER=audit");
 
-m = alloca(strlen("MESSAGE= ") + strlen(p) + 1);
-sprintf(m, "MESSAGE= %s", type, p);
+type_name = audit_type_name(type, type_name_buf);
+
+m = strjoina("MESSAGE=", type_name, " ", p);
 IOVEC_SET_STRING(iov[n_iov++], m);
 
 z = n_iov;
diff --git src/journal/test-audit-type.c src/journal/test-audit-type.c
new file mode 100644
index 00..f8fe5b02c5
--- /dev/null
+++ src/journal/test-audit-type.c
@@ -0,0 +1,40 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+/***
+  This file is part of systemd.
+
+  Copyright 2015 Zbigniew Jędrzejewski-Szmek
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
+  (at your option) an

Re: [systemd-devel] parsing audit messages

2015-04-14 Thread Zbigniew Jędrzejewski-Szmek
On Thu, Apr 02, 2015 at 11:01:08AM +0200, Lennart Poettering wrote:
> On Thu, 26.03.15 13:56, Zbigniew Jędrzejewski-Szmek (zbys...@in.waw.pl) wrote:
> 
> > On Thu, Mar 26, 2015 at 09:42:45AM +0100, Lennart Poettering wrote:
> > > On Sun, 15.03.15 03:51, Zbigniew Jędrzejewski-Szmek (zbys...@in.waw.pl) 
> > > wrote:
> > > 
> > > > On Sun, Mar 15, 2015 at 03:49:07AM +0100, Zbigniew Jędrzejewski-Szmek 
> > > > wrote:
> > > > > Hi,
> > > > > 
> > > > > I was looking at some debug logs, and the audit messages are
> > > > > semi-useless in their current undecoded form:
> > > > > 
> > > > > mar 14 22:24:02 fedora22 audit[1]:  pid=1 uid=0 
> > > > > auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 
> > > > > msg='unit=systemd-udev-trigger comm="systemd" 
> > > > > exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? 
> > > > > res=success'
> > > > > mar 14 22:24:05 fedora22 audit:  
> > > > > proctitle=2F7362696E2F6D6F6470726F6265002D71002D2D0069707461626C655F7365637572697479
> > > > > 
> > > > > You added code to parse this, and I think we should make use of it and
> > > > > put msg= field as MESSAGE=, and maybe store the original message as
> > > > > _AUDIT= or something. If there's no msg field, like with proctitle,
> > > > > print all fields that are in the message, but using our cescape, and
> > > > > not this hexadecimal form which is unreadable for humans.
> > > > 
> > > > I think we should also translate type= to names...
> > > > 
> > > > https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Security_Guide/sec-Audit_Record_Types.html
> > >
> > > Well, we don't translate MESSAGE_ID fields to strings either...
> > 
> > Here the mapping is stable, and maintained in one place... I think it's more
> > like dns TYPE field, completely reversible, then MESSAGE_IDs.
> 
> I think generating a translation table automatically from the headers
> like we do for input keys should be OK.
Attached patches do that, please have a look.

Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] journal: don't complain about audit socket errors in a container.

2015-04-14 Thread Frank Thalberg
Hi Lennart,

thank you very much for reviewing and responding to the mess I made.
Hopefully it will be a smoother experience from now on.

On Mon, 13 Apr 2015 16:08:28 +0200
lennart at poettering.net (Lennart Poettering) wrote:

> What kind of containers are these? LXC? docker?

I guess I failed describing the scenario properly.  I was trying
to run a fresh Archlinux installation inside a subdirectory via the
systemd-nspawn -b -D ... command on a debian host.  No Docker, LXC or
any other software was involved.  Just plain systemd tools and a bio
blob between chair and keyboard.

I was toying around with systemd-nspawn.  It seems to me as a
smoother implementation of that whole container idea compared to docker
for example because it directly boots into systemd and properly
initializes services and other environment related resources like the
machine-id file within /etc/.  It's also quiet nice to have systemd to
handle the init daemon and logging tasks.  The other solutions leave you
on your own here.

> nspawn at least grants audit caps to containers. If you don't grant
> audit caps you cannot boot distros like Fedora at all, since much of
> the PAM audit code in Fedora is written to fail completely if audit
> is on in the kernel, but cannot be used.

My first impression was that container/namespaces aren't supported
inside the audit kernel code at all.  Someone at the #archlinux channel
on freenode gave this hint and I also thought this way because the
kernel source at

looks this way.  But at a closer look it doesn't seem to me like that
anymore mostly because the returned error at the given line differs
from the error I'm experiencing (ECONNREFUSED vs. EPERM).  It rather
seems that the "offending" line is
.

I still have to butt in though.  There are 2 issues here at hand. 

The first one: It doesn't look to me like the audit subsystem within the
kernel is ready for namespaces.  They aren't directly rejected but I
can't see any measurements to separate namespaces.  It would be quiet
unfortunate if processes within a namespace could receive audit events
from another namespace. 

The second problem is rather simple: it seems libcap currently doesn't
understand the CAP_AUDIT_READ value so passing it to the --capability=
option is not an (easy) option.

Given that I would suggest to treat the whole audit subsystem to be
optional and don't fail too hard if it can't be used. Unfortunately
pre-built packages can't offer the option to configure this behavior.

> Hmm, exluding the audit code from the build if HAVE_AUDIT is not set
> is certainly a good idea, but we generally try to keep #ifdeffery out
> of .c files. More specifically, the journald-audit.c file should not
> be compiled and linked at all on non-audit builds, and
> journald-audit.h should contain the #ifdeffery that causes
> server_open_audit() to become a NOP on such builds. Would be happy to
> take a patch for that.

Can't agree more with you here.  Your solution to the problem is a
little more work than I was initially willing to invest into the
problem.  I'll gladly provide a better patch for this given the
the interest in handling this.

Thank you very much for reading this lengthy mail, I'm looking forward
to your response!


Greetings,
Frank.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] machinectl login fails systemd 219

2015-04-14 Thread Stefan Tatschner
On Di, 2015-04-14 at 21:56 +, Keller, Jacob E wrote:
> Failed to get machine PTY: Message did not receive a reply (timeout 
> by message bus)
> 
> I get a notification on the machine itself that it started container
> getty and then stopped it.
> 
> It worked earlier so I am not sure what changed. No one on google 
> seems
> to have this specific error.

There is a patch which fixes this problem:
http://lists.freedesktop.org/archives/systemd-devel/2015
-February/028603.html

git log --grep tells me that is has been already commited as
f2273101c21bc59a390379e182e53cd4f07a7e71:

http://cgit.freedesktop.org/systemd/systemd/commit/?id=f2273101c21bc59a
390379e182e53cd4f07a7e71


Stay tuned,
Stefan
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] machinectl login fails systemd 219

2015-04-14 Thread Keller, Jacob E
Failed to get machine PTY: Message did not receive a reply (timeout by message 
bus)

I get a notification on the machine itself that it started container
getty and then stopped it.

It worked earlier so I am not sure what changed. No one on google seems
to have this specific error.

Thanks for the help.

Regards,
Jake
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH v2] automount: add expire support

2015-04-14 Thread Michael Olbrich
---
Changes in v2:
 - addressed comments
 - check every MAX(a->timeout_idle_usec/10, USEC_PER_SEC) instead of every
   5 seconds

 man/systemd.automount.xml |   8 ++
 man/systemd.mount.xml |   9 ++
 src/core/automount.c  | 221 --
 src/core/automount.h  |   6 +-
 src/core/dbus-automount.c |   1 +
 src/core/load-fragment-gperf.gperf.m4 |   1 +
 src/core/mount.c  |  20 +--
 src/fstab-generator/fstab-generator.c |  24 
 8 files changed, 262 insertions(+), 28 deletions(-)

diff --git a/man/systemd.automount.xml b/man/systemd.automount.xml
index b5b5885cdff2..9561590c5c89 100644
--- a/man/systemd.automount.xml
+++ b/man/systemd.automount.xml
@@ -135,6 +135,14 @@
 creating these directories. Takes an access mode in octal
 notation. Defaults to 0755.
   
+  
+TimeoutIdleSec=
+Configures an idleness timeout. Once the mount has been
+idle for the specified time, systemd will attempt to unmount. Takes a
+unit-less value in seconds, or a time span value such as "5min 20s".
+Pass 0 to disable the timeout logic. The timeout is disabled by
+default.
+  
 
   
 
diff --git a/man/systemd.mount.xml b/man/systemd.mount.xml
index fcb9a4416104..e102d27ab762 100644
--- a/man/systemd.mount.xml
+++ b/man/systemd.mount.xml
@@ -148,6 +148,15 @@
   
 
   
+x-systemd.idle-timeout=
+
+Configures the idleness timeout of the
+automount unit. See TimeoutIdleSec= in
+
systemd.automount5
+for details.
+  
+
+  
 x-systemd.device-timeout=
 
 Configure how long systemd should wait for a
diff --git a/src/core/automount.c b/src/core/automount.c
index ce484ff1cd16..1cf108524a80 100644
--- a/src/core/automount.c
+++ b/src/core/automount.c
@@ -42,6 +42,7 @@
 #include "bus-error.h"
 #include "formats-util.h"
 #include "process-util.h"
+#include "async.h"
 
 static const UnitActiveState state_translation_table[_AUTOMOUNT_STATE_MAX] = {
 [AUTOMOUNT_DEAD] = UNIT_INACTIVE,
@@ -50,6 +51,22 @@ static const UnitActiveState 
state_translation_table[_AUTOMOUNT_STATE_MAX] = {
 [AUTOMOUNT_FAILED] = UNIT_FAILED
 };
 
+struct expire_data {
+int dev_autofs_fd;
+int ioctl_fd;
+};
+
+static inline void expire_data_free(struct expire_data *data) {
+if (!data)
+return;
+
+safe_close(data->dev_autofs_fd);
+safe_close(data->ioctl_fd);
+free(data);
+}
+
+DEFINE_TRIVIAL_CLEANUP_FUNC(struct expire_data*, expire_data_free);
+
 static int open_dev_autofs(Manager *m);
 static int automount_dispatch_io(sd_event_source *s, int fd, uint32_t events, 
void *userdata);
 
@@ -81,13 +98,16 @@ static void repeat_unmount(const char *path) {
 }
 }
 
+static int automount_send_ready(Automount *a, Set *tokens, int status);
+
 static void unmount_autofs(Automount *a) {
 assert(a);
 
 if (a->pipe_fd < 0)
 return;
 
-automount_send_ready(a, -EHOSTDOWN);
+automount_send_ready(a, a->tokens, -EHOSTDOWN);
+automount_send_ready(a, a->expire_tokens, -EHOSTDOWN);
 
 a->pipe_event_source = sd_event_source_unref(a->pipe_event_source);
 a->pipe_fd = safe_close(a->pipe_fd);
@@ -112,6 +132,10 @@ static void automount_done(Unit *u) {
 
 set_free(a->tokens);
 a->tokens = NULL;
+set_free(a->expire_tokens);
+a->expire_tokens = NULL;
+
+a->expire_event_source = sd_event_source_unref(a->expire_event_source);
 }
 
 static int automount_add_mount_links(Automount *a) {
@@ -265,6 +289,7 @@ static int automount_coldplug(Unit *u, Hashmap 
*deferred_work) {
 }
 
 static void automount_dump(Unit *u, FILE *f, const char *prefix) {
+char time_string[FORMAT_TIMESPAN_MAX];
 Automount *a = AUTOMOUNT(u);
 
 assert(a);
@@ -273,11 +298,13 @@ static void automount_dump(Unit *u, FILE *f, const char 
*prefix) {
 "%sAutomount State: %s\n"
 "%sResult: %s\n"
 "%sWhere: %s\n"
-"%sDirectoryMode: %04o\n",
+"%sDirectoryMode: %04o\n"
+"%sTimeoutIdleUSec: %s\n",
 prefix, automount_state_to_string(a->state),
 prefix, automount_result_to_string(a->result),
 prefix, a->where,
-prefix, a->directory_mode);
+prefix, a->directory_mode,
+prefix, format_timespan(time_string, FORMAT_TIMESPAN_MAX, 
a->timeout_idle_usec, USEC_PER_SEC));
 }
 
 static void automount_enter_dead(Automount *a, AutomountResult f) {
@@ -367,7 +394,7 @@ static int autofs_protocol(int dev_autofs_fd, int ioctl_fd) 
{
 return 0;
 }
 
-static int autofs_set_timeout(int dev_autofs_fd, int ioctl_fd, time_t sec) {
+static int autofs_set_timeout(int dev_autofs_fd, int ioctl_fd, usec_t us

Re: [systemd-devel] [PATCH] automount: add expire support

2015-04-14 Thread Michael Olbrich
On Thu, Apr 02, 2015 at 12:54:00PM +0200, Lennart Poettering wrote:
> On Sun, 22.03.15 13:36, Michael Olbrich (m.olbr...@pengutronix.de) wrote:
> 
> Love this work!

Thanks.

[...]
> > +
> > +if (a->expire_event_source) {
> > +r = sd_event_source_set_time(a->expire_event_source, 
> > now(CLOCK_MONOTONIC) + 5 * USEC_PER_SEC);
> > +if (r < 0)
> > +return r;
> > +
> > +return sd_event_source_set_enabled(a->expire_event_source, 
> > SD_EVENT_ONESHOT);
> > +}
> > +
> > +return sd_event_add_time(
> > +UNIT(a)->manager->event,
> > +&a->expire_event_source,
> > +CLOCK_MONOTONIC,
> > +now(CLOCK_MONOTONIC) + 5 * USEC_PER_SEC, 0,
> > +automount_dispatch_expire, a);
> > +}
> 
> Maybe the 5 * USEC_PER_SEC should become a #define somewhere at the
> top of the file? Given that this is used more than once it might be
> advisable to use the same definition.

I've been thinking about this again and I changed this. Checking every 5
Seconds is rather often for longer timeouts. I've changed it to
MAX(a->timeout_idle_usec/10, USEC_PER_SEC). I think that's a good
compromise.

> > +
> > +r = set_ensure_allocated(&a->expire_tokens, NULL);
> > +if (r < 0) {
> > +log_unit_error(UNIT(a)->id, "Failed to
> > allocate token set.");
> 
> Sounds like a job for log_oom().

It's basically a copy of the code right above it, so it should match. I
think that should be a separate patch.

> > +goto fail;
> > +}
> > +
> > +r = set_put(a->expire_tokens, 
> > UINT_TO_PTR(packet.v5_packet.wait_queue_token));
> > +if (r < 0) {
> > +log_unit_error_errno(UNIT(a)->id, r, "Failed to 
> > remember token: %m");
> > +goto fail;
> > +}
> > +r = manager_add_job(UNIT(a)->manager, JOB_STOP, 
> > UNIT_TRIGGER(UNIT(a)),
> > +JOB_REPLACE, true, &error,
> > NULL);
> 
> We normally don't like break this eagerly.

Actually we do. In this file at least. The manager_add_job for JOB_START
has the same line break :-). But I don't care either way, so I changed it.

> > +return 0;
> > +}
> > +
> > +fprintf(f,
> > +"TimeoutIdleSec=" USEC_FMT "\n",
> > +u / USEC_PER_SEC);
> > +
> > +return 0;
> 
> Why not format that using format_timespan() here, so that the accuracy
> is not lost? (We'll lose it when passing it to the kernel ultimately,
> but we shouldn't lose it any earlier. In particular since you round up
> when passing it to the kernel, but are rounding down here... Hence,
> let's keep this simple, and always pass our native accuracy along
> until the last point where we really have to convert it.

Sounds reasonable, so I changed it. I basically copied this from
the x-systemd.device-timeout implementation, so you might want to change
that as well.

I've changed everything else as requested. New patch follows.

Michael

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd-218 seems to ignore .link files

2015-04-14 Thread Andrew Cooks
On Tue, Jan 13, 2015 at 6:46 AM, Jan Engelhardt  wrote:

>
> On Monday 2015-01-12 18:29, Tom Gundersen wrote:
> >> In systemd-218, I have configured the following testcase:
> >>
> >> /etc/systemd/network# ls -al
> >> total 20
> >> drwxr-xr-x 2 root root 4096 Jan 11 18:14 .
> >> drwxr-xr-x 5 root root 4096 Jan 11 16:23 ..
> >> -rw-r--r-- 1 root root   96 Jan 11 18:14 99a-ether.link
> >
> >Hm, isn't this just a problem of 99a-ether.link being ordered after
> >99-default.link?
>
> Well, the manpage states: "All link files are collectively
> sorted and processed in lexical order", with that, I would assume
> that 99a, being processed after 99, would override 99.
>
> >It works for me when naming it 98-ether.link instead.
>
> Not in my case. I have a feeling networkd won't touch
> [08:00:27:0a:c5:b2]'s interface name because it has already
> been named by udev to enp0s3 before networkd got a chance to run.
> Could that be it?


I'm having a similar problem while running systemd version-219. Did you
work out what was wrong?

My link file is ignored even when I symlink
/etc/systemd/network/99-default.link to /dev/null. I don't see anything
interesting in 'journalctl'.

# udevadm info /sys/class/net/eth0
P: /devices/pci:00/:00:04.0/:01:00.0/net/eth0
E: DEVPATH=/devices/pci:00/:00:04.0/:01:00.0/net/eth0
E: ID_BUS=pci
E: ID_MODEL_FROM_DATABASE=RTL8111/8168/8411 PCI Express Gigabit Ethernet
Contror
E: ID_MODEL_ID=0x8168
E: ID_NET_DRIVER=r8169
E: ID_NET_NAME_MAC=enx000db936008c
E: ID_NET_NAME_PATH=enp1s0
E: ID_OUI_FROM_DATABASE=PC Engines GmbH
E: ID_PATH=pci-:01:00.0
E: ID_PATH_TAG=pci-_01_00_0
E: ID_PCI_CLASS_FROM_DATABASE=Network controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
E: ID_VENDOR_FROM_DATABASE=Realtek Semiconductor Co., Ltd.
E: ID_VENDOR_ID=0x10ec
E: IFINDEX=3
E: INTERFACE=eth0
E: SUBSYSTEM=net
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/eth0
E: TAGS=:systemd:
E: USEC_INITIALIZED=53326


# networkctl status --no-pager eth0
��● 3: eth0
   Link File: n/a
Network File: n/a
Type: ether
   State: off (unmanaged)
Path: pci-:01:00.0
  Driver: r8169
  Vendor: Realtek Semiconductor Co., Ltd.
   Model: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
  HW Address: 00:0d:b9:36:00:8c (PC Engines GmbH)
 MTU: 1500


# cat /etc/systemd/network/01-mgmt.link
[Match]
Path=pci-:01:00.0
Type=ether

[Link]
Name=mgmt
MACAddressPolicy=persistent
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to get systemd boot messages on serial console and screen?

2015-04-14 Thread Lennart Poettering
On Tue, 14.04.15 13:36, Frank Steiner (fsteiner-ma...@bio.ifi.lmu.de) wrote:

> Hi,
> 
> when adding "console=tty0 console=ttyS4,115200" as kernel parameter
> on my SLES 12 systems I get all kernel messages both on the physical
> screen and over the serial console.
> But the systemd messages about the services started appear only on
> ttyS4.
> 
> When I switch the order, i.e. tty0 after ttyS4, I still get kernel
> messages on both, but the systemd messages only show up on the screen.
> Gettys are always started on both consoles.
> 
> The SuSE support told me I must have plymouth installed and indeed,
> when doing so, the systemd messages are printed on ttyS4 and the screen.
> But plymouth causes others problems on my systems so I would like
> to avoid it.
> 
> Is there a way (without plymouth) to make systemd print its boot messages
> on all consoles specified in the kernel parameters? From the man pages
> and googling around I'm not sure if systemd should be doing this by
> default or not.

We write the status output to /dev/console, see status_vprintf():

http://cgit.freedesktop.org/systemd/systemd/tree/src/shared/terminal-util.c#n643

Usually the kernel will forward what is written to /dev/console to all
console= terminals listed on the kernel cmdline.

Check the contents of /sys/class/tty/console/active to see which
ttys those currently are.

I know the the suse folks patched around in this area of systemd,
please consider asking them for details in this areas!

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd.network and IPv6 addrlabel

2015-04-14 Thread Christian Brunotte
Am Tue, 14 Apr 2015 15:24:07 +0100
schrieb Richard Maw :

> On Mon, Apr 13, 2015 at 04:03:34PM +0200, Christian Brunotte wrote:
> You might be able to replicate the behaviour by adding something like the
> following; I haven't tested it myself, but systemd-networkd-wait-online
> --interface=eth1 sounds promising.
> 
> [Unit]
> Description=Post-up configuration for eth1
> After=network.target
> # If you want to block network-online.target until configuration has 
> finished
> # then add Before=network-online.target
> [Service]
> Type=oneshot
> RemainAfterExit=yes
> ExecStart=/lib/systemd/systemd-networkd-wait-online --interface eth1
> ExecStart=/usr/bin/ip addr add 2001::0:222:33::/64 dev eth1
> ExecStart=/usr/bin/ip addrlabel add prefix 2001::0:222:33::/128 label 
> 666
> ExecStart=/usr/bin/ip addrlabel add prefix 2001:::/32   label 
> 666
> # Do `down` configuration with an ExecStop=

Thanks, this would at least be a workaround and I didn't knew
about systemd-networkd-wait-online before.

I'll going to file a wishlist bug against systemd and ask if they
could implement an [addrlabel] section.

best regards

-christian-
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH 2/5] udev.pc: install to pkgconfiglibdir

2015-04-14 Thread Harald Hoyer
Am 08.04.2015 um 19:34 schrieb Marc-Antoine Perennou:
> On 8 April 2015 at 18:47, Kay Sievers  wrote:
>> On Tue, Apr 7, 2015 at 8:54 PM, Marc-Antoine Perennou
>>  wrote:
>>> ---
>>>  Makefile.am | 3 +--
>>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>>
>>> diff --git a/Makefile.am b/Makefile.am
>>> index 9fa4223..9b769ee 100644
>>> --- a/Makefile.am
>>> +++ b/Makefile.am
>>> @@ -3725,8 +3725,7 @@ udevconfdir = $(sysconfdir)/udev
>>>  dist_udevconf_DATA = \
>>> src/udev/udev.conf
>>>
>>> -sharepkgconfigdir = $(datadir)/pkgconfig
>>> -sharepkgconfig_DATA = \
>>> +pkgconfiglib_DATA += \
>>> src/udev/udev.pc
>>
>> This is all backwards. The systemd.pc file is also in the wrong location.
>>
>> These GENERIC files are supposed to be found by the primary AND the
>> secondary arch at the same time, at the GENERIC location, not in a
>> arch-specific libdir.
>>
>> How would the 32bit build find this file on a 64bit compat-arch/multilib 
>> system?
>>
>> Kay
> 
> Well, let's imagine a full cross-compilation toolchain, with
> CHOST-prefixed tools.
> 
> x86_64 stuff will get built with x86_64-pc-linux-gnu-gcc
> i686 stuff will get built with i686-pc-linux-gnu-gcc
> (and you could add a lot of non-native archs here like arm, mips & co)
> 
> x86_64-pc-linux-gnu-pkg-config will look into /usr/lib64/pkgconfig and
> /usr/share/pkgconfig
> i686-pc-linux-gnu-pkg-config will look into /usr/lib32/pkgconfig and
> /usr/share/pkgconfig
> 
> You says that systemd is in the wrong location, so let's see what's
> going on with its
> current location, and then if we move it to /usr/share
> 
> Current location, libdir/pkgconfig/systemd.pc
> 
> x86_64-pc-linux-gnu-pkg-config finds /usr/lib64/pkgconfig/systemd.pc 
> containing,
> amongst other things, libdir which is arch specific, /usr/lib64 and
> systemdutildir
> which contains arch-specific binaries (yes, /usr/lib64/systemd/systemd *is* an
> ELF64 binary using an x86_64 interpreter.
> 
> i686-pc-linux-gnu-pkg-config finds /usr/lib32/pkgconfig/systemd.pc (since it 
> has
> been cross-compiled too) and is pretty happy with that.
> 
> arm-whatever-pkg-config finds /usr/arm-whatever/lib/systemd.pc and is
> happy with it.
> 
> If you move it to /usr/share/pkgconfig
> 
> x86_64-pc-linux-gnu-pkg-config finds /usr/share/pkgconfig/systemd.pc
> and is happy with it
> 
> i686-pc-linux-gnu-pkg-config finds /usr/share/pkgconfig/systemd.pc and
> tries linking to
> x86_64 libraries
> 
> arm-whatever-pkg-config finds /usr/share/pkgconfig/systemd.pc and
> tries linking to
> x86_64 libraries + it gets the path towards binaries its target won't
> even be able to execute.

Do you confuse systemd.pc with libsystemd.pc here?
libsystemd.pc is for linking against the libraries.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [systemd-commits] 2 commits - src/libsystemd

2015-04-14 Thread Tom Gundersen
On Tue, Apr 14, 2015 at 4:21 PM, Zbigniew Jędrzejewski-Szmek
 wrote:
> On Tue, Apr 14, 2015 at 07:19:42AM -0700, Tom Gundersen wrote:
>>  src/libsystemd/sd-device/sd-device.c |9 ++---
>>  1 file changed, 6 insertions(+), 3 deletions(-)
>>
>> New commits:
>> commit 85091685af65831f379580c75b40776c20e245ee
>> Author: Tom Gundersen 
>> Date:   Tue Apr 14 16:05:53 2015 +0200
>>
>> sd-device: fix reading of subsystem
>>
>> diff --git a/src/libsystemd/sd-device/sd-device.c 
>> b/src/libsystemd/sd-device/sd-device.c
>> index 7d52e3c..d420bd0 100644
>> --- a/src/libsystemd/sd-device/sd-device.c
>> +++ b/src/libsystemd/sd-device/sd-device.c
>> @@ -772,10 +772,10 @@ _public_ int sd_device_get_subsystem(sd_device 
>> *device, const char **ret) {
>>  r = device_set_subsystem(device, "drivers");
>>  else if (path_startswith(device->devpath, "/subsystem/") ||
>>   path_startswith(device->devpath, "/class/") ||
>> - path_startswith(device->devpath, "/buss/"))
>> + path_startswith(device->devpath, "/bus/"))
>>  r = device_set_subsystem(device, "subsystem");
>>  if (r < 0)
>> -return r;
>> +return log_debug_errno(r, "sd-devcie: could not set 
>> subsystem for %s: %m", device->devpath);
>  ^^
>
> Zbyszek

Thanks! Fixed.

-t
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] About the exit of systemd-udevd

2015-04-14 Thread Tom Yan
Under certain conditions, I discovered that commands like `udevadm
control --exit` or `systemctl stop systemd-udevd` (with the sockets
stopped beforehand) will kill udevd before it finish its jobs which
triggered by `udevadm trigger` (I presume applying a written udev rule
is one of them).

Is this acceptable/expected? If so, is there any way to guarantee the
jobs is done before it gets killed?

Attached is a script for testing.  I think any arbitrary udev rule
could be used for testing. For example I used:
ATTR{devpath}=="13", ATTR{power/wakeup}=="enabled/disabled"


trigger.sh
Description: Bourne shell script
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd.network and IPv6 addrlabel

2015-04-14 Thread Richard Maw
On Mon, Apr 13, 2015 at 04:03:34PM +0200, Christian Brunotte wrote:
> Hello
> 
> I'm playing around with systemd's network configuration and try to convert the
> following Debian configuration.
> 
>  iface eth1 inet6 auto
>  # Static IP and random dynamic IPs for external targets
>  autoconf 1
>  use_tempaddr 2
>  privext 1
>  # My static IP
>  up ip addr add 2001::0:222:33::/64 dev eth1
>  # Label 1 is predefined as ::/0
>  # Label 666 is for my static IP and networks I want to use it with
>  up ip addrlabel add prefix 2001::0:222:33::/128 label 666
>  up ip addrlabel add prefix 2001:::/32   label 666
> 
> Can I do this with systemd.network? Is there some kind of hoook to
> start shell scripts like the up/pre-up/down/post-down hooks in the
> Debian configuration?

The subject of hooks has come up before, the result being that Lennart is
against the idea of hooks because they involve elements lower in the stack
calling up to elements higher in the stack, and that the appropriate thing to
do is for some service to monitor the state lower in the stack for the
condition before running the commands.

You might be able to replicate the behaviour by adding something like the
following; I haven't tested it myself, but systemd-networkd-wait-online
--interface=eth1 sounds promising.

[Unit]
Description=Post-up configuration for eth1
After=network.target
# If you want to block network-online.target until configuration has 
finished
# then add Before=network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/lib/systemd/systemd-networkd-wait-online --interface eth1
ExecStart=/usr/bin/ip addr add 2001::0:222:33::/64 dev eth1
ExecStart=/usr/bin/ip addrlabel add prefix 2001::0:222:33::/128 label 
666
ExecStart=/usr/bin/ip addrlabel add prefix 2001:::/32   label 
666
# Do `down` configuration with an ExecStop=

I don't understand enough of your configuration to suggest whether there might
be a way to do it natively with networkd.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [systemd-commits] 2 commits - src/libsystemd

2015-04-14 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Apr 14, 2015 at 07:19:42AM -0700, Tom Gundersen wrote:
>  src/libsystemd/sd-device/sd-device.c |9 ++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> New commits:
> commit 85091685af65831f379580c75b40776c20e245ee
> Author: Tom Gundersen 
> Date:   Tue Apr 14 16:05:53 2015 +0200
> 
> sd-device: fix reading of subsystem
> 
> diff --git a/src/libsystemd/sd-device/sd-device.c 
> b/src/libsystemd/sd-device/sd-device.c
> index 7d52e3c..d420bd0 100644
> --- a/src/libsystemd/sd-device/sd-device.c
> +++ b/src/libsystemd/sd-device/sd-device.c
> @@ -772,10 +772,10 @@ _public_ int sd_device_get_subsystem(sd_device *device, 
> const char **ret) {
>  r = device_set_subsystem(device, "drivers");
>  else if (path_startswith(device->devpath, "/subsystem/") ||
>   path_startswith(device->devpath, "/class/") ||
> - path_startswith(device->devpath, "/buss/"))
> + path_startswith(device->devpath, "/bus/"))
>  r = device_set_subsystem(device, "subsystem");
>  if (r < 0)
> -return r;
> +return log_debug_errno(r, "sd-devcie: could not set 
> subsystem for %s: %m", device->devpath);
 ^^

Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] network: allow domain names up to 255 characters

2015-04-14 Thread Lennart Poettering
On Mon, 13.04.15 10:09, Nick Owens (misch...@offblast.org) wrote:

> > Hmm, so the DHCP spec explicitly declares that options 15 and 12 are
> > about the DNS hostname, where RFC 1035 is normative. Our function
> > hostname_is_valid() currently does not validate host names according
> > to RFC 1035, but is in some way stricter (by enforcing Linux' own semantics
> > on the length, and by limiting the charset drastically) and in other
> > ways less strict (by not enforce label length.)
> >
> > I am pretty sure we should leave hostname_is_valid() the way it is, to
> > be used when setting local hostnames and things like that. However,
> > the DHCP code should really validate according to RFC 1035 instead,
> > since that's what the spec says...
> >
> > Implementation-wise this probably means we should move
> > src/resolve/resolved-dns-domain.[ch] into src/shared/dns-domain.[ch]
> > and then add a call there that works similar to dns_name_normalize()
> > but doesn't actually normalize, but simply validates.
> 
> the intention of the domainname_is_valid function in this patch is to
> validate domain names, which can be up to 255 octets. there appears to
> be no standardized macro for this size, so i added one.

Well, I understand that. But I'd prefer if we could reuse the DNS
domain parsing code for this we already have instead of adding yet
another function for validating this.

I hope that makese sense,

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] How to get systemd boot messages on serial console and screen?

2015-04-14 Thread Frank Steiner
Hi,

when adding "console=tty0 console=ttyS4,115200" as kernel parameter
on my SLES 12 systems I get all kernel messages both on the physical
screen and over the serial console.
But the systemd messages about the services started appear only on
ttyS4.

When I switch the order, i.e. tty0 after ttyS4, I still get kernel
messages on both, but the systemd messages only show up on the screen.
Gettys are always started on both consoles.

The SuSE support told me I must have plymouth installed and indeed,
when doing so, the systemd messages are printed on ttyS4 and the screen.
But plymouth causes others problems on my systems so I would like
to avoid it.

Is there a way (without plymouth) to make systemd print its boot messages
on all consoles specified in the kernel parameters? From the man pages
and googling around I'm not sure if systemd should be doing this by
default or not.

cu,
Frank


-- 
Dipl.-Inform. Frank Steiner   Web:  http://www.bio.ifi.lmu.de/~steiner/
Lehrstuhl f. BioinformatikMail: http://www.bio.ifi.lmu.de/~steiner/m/
LMU, Amalienstr. 17   Phone: +49 89 2180-4049
80333 Muenchen, Germany   Fax:   +49 89 2180-99-4049
* Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] automount: add expire support

2015-04-14 Thread Karel Zak
On Sun, Apr 12, 2015 at 10:33:54PM +0200, Jan Luca Naumann wrote:
> I'm not a systemd-developer so I want to ask you if it is possible to
> add a hook for execute something after the unmount (for example to
> delete the mount directory)?

 well, /proc/mount and /proc/self/mountinfo are poll-able, so you do
 not need systemd to listen for the changes.

findmnt --first-only --poll=umount /mnt/foo
rmdir /mnt/foo


 Karel

-- 
 Karel Zak  
 http://karelzak.blogspot.com
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] udev interface naming for SR-IOV VFs

2015-04-14 Thread Ido Barkan
Hi all,

I am VDSM developer in the Ovirt project.

We are implementing support for SR-IOV network cards. Afer the changing of
the number of VFs on the card and programmatically querying for all links
(we use libnl for this) we observe that *during the iteration* over the links
some of them were renamed by udev and still were not. Meanning, some of them 
are called 'ethN' and some are called 'enp2sNf2' (where N is an arbitrary
number). Also, there are times that not all of the devices are returned from
libnl.
After a _while_ everything stabilizes (# of interfaces and names).

My questions:
1. Is this what you would expect from udev? Meaning, this is just async 
behavior?
2. Is there a way to _know_ programmticaly that everything was probed and 
renamed?
   Not a heuristic?

Thanks,
Ido

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel