Re: [systemd-devel] [PATCH] path-util: Fix path_is_mount_point for files

2015-05-27 Thread systemd github import bot
Patchset imported to github.
Pull request:
https://github.com/systemd-devs/systemd/compare/master...systemd-mailing-devs:20150527080708.GC3176%40piware.de

--
Generated by https://github.com/haraldh/mail2git
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] 220 tarball erroneously ships keyboard-keys-from-name.gperf

2015-05-27 Thread Lennart Poettering
On Wed, 27.05.15 11:52, Martin Pitt (martin.p...@ubuntu.com) wrote:

 Lennart Poettering [2015-05-27 11:42 +0200]:
  Well, but let's not forget that a major part of the issues popping up
  actually were committed weeks ago.
 
 Actually, no. As I said, on May 11 most everything was working just
 fine, the udev regressions landed very late. The path_is_mount_point()
 regression landed much earlier, but is much less visible (and now
 there are tests cases with the patch I sent).

Sure, some of the udev breakage is more recent. But a good chunk of
the other stuff (gperf, EFI, path_is_mount_point()) is much older, and
some of it is easily visible...

 Agreed. The broken tarball issues are not visible when building from
 git (which is what I'm doing all the time). We didn't have that kind
 of issues with 219 or 218 (or at least only negligible ones), but 220
 taught us all that we need to test make dist builds more often.
 
 So we have two indepenent things to fix:
 
  * Regularly test make dist, as nobody does that  during regular
development.

Well, no.

I use make distcheck regularly during regular development, and
that's how I generate the final tarball.

However, make distcheck generates a tarball off the 220 git tree
just fine, if you had all the options enabled on a modern Fedora, like
I do.

Again, this is about testing options and combinations that are
not regularly covered by the core systemd developers. 

My release procedure involves not only doing make distcheck, but
also then building the result in Fedora's koji, which then also involves
another make check run, as part of the RPM build process, on all
architectures Fedora supports. Only after that I tag a new
release. 

Alternative: Stop shipping make dist tarballs altogether and just
tar the tagged git snapshot. Given the amount of patching that most
distros do, we pretty much all run autoreconf anyway (including
Fedora), so not having the pre-generated autoconfiscation and
pre-built manpages etc. in the tarball isn't actually that much of
a deal.

Well, while I sympathize with the idea, this is still not how most
current distros work...

Also, make dist worked fine as mentioned, hence altering this part
of the release process will not improve anything, but instead make
things even more sloppy...

  * Impose a release freeze period with announcing an impending
release, distros do a deep testing (this is a day's work for me, so
can't happen that often). During that time (which really shouldn't
be more than a few days) we really should avoid any commit which
isn't an important bug fix, especially not large refactorings or
new features.

How about this: please run automated tests if you have them in regular
intervals, always tracking git. And a few days before a release I'll
notify the mailing list.

I really don't want to drown development in deep freeze phases, that
are then alternated with crazy merge time phases. Instead, I'd much
rather increase the release frequency, keep a steady stream of changes,
and ask downstreams for more help with testing and keeping git
constantly in a releasable state.

Lennart

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


[systemd-devel] [PATCH 2/2] man: use configured path for mount and umount binaries in manpages

2015-05-27 Thread Filipe Brandenburger
Export the MOUNT_PATH and UMOUNT_PATH variables as XML entities and use them in
the systemctl.1 manpage instead of hardcoding the path in /usr/bin.

Tested:
- Ran ./configure ac_cv_path_MOUNT_PATH=/bin/mount (same for umount) and
  rebuilt the manpages, confirmed that the correct path was in man/systemctl.1
- Rebuilt man/systemd.directives.xml and the man pages derived from it,
  confirmed that the correct paths were there as well.
---
 Makefile.am   | 2 ++
 man/systemctl.xml | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index d6010c5..98ceb77 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6505,6 +6505,8 @@ substitutions = \
'|DEBUGTTY=$(DEBUGTTY)|' \
'|KILL=$(KILL)|' \
'|KMOD=$(KMOD)|' \
+   '|MOUNT_PATH=$(MOUNT_PATH)|' \
+   '|UMOUNT_PATH=$(UMOUNT_PATH)|' \
'|MKDIR_P=$(MKDIR_P)|' \
'|QUOTAON=$(QUOTAON)|' \
'|QUOTACHECK=$(QUOTACHECK)|' \
diff --git a/man/systemctl.xml b/man/systemctl.xml
index a2c8a73..35f47de 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -413,8 +413,8 @@
   processes. Not all unit types manage processes of these
   types however. For example, for mount units, control processes
   are defined (which are the invocations of
-  filename/usr/bin/mount/filename and
-  filename/usr/bin/umount/filename), but no main process
+  filenameMOUNT_PATH;/filename and
+  filenameUMOUNT_PATH;/filename), but no main process
   is defined. If omitted, defaults to
   optionall/option./para
 /listitem
-- 
2.4.1

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


Re: [systemd-devel] [PATCH 2/2] man: use configured path for mount and umount binaries in manpages

2015-05-27 Thread Dimitri John Ledkov
On 27 May 2015 at 10:38, Filipe Brandenburger filbran...@google.com wrote:
 Export the MOUNT_PATH and UMOUNT_PATH variables as XML entities and use them 
 in
 the systemctl.1 manpage instead of hardcoding the path in /usr/bin.

 Tested:
 - Ran ./configure ac_cv_path_MOUNT_PATH=/bin/mount (same for umount) and
   rebuilt the manpages, confirmed that the correct path was in man/systemctl.1
 - Rebuilt man/systemd.directives.xml and the man pages derived from it,
   confirmed that the correct paths were there as well.

+1 from me. Sorry for the change =)))

 ---
  Makefile.am   | 2 ++
  man/systemctl.xml | 4 ++--
  2 files changed, 4 insertions(+), 2 deletions(-)

 diff --git a/Makefile.am b/Makefile.am
 index d6010c5..98ceb77 100644
 --- a/Makefile.am
 +++ b/Makefile.am
 @@ -6505,6 +6505,8 @@ substitutions = \
 '|DEBUGTTY=$(DEBUGTTY)|' \
 '|KILL=$(KILL)|' \
 '|KMOD=$(KMOD)|' \
 +   '|MOUNT_PATH=$(MOUNT_PATH)|' \
 +   '|UMOUNT_PATH=$(UMOUNT_PATH)|' \
 '|MKDIR_P=$(MKDIR_P)|' \
 '|QUOTAON=$(QUOTAON)|' \
 '|QUOTACHECK=$(QUOTACHECK)|' \
 diff --git a/man/systemctl.xml b/man/systemctl.xml
 index a2c8a73..35f47de 100644
 --- a/man/systemctl.xml
 +++ b/man/systemctl.xml
 @@ -413,8 +413,8 @@
processes. Not all unit types manage processes of these
types however. For example, for mount units, control processes
are defined (which are the invocations of
 -  filename/usr/bin/mount/filename and
 -  filename/usr/bin/umount/filename), but no main process
 +  filenameMOUNT_PATH;/filename and
 +  filenameUMOUNT_PATH;/filename), but no main process
is defined. If omitted, defaults to
optionall/option./para
  /listitem
 --
 2.4.1

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



-- 
Regards,

Dimitri.
Pura Vida!

https://clearlinux.org
Open Source Technology Center
Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] 220 tarball erroneously ships keyboard-keys-from-name.gperf

2015-05-27 Thread Martin Pitt
Lennart Poettering [2015-05-27 11:42 +0200]:
 Well, but let's not forget that a major part of the issues popping up
 actually were committed weeks ago.

Actually, no. As I said, on May 11 most everything was working just
fine, the udev regressions landed very late. The path_is_mount_point()
regression landed much earlier, but is much less visible (and now
there are tests cases with the patch I sent).

 Things like the broken gperf generated bits or the missing EFI dirs
 were in git since a lng time.
 
 It would be great if downstream could help us with testing many of the
 build combinations, at any time of the cycle, not just when it comes
 to a release.

Agreed. The broken tarball issues are not visible when building from
git (which is what I'm doing all the time). We didn't have that kind
of issues with 219 or 218 (or at least only negligible ones), but 220
taught us all that we need to test make dist builds more often.

So we have two indepenent things to fix:

 * Regularly test make dist, as nobody does that  during regular
   development.

   Alternative: Stop shipping make dist tarballs altogether and just
   tar the tagged git snapshot. Given the amount of patching that most
   distros do, we pretty much all run autoreconf anyway (including
   Fedora), so not having the pre-generated autoconfiscation and
   pre-built manpages etc. in the tarball isn't actually that much of
   a deal.

 * Impose a release freeze period with announcing an impending
   release, distros do a deep testing (this is a day's work for me, so
   can't happen that often). During that time (which really shouldn't
   be more than a few days) we really should avoid any commit which
   isn't an important bug fix, especially not large refactorings or
   new features.

Thanks,

Martin

-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH 2/2] man: use configured path for mount and umount binaries in manpages

2015-05-27 Thread systemd github import bot
Patchset imported to github.
Pull request:
https://github.com/systemd-devs/systemd/compare/master...systemd-mailing-devs:1432719500-763-3-git-send-email-filbranden%40google.com

--
Generated by https://github.com/haraldh/mail2git
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] 220 tarball erroneously ships keyboard-keys-from-name.gperf

2015-05-27 Thread Lennart Poettering
On Tue, 26.05.15 20:51, Dave Reisner (d...@falconindy.com) wrote:

 On Tue, May 26, 2015 at 04:17:07PM +0200, Lennart Poettering wrote:
  On Tue, 26.05.15 15:12, Dimitri John Ledkov (dimitri.j.led...@intel.com) 
  wrote:
  
   Or will there be a v220.1 release shortly with releasy fix-ups?
  
  Well, we don't do point releases in systemd. 
 
  In systemd git we already have now the change that makes sd-bus and
  sd-event public APIs, hence v221 is going to be more than just
  bugfixes. 
 
 Is git revert not an option? Does someone depend on this already, making
 a rollback impossible (and why would you allow that)? You say that
 versions are just a label, but a project which adopts semver would be
 able to create a branch in git and produce a dot release with backported
 bugfixes. Surely you're familiar with this concept -- your colleague
 Karel does this routinely with util-linux.

I have no idea what you are talking of. I don't know what semver is
supposed to be? Fedora knows no package by that name. A typo?

 The fact of the matter is, the last 2 releases of systemd have been
 brown bag releases. Neither 219 nor 220 are useable as the tarballs are
 provided. v220 doesn't even build in a large number of configurations.
 v218 wasn't quite as bad, but landed 18 patches in Arch's packaging
 before v219 was released. For the average Arch package, this is unheard
 of, let alone being a *necessity* in order to make software useable.

Well, they do work fine in the Fedora build, which is what I
test. It's a pretty comprehensive test. And the release also does work
fine on FEdora. How I know that, because I run the newest systemd
versions exclusively myself, and I do watch some bugzillas.

I can only encourage you to test git more frequently on Arch, and not
wait for the release to do this. 

As mentioned before, the gperf and EFI issues you are apparently
referring to have been around since a few weeks. They do not appear
with the config options we use upstream or the ones of Fedora. We
*rely* on downstream testing this, otherwise this will *never* work.

Most software does not have as many options we have. Apparently we
have issues we keeping all combinations of the options working. There
are two solutions to this problem:

a) more testing of the combinations of options used by downstream. For
   this we'd have to rely on downstream support though.

b) simply remove the options. i.e. remove configure switches, and be
   more aggressive with requiring current versions of libraries,
   kernel headers, kernels, and so on.

I am open for b), but I guess many people would certainly prefer us
not doing that.

If we'd follow b) then everybody would run things in the same
combination, and ew test this from upstream we can be sufficiently
sure that it will work for everybody else, too.

But for a) we'd need support from projects like Ubuntu or Arch: for
example, a Jenkins instance or so that builds systemd git continouesly
for those systems and boots them. 

We currently have Davi Strauss' Jenkins instance, and I am very
thankful for that, but this tests only one specific configuration of
things. If you want ArchLinux' configuration to be tested regularly,
then this means that ArchLinux would have to provide something in the
area, we can never do that from upstream.

  Also, next week I'll be travelling and I doubt I will be able to
  finish a new release by then. Maybe in the middle of June we can get
  out a new release.
 
 I'm sorry to hear this too. Please find someone else who's paid to work
 on systemd and teach them how to package releases. The current state of
 affairs absolutely sucks for downstreams. Currently, packaging systemd
 takes more of my time than all of my other packaging responsibilities
 combined.

Well, I see noone volunteering unfortunately.

Like most Open Source project we are understaffed. I wished it wasn't
that way, but that's how it is.

 At LPC in New Orleans, you asked me how you could make systemd easier to
 work with on the downstream side. I told you that I wanted more frequent
 releases. You seemed amenable to this, but it really never happened.

 I'm asking again: can we have more frequent releases? Can you take the
 steps to actually make this happen and not gate releases on your own
 personal availability?

Oh yes, I'd like 3 week cycles, too. And I'd like to pass release
management to somebody else, because I am unhappy with this too, and
the ridiculous amount of work this brings for me. 

However, this simply falls short due to limited manpower. We need
a skilled full-time person for this, and I don't see that growing on
trees unfortunately. 

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] 220 tarball erroneously ships keyboard-keys-from-name.gperf

2015-05-27 Thread Martin Pitt
Lennart Poettering [2015-05-27 12:56 +0200]:
  Sounds good. I actually did this twice (not sure if you saw my IRC
  pings about that) I just didn't do it at the right time. I think
  this would have helped to find most issues indeed (except for the
  keys-from-name.gperf thing, but meh -- happens seldomly enough), so
  let's try this for 221!
 
 Any chance to automate that in a cron-job on some server?

Yes, that has been on my wishlist for quite a while. We have
a fairly comprehensive set of integration tests now which give systemd
quite some beating; the main thing that's causing throuble is that
they won't completely succeed without porting patches, but there's
certainly some heuristics/leeway there (e. g. find the ones which are
required and ignore failure to apply the others).

 Ideally we'd really have a Jenkins instance for that, like David
 Strauss' one, but testing the .deb packages Ubuntu (or Debian)
 builds.

*nod*

Martin

-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] how to call dbus ListUnits for user units?

2015-05-27 Thread Simon McVittie
On 26/05/15 20:22, Mantas Mikulėnas wrote:
 But right now, the 'user' bus does not exist by default. To create it,
 you need either
 a) enable/install/boot with kdbus,
 or b) obtain the dbus.service  dbus.socket user units. (They're in
 dbus-git, or various other places like
 https://wiki.archlinux.org/index.php/Systemd/User#D-Bus.)

The Correct™ way to get dbus.service/dbus.socket user units these days
is with dbus = 1.9.14 configured with --enable-user-session.

If there are other ways to get similar units (e.g. user-session-units),
please deprecate them. dbus upstream is where this stuff should have
been all along, and in particular, dbus = 1.9.14 is where I've made
sure that libdbus and `dbus-launch --autolaunch` connect to the user bus
(if it exists) by default.

 Configured this way, the 'user' bus won't replace the session bus yet

This is not the case. If there is a user bus, then the session bus *is*
the user bus.

S

-- 
Simon McVittie
Collabora Ltd. http://www.collabora.com/
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] abstracting chkconfig vs. update-rc.d [was: non-merged /usr changes]

2015-05-27 Thread Martin Pitt
Lennart Poettering [2015-05-26 18:36 +0200]:
 That said, I think even better would be to maybe make the support for
 this generic in systemctl: instead of explicitly invoking chkconfig or
 update-rcd, maybe we can just make systemctl invoke some fixed binary
 /usr/lib/systemd/systemd-sysv-compat or so with a fixed set of
 parameters. The distros could then make that a tool (maybe just a
 shell script) that invokes chkconfig or update-rc.d This would then
 allow us to remove any chkconfig-specific code from systemd, and would
 allow all distros to plug-in the tool of their choice without having
 to patch upstream. What do you think?

I just stumbled over

  
http://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/initsrcinstrm.html

which specifies pretty much what we talked about above:

  /usr/lib/lsb/install_initd /etc/init.d/example.com-coffeed
  /usr/lib/lsb/remove_initd /etc/init.d/example.com-coffeed

So we could make systemctl just call this if it's available, and
otherwise do nothing for init.d scripts.

I'll cook a patch for this.

Martin
-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)


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


Re: [systemd-devel] [ANNOUNCE] Separating gudev from systemd

2015-05-27 Thread Bastien Nocera
On Wed, 2015-05-20 at 12:01 +0200, David Herrmann wrote:
 Hi
 
 On Wed, May 20, 2015 at 8:46 AM, Tom Gundersen t...@jklm.no wrote:
  On Wed, May 20, 2015 at 8:24 AM, Martin Pitt 
  martin.p...@ubuntu.com wrote:
   Hey David,
   
   David Herrmann [2015-05-19 17:06 +0200]:
We're about to remove gudev from the systemd repository, as it 
is in
no way related to the systemd code-base, nor used by the 
systemd
project.
   
   This makes sense indeed. gudev used to be a standalone project 
   before
   it was merged into udev, so the circle is complete now :-)
   
   For those of us who already packaged gudev from systemd 219, 
   would it
   be possible to bump the current release to 220, so that gudev can 
   be
   packaged without renaming the tarball and doing ugly version 
   numbers?
   Monotonously increasing version numbers and all.. (Yes, there are
   epochs in Debian, and I'm sure RPM has these too, but they 
   might not
   be available everywhere and are generally frowned upon)
  
  While you are at it, why not bump it to 225 or something (just to
  guarantee that the last systemd release with gudev has a lower 
  version
  number than gudev at that time, so people can switch over whenever
  they want without having to worry about going backwards).
 
 I intend to apply patches to systemd-git until we finally removed it
 there. Given that we had 0 patches so far this year, it'll probably
 stay that way. Hence, there's no hurry in replacing gudev from 
 systemd
 with libgudev. It'd be enough to just drop the systemd sub-package 
 and
 provide a new libgudev package, even if that might not forcefully
 update the package.
 
 However, I see no reason not to bump it, so I'll gladly follow the
 packager's demands:
 
 https://github.com/systemd
 -devs/libgudev/commit/f6203336e5b1ccf896acc506b54ec895fdae98b4
 
 @Bastien: At your convenience, can you cherry-pick this and do 
 another
 release? Should have done this right away, sorry!

Could you file this in our new Bugzilla? Otherwise, I end up losing
track of it...
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] 220 tarball erroneously ships keyboard-keys-from-name.gperf

2015-05-27 Thread Martin Pitt
Hey Lennart,

Lennart Poettering [2015-05-27 12:26 +0200]:
   * Regularly test make dist, as nobody does that  during regular
 development.
 
 Well, no.

You just said before that we (distros) need to check tarball
generation/build more often. So I'm a bit confused by the no (but
see below).

 I use make distcheck regularly during regular development, and
 that's how I generate the final tarball.

True, the auto-generated header bug wouldn't have helped if I were to
do it on e. g. Debian sid and then build packages from that very
tarball, as it stemmed from being autogenerated from different kernel
includes etc.

So in that case the only thing that would have discovered this was
distros testing a tarball that you generated. So, back to RC tarball,
plz test a few days before you want to release?

 Alternative: Stop shipping make dist tarballs altogether and just
 tar the tagged git snapshot. Given the amount of patching that most
 distros do, we pretty much all run autoreconf anyway (including
 Fedora), so not having the pre-generated autoconfiscation and
 pre-built manpages etc. in the tarball isn't actually that much of
 a deal.
 
 Well, while I sympathize with the idea, this is still not how most
 current distros work...

OK. It was just a thought for completeness.

 How about this: please run automated tests if you have them in regular
 intervals, always tracking git. And a few days before a release I'll
 notify the mailing list.

Sounds good. I actually did this twice (not sure if you saw my IRC
pings about that) I just didn't do it at the right time. I think
this would have helped to find most issues indeed (except for the
keys-from-name.gperf thing, but meh -- happens seldomly enough), so
let's try this for 221!

 I really don't want to drown development in deep freeze phases, that
 are then alternated with crazy merge time phases. Instead, I'd much
 rather increase the release frequency, keep a steady stream of changes,
 and ask downstreams for more help with testing and keeping git
 constantly in a releasable state.

Also sounds good. With getting rid of a few large patches (like the
chkconfig → update-rc. ones, or the man page paths), doing CI more
often on my distro side will also become a much less manual process.

Thanks for having this post-mortem discussion, this is useful!

Martin
-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Starting units when a port is available for connections

2015-05-27 Thread Andrei Borzenkov
В Wed, 27 May 2015 19:09:57 +1000
Adam Zegelin a...@instaclustr.com пишет:

 Hi list,
 
 I’m running Cassandra (C*, a clustered database) as a systemd service. 
 Currently this is just a “Type=simple” service, as such, dependant units will 
 start as soon as the C* process starts rather than when C* is accepting 
 client connections.
 
 I’d like to transition to something more complex so I can start to write 
 additional units that depend on C*.
 
 I’ve successfully managed to set the service type to “notify” and modify C* 
 to call sd_notify() when is ready to accept client connections.
 Further experimentation reveals that this is not an ideal solution. C* can 
 take a long time (minutes to _hours_) to reach the point where it will accept 
 client connections/queries. The default startup timeout is 90s, which causes 
 the service to be marked failed if exceeded, hence C*, with its long startup 
 times, will often never get the chance to transition to “active”.
 
 
 Part of the issue for me is trying to define what “active” means. The man 
 pages, for “Type=forking services, says: The parent process is expected to 
 exit when start-up is complete and all communication channels are set up”. 
 I’m assuming for “notify” services, sd_notify() should be called when 
 start-up is complete and all communication channels are set up”. Even if 
 this takes hours?
 
 Cassandra exposes a number of inet ports of interest:
 - Client connection ports for running queries via Cassandra Query Language 
 (CQL)/Thrift (RPC) — this is what most clients use to query the database 
 (i.e., to run `SELECT * FROM …` style queries)
 - JMX (Java Management Extensions) for performing management operations — the 
 C* and 3rd-party management tools use this to call management functions and 
 to collect statistics/metrics about the JVM and C*.
 
 The JMX socket is available a few seconds after the process is running.
 
 The CQL/Thrift ports can take far longer to become available — sometimes 
 hours after the process starts. Cassandra only starts listening on these 
 ports once it has joined the cluster of nodes  has synchronised its state. 
 State synchronisation may require bootstrapping  copying large amounts of 
 data across the network and hence take a long time to complete.
 
 Currently my dependent C* client units simply spin-wait, attempting to 
 establish a connection to C*. This seems like duplicated effort and makes 
 these services more complex than they need to be.
 
 My original thought was to just disable the startup timeout on the C*, but 
 that means the unit will stay “activating” for a long time. Also means that 
 JMX clients, which can establish connections almost immediately, would have 
 their startup deferred unnecessarily.
 

I suppose this could be generalized to service announcing different
tokens to systemd and other services being dependent on these tokens.
This may be employed by single binary offering multiple client
interfaces where each interface can be independently up or down.

Hmm ... this sounds suspiciously like what D-Bus does. Did you consider
using D-Bus in your application? 

But for now there is no way to express such dependency in systemd;
D-Bus being exception, you can make services dependent on D-Bus end
points.

 Ideally I’d like to be able to write units that can depend on individual 
 ports being available from a process — i.e, when the CQL port is available, 
 start the client unit(s) and when JMX is available, start a monitoring 
 service. Is this possible with systemd?
 
 Alternatively, I was thinking that I could write some kind of simple 
 process/script that attempts a connection, and exits with failure if the 
 connection cannot be established, or success if it can. I’d then write a unit 
 file, e.g. `cassandra-cql-port.service`:
   [Unit]
   # not really sure what combo of 
 Wants/Requires/Requisite/BindsTo/PartOf/Before/After is needed
   Requisite=cassandra.service
 
   [Service]
   Type=oneshot
   RemainAfterExit=true
   ExecStart=/opt/bin/watch-port 9042
   Restart=on-failure
   RestartSec=1min
   StartLimitInterval=0
 
 My client units could then want/require this unit. Is this a valid approach?
 

Yes, it is. Make a service that will wait for specific port being
available and order all clients after it. 

 Or am I walking down the wrong path to use systemd to manage this?
 

Well, systemd is more focused on one unit - one service design, where
there is well defined master process that represents the service. The
case of single unit offering (or starting) multiple independent
services does not really fit well here.

I wonder - can your master service trigger startup of clients when it is
ready? Note that it can be done in completely generic way - it can
simply run something like cassandra.target and you can plug in any
client into this target.
___
systemd-devel mailing list

[systemd-devel] Starting units when a port is available for connections

2015-05-27 Thread Adam Zegelin
Hi list,

I’m running Cassandra (C*, a clustered database) as a systemd service. 
Currently this is just a “Type=simple” service, as such, dependant units will 
start as soon as the C* process starts rather than when C* is accepting client 
connections.

I’d like to transition to something more complex so I can start to write 
additional units that depend on C*.

I’ve successfully managed to set the service type to “notify” and modify C* to 
call sd_notify() when is ready to accept client connections.
Further experimentation reveals that this is not an ideal solution. C* can take 
a long time (minutes to _hours_) to reach the point where it will accept client 
connections/queries. The default startup timeout is 90s, which causes the 
service to be marked failed if exceeded, hence C*, with its long startup times, 
will often never get the chance to transition to “active”.


Part of the issue for me is trying to define what “active” means. The man 
pages, for “Type=forking services, says: The parent process is expected to 
exit when start-up is complete and all communication channels are set up”. I’m 
assuming for “notify” services, sd_notify() should be called when start-up is 
complete and all communication channels are set up”. Even if this takes hours?

Cassandra exposes a number of inet ports of interest:
- Client connection ports for running queries via Cassandra Query Language 
(CQL)/Thrift (RPC) — this is what most clients use to query the database (i.e., 
to run `SELECT * FROM …` style queries)
- JMX (Java Management Extensions) for performing management operations — the 
C* and 3rd-party management tools use this to call management functions and to 
collect statistics/metrics about the JVM and C*.

The JMX socket is available a few seconds after the process is running.

The CQL/Thrift ports can take far longer to become available — sometimes hours 
after the process starts. Cassandra only starts listening on these ports once 
it has joined the cluster of nodes  has synchronised its state. State 
synchronisation may require bootstrapping  copying large amounts of data 
across the network and hence take a long time to complete.

Currently my dependent C* client units simply spin-wait, attempting to 
establish a connection to C*. This seems like duplicated effort and makes these 
services more complex than they need to be.

My original thought was to just disable the startup timeout on the C*, but that 
means the unit will stay “activating” for a long time. Also means that JMX 
clients, which can establish connections almost immediately, would have their 
startup deferred unnecessarily.

Ideally I’d like to be able to write units that can depend on individual ports 
being available from a process — i.e, when the CQL port is available, start the 
client unit(s) and when JMX is available, start a monitoring service. Is this 
possible with systemd?

Alternatively, I was thinking that I could write some kind of simple 
process/script that attempts a connection, and exits with failure if the 
connection cannot be established, or success if it can. I’d then write a unit 
file, e.g. `cassandra-cql-port.service`:
[Unit]
# not really sure what combo of 
Wants/Requires/Requisite/BindsTo/PartOf/Before/After is needed
Requisite=cassandra.service

[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/opt/bin/watch-port 9042
Restart=on-failure
RestartSec=1min
StartLimitInterval=0

My client units could then want/require this unit. Is this a valid approach?

Or am I walking down the wrong path to use systemd to manage this?

Regards,
Adam

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


[systemd-devel] regression: crashing journal due to watchdog

2015-05-27 Thread Umut Tezduyar Lindskog
Hi,

The for (;;) loop in server_process_datagram might prevent journal
from feeding the watchdog if there is always something to receive in
the syslog socket. Potentially journald is restarted, applications
stall if the syslog socket is staying full

I thought about fixing it by checking the watchdog on every iteration
of for (;;) by using watchdog_last, watchdog_period and feeding
watchdog if necessary but none of those properties are public.

Current rate limit check is done right before we store the message
(after we receive it, after we forward it to console, wall, kmsg). I
think it is too late.

Maybe the best approach is having a rate limit on sd-event
(sd-event-source) so we can map rate limit options in journald.conf to
journal's sd-event.

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


Re: [systemd-devel] 220 tarball erroneously ships keyboard-keys-from-name.gperf

2015-05-27 Thread Lennart Poettering
On Wed, 27.05.15 12:37, Martin Pitt (martin.p...@ubuntu.com) wrote:

 Hey Lennart,
 
 Lennart Poettering [2015-05-27 12:26 +0200]:
* Regularly test make dist, as nobody does that  during regular
  development.
  
  Well, no.
 
 You just said before that we (distros) need to check tarball
 generation/build more often. So I'm a bit confused by the no (but
 see below).

The no was mostly about the part nobody does that during regular
development. I actually do.

  I use make distcheck regularly during regular development, and
  that's how I generate the final tarball.
 
 True, the auto-generated header bug wouldn't have helped if I were to
 do it on e. g. Debian sid and then build packages from that very
 tarball, as it stemmed from being autogenerated from different kernel
 includes etc.
 
 So in that case the only thing that would have discovered this was
 distros testing a tarball that you generated. So, back to RC
 tarball, plz test a few days before you want to release?

Well, the other option is to simply accept that some bugs are not
easily testable for...

I mean, we can of course build tar balls on all distros and then build
them on all others, but this explodes the test matrix for only limited
benefit...

  How about this: please run automated tests if you have them in regular
  intervals, always tracking git. And a few days before a release I'll
  notify the mailing list.
 
 Sounds good. I actually did this twice (not sure if you saw my IRC
 pings about that) I just didn't do it at the right time. I think
 this would have helped to find most issues indeed (except for the
 keys-from-name.gperf thing, but meh -- happens seldomly enough), so
 let's try this for 221!

Any chance to automate that in a cron-job on some server?

Ideally we'd really have a Jenkins instance for that, like David
Strauss' one, but testing the .deb packages Ubuntu (or Debian)
builds. If Ubuntu could provide that this would be very welcome, and
of course it would be something I#d check before I do releases.

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] Vendor default masked service

2015-05-27 Thread Umut Tezduyar Lindskog
On Tue, May 26, 2015 at 4:14 PM, Lennart Poettering
lenn...@poettering.net wrote:
 On Tue, 26.05.15 11:53, Umut Tezduyar Lindskog (u...@tezduyar.com) wrote:

 Hi,

 I was wondering if we have a way to provide vendor default masked
 service?

 Well, so far our thinking was that if the vendor wants to make a unit
 completely unavailable he should simply not ship it in the first
 place.

 What's the usecase for a vendor masking a unit, but installing it? Why
 not remove it in the first place entirely?

If we ship a product without the service, we don't have a way of
installing it again once the product is deployed.

Use case would be: We use one software for a video encoder blade with
multiple CPUs. Every CPU runs the same software. We have a special
service which should only run on the first CPU. A generator installs
the .wants link for the service on first CPU. Another service could
try to talk to the special service over dbus causing it to be dbus
activated (where special service is only allowed to be up on first
CPU). We could install the dbus activation files with generator but it
gets messy to offload this logic to a generator. Also, special service
can be activated by using systemd's dbus interface.

Umut

 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] 220 tarball erroneously ships keyboard-keys-from-name.gperf

2015-05-27 Thread Dimitri John Ledkov
On 27 May 2015 at 10:52, Martin Pitt martin.p...@ubuntu.com wrote:
 Lennart Poettering [2015-05-27 11:42 +0200]:
 Well, but let's not forget that a major part of the issues popping up
 actually were committed weeks ago.

 Actually, no. As I said, on May 11 most everything was working just
 fine, the udev regressions landed very late. The path_is_mount_point()
 regression landed much earlier, but is much less visible (and now
 there are tests cases with the patch I sent).

 Things like the broken gperf generated bits or the missing EFI dirs
 were in git since a lng time.

 It would be great if downstream could help us with testing many of the
 build combinations, at any time of the cycle, not just when it comes
 to a release.

 Agreed. The broken tarball issues are not visible when building from
 git (which is what I'm doing all the time). We didn't have that kind
 of issues with 219 or 218 (or at least only negligible ones), but 220
 taught us all that we need to test make dist builds more often.

 So we have two indepenent things to fix:

  * Regularly test make dist, as nobody does that  during regular
development.

Alternative: Stop shipping make dist tarballs altogether and just
tar the tagged git snapshot. Given the amount of patching that most
distros do, we pretty much all run autoreconf anyway (including
Fedora), so not having the pre-generated autoconfiscation and
pre-built manpages etc. in the tarball isn't actually that much of
a deal.


+1 for dropping make dist support... git archive is really ought to be
the release tarball.


  * Impose a release freeze period with announcing an impending
release, distros do a deep testing (this is a day's work for me, so
can't happen that often). During that time (which really shouldn't
be more than a few days) we really should avoid any commit which
isn't an important bug fix, especially not large refactorings or
new features.

 Thanks,

 Martin

 --
 Martin Pitt| http://www.piware.de
 Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel



-- 
Regards,

Dimitri.
Pura Vida!

https://clearlinux.org
Open Source Technology Center
Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] 220 tarball erroneously ships keyboard-keys-from-name.gperf

2015-05-27 Thread Marc-Antoine Perennou
On 27 May 2015 at 12:26, Lennart Poettering lenn...@poettering.net wrote:

 I use make distcheck regularly during regular development, and
 that's how I generate the final tarball.


What about generating a preview tarball before tagging, and letting us
downstreams a couple of days to test it before you do the actual
tagging and put it in the official location?

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


Re: [systemd-devel] abstracting chkconfig vs. update-rc.d [was: non-merged /usr changes]

2015-05-27 Thread Martin Pitt
Hey Lennart,

Lennart Poettering [2015-05-27 15:08 +0200]:
/usr/lib/lsb/install_initd /etc/init.d/example.com-coffeed
/usr/lib/lsb/remove_initd /etc/init.d/example.com-coffeed
  
  So we could make systemctl just call this if it's available, and
  otherwise do nothing for init.d scripts.
 
 Sounds OK to use something like this, that already exists.
 
 However, we actually need not only enabling/disabling, but also
 is-enabled support, and idea on that?

My current version of the patch keeps the chkconfig implementation for
now; I suppose we don't want to needlessly enforce a lockstep
situation where you can't use systemd git on Fedora until these
scripts exist.

LSB does not define an interface for checking whether an init.d script
is enabled, and e. g. Debian's update-rc.d does not currently either
(https://bugs.debian.org/705254).

We certainly know whether an init.d script is enabled, as we check
exactly that in the sysv-generator (and if it's disabled we don't
create a .service for it). However, right now the systemctl is-enabled
command will just give you a not supported with sysvinit error with
--disable-chkconfig.

 Also, I'd like to keep Lukas Nykryn in the loop on this, our
 initscripts maintainer.

Did you mean to CC: him?

Thanks,

Martin
-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH 1/2] systemctl: Don't skip native units when enabling/disabling SysV init.d scripts

2015-05-27 Thread Lennart Poettering
On Wed, 27.05.15 15:07, Martin Pitt (martin.p...@ubuntu.com) wrote:

 Hello,
 
 as discussed in the get some distro patches upstream thread, this is
 the generalization for supporting different
 chkconfig/update-rc.d/whatnot distro implementations of enabling
 init.d scripts, as per LSB specification.
 
 I figure at some point we might want to drop the explicit
 --enable-chkconfig support and instead provide a Fedora/RedHat
 chckconfig wrapper in /usr/lib/lsb/{install,remove}_initd ? Then we
 can get rid of the #ifdeffery and some code.

Such a wrapper should be added downstream in the Fedora initscripts
package I am sure... I'd like to fully remove native support for this
Fedora tool upstream. The fewer distro-specific hacks the better.

 I tested this with enabling/disabling with only systemd unit and
 only SysV unit, both with and with not having the LSB wrappers. If
 there is both a script and a unit for the same name we need a second
 patch, will post that separately as 2/2 as it's unrelated to this
 change.

If we do this, then I'd like to go all the way right-away: strip
chkconfig support if we add support for the new hook.

  
  if (!streq(verb, enable) 
 -!streq(verb, disable) 
 -!streq(verb, is-enabled))
 +!streq(verb, disable)
 +/* LSB has no way of checking the enablement status */
 +#if defined(HAVE_CHKCONFIG)
 + !streq(verb, is-enabled)
 +#endif
 +)
  return 0;

[...]

  
 -log_info(%s is not a native service, redirecting to 
 /sbin/chkconfig., name);
 -
 +#if defined(HAVE_CHKCONFIG)
 +argv[0] = /sbin/chkconfig;
  if (!isempty(arg_root))
  argv[c++] = q = strappend(--root=, arg_root);
  
 @@ -5170,6 +5174,25 @@ static int enable_sysv_units(const char *verb, char 
 **args) {
  argv[c++] =
  streq(verb, enable) ? on :
  streq(verb, disable) ? off : --level=5;
 +
 +#else
 +if (!isempty(arg_root)  !streq(arg_root, /)) {
 +log_error(Can not %s SysV init script when a root 
 directory other than / is specified, verb);
 +continue;
 +}

Hmm, this makes me feel a bit uneasy about the LSB support... If
neither is-enabled nor --root= can covered by the LSB tool, I
wonder if we should use it at all... Also, as it appears the LSB tool
only takes a single script per invocation, which is also incompatible
with how we need it...

Maybe introducing a new tool for this that covers all options is the
better idea.  Let's call it /usr/lib/systemd/systemd-sysv-install or
so, taking the --root= switch as before, plus enable, disable,
is-enabled plus one or more LSB init script names is the better
option... Distros implementing LSB can then direct this tool to the
LSB tools if they wish, and Fedora can translate this to chkconfig,
without losing any functionality...

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] [PATCH 1/1] Ensure that /run/systemd/network exists

2015-05-27 Thread Lennart Poettering
On Wed, 27.05.15 14:34, Martin Pitt (martin.p...@ubuntu.com) wrote:

 Hey Peter,
 
 Peter Lemenkov [2015-05-27 15:30 +0300]:
  This directory is used for storing transient/generated network service
  files. Unfortunately it doesn't generated during systemd-networkd
  startup. Let's fix that.
  ---
   src/network/networkd.c | 3 +++
   1 file changed, 3 insertions(+)
  
  diff --git a/src/network/networkd.c b/src/network/networkd.c
  index 543a4e4..a98855f 100644
  --- a/src/network/networkd.c
  +++ b/src/network/networkd.c
  @@ -67,6 +67,9 @@ int main(int argc, char *argv[]) {
   if (r  0)
   log_warning_errno(r, Could not create runtime directory 
  'lldp': %m);
   
  +/* Create a directory for the generated transient network services 
  */
  +mkdir_p(/run/systemd/network, 0755);
 
 Should that perhaps go into /usr/lib/tmpfiles.d/systemd.conf instead,
 together with the related
 
   d /run/systemd/netif 0755 systemd-network systemd-network -
   d /run/systemd/netif/links 0755 systemd-network systemd-network -
   d /run/systemd/netif/leases 0755 systemd-network systemd-network -
 
 ?

This would not suffice, as networkd can run in early-boot, but
tmpfiles only runs after /var and friends have been mounted.

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] [PATCH 1/1] Ensure that /run/systemd/network exists

2015-05-27 Thread Lukáš Nykrýn
Lennart Poettering píše v St 27. 05. 2015 v 15:01 +0200:
 On Wed, 27.05.15 14:34, Martin Pitt (martin.p...@ubuntu.com) wrote:
 
  Hey Peter,
  
  Peter Lemenkov [2015-05-27 15:30 +0300]:
   This directory is used for storing transient/generated network service
   files. Unfortunately it doesn't generated during systemd-networkd
   startup. Let's fix that.
   ---
src/network/networkd.c | 3 +++
1 file changed, 3 insertions(+)
   
   diff --git a/src/network/networkd.c b/src/network/networkd.c
   index 543a4e4..a98855f 100644
   --- a/src/network/networkd.c
   +++ b/src/network/networkd.c
   @@ -67,6 +67,9 @@ int main(int argc, char *argv[]) {
if (r  0)
log_warning_errno(r, Could not create runtime directory 
   'lldp': %m);

   +/* Create a directory for the generated transient network 
   services */
   +mkdir_p(/run/systemd/network, 0755);
  
  Should that perhaps go into /usr/lib/tmpfiles.d/systemd.conf instead,
  together with the related
  
d /run/systemd/netif 0755 systemd-network systemd-network -
d /run/systemd/netif/links 0755 systemd-network systemd-network -
d /run/systemd/netif/leases 0755 systemd-network systemd-network -
  
  ?
 
 This would not suffice, as networkd can run in early-boot, but
 tmpfiles only runs after /var and friends have been mounted.
 
 Lennart

For some cases we need that directory really soon. For example for a
generator which creates a .link file that renames a device.

Lukas


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


Re: [systemd-devel] [PATCH 0/2] Using XML entities for paths in manpages

2015-05-27 Thread Lennart Poettering
On Wed, 27.05.15 02:38, Filipe Brandenburger (filbran...@google.com) wrote:

 As suggested by Martin Pitt, for better support of distros with non-merged 
 /usr.
 
 This doesn't get us 100% there but I'd say it gets us much closer.

Hmm, any chance we can somehow define those entities without having to
add 

 !ENTITY % entities SYSTEM custom-entities.ent 
 %entities;
 ]

To each file? Can't we tell xsltproc about this via some command line
switch or so?

This is in a way similar to how we use gcc's -include config.h
switch rather than really write #include config.h in each source
file...

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] abstracting chkconfig vs. update-rc.d [was: non-merged /usr changes]

2015-05-27 Thread Lennart Poettering
On Wed, 27.05.15 13:00, Martin Pitt (martin.p...@ubuntu.com) wrote:

 Lennart Poettering [2015-05-26 18:36 +0200]:
  That said, I think even better would be to maybe make the support for
  this generic in systemctl: instead of explicitly invoking chkconfig or
  update-rcd, maybe we can just make systemctl invoke some fixed binary
  /usr/lib/systemd/systemd-sysv-compat or so with a fixed set of
  parameters. The distros could then make that a tool (maybe just a
  shell script) that invokes chkconfig or update-rc.d This would then
  allow us to remove any chkconfig-specific code from systemd, and would
  allow all distros to plug-in the tool of their choice without having
  to patch upstream. What do you think?
 
 I just stumbled over
 
   
 http://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/initsrcinstrm.html
 
 which specifies pretty much what we talked about above:
 
   /usr/lib/lsb/install_initd /etc/init.d/example.com-coffeed
   /usr/lib/lsb/remove_initd /etc/init.d/example.com-coffeed
 
 So we could make systemctl just call this if it's available, and
 otherwise do nothing for init.d scripts.

Sounds OK to use something like this, that already exists.

However, we actually need not only enabling/disabling, but also
is-enabled support, and idea on that?

Also, I'd like to keep Lukas Nykryn in the loop on this, our
initscripts maintainer. 

Lukas, any opinion on this? If we remove chkconfig support from
systemctl and replace it with generic install_initd/remove_initd
support, would you be willing to add the two necessary scripts to
Fedora's initscripts package?

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] [PATCH 1/2] systemctl: Don't skip native units when enabling/disabling SysV init.d scripts

2015-05-27 Thread Lennart Poettering
On Wed, 27.05.15 15:26, Martin Pitt (martin.p...@ubuntu.com) wrote:

 Lennart Poettering [2015-05-27 15:18 +0200]:
  If we do this, then I'd like to go all the way right-away: strip
  chkconfig support if we add support for the new hook.
 
 OK.
 
   +if (!isempty(arg_root)  !streq(arg_root, /)) {
   +log_error(Can not %s SysV init script when a 
   root directory other than / is specified, verb);
   +continue;
   +}
  
  Hmm, this makes me feel a bit uneasy about the LSB support... If
  neither is-enabled nor --root= can covered by the LSB tool, I
  wonder if we should use it at all...
 
 You give it the full path, so we could also just invoke it with
 path_join(arg_root, p).

That sounds wrong, as that might result in symlinks created in
/etc/rc.d rather that $(root)/etc/rc.d, if you follow what I
mean... Moreover, the symlinks might end up pointing to absolute paths
including the $root prefix, and that would even be worse...

It really matters to pass the root prefix as such to the tool instead
of simply prefixing it to the init script...

 As for is-enabled, since that doesn't exist anywhere we could try and
 call /usr/lib/lsb/initd_enabled.

We really shouldn't place this in the LSB namespace if we aren't LSB.

  Also, as it appears the LSB tool only takes a single script per
  invocation, which is also incompatible with how we need it...
 
 I didn't see that being used anywhere in the systemd source, did I
 miss anything? If so, you can always call stuff in a loop instead,
 no?

Sure, but I think the hook should provide for this natively, instead
of us emulating things around it... But dunno, this certainly isn't a
major issue...

 
  Maybe introducing a new tool for this that covers all options is the
  better idea.  Let's call it /usr/lib/systemd/systemd-sysv-install or
  so, taking the --root= switch as before, plus enable, disable,
  is-enabled plus one or more LSB init script names is the better
  option... Distros implementing LSB can then direct this tool to the
  LSB tools if they wish, and Fedora can translate this to chkconfig,
  without losing any functionality...
 
 I kinda like adhering to LSB, at least where it makes sense; obviously
 we don't have a specification for is-enabled, so we have to make up
 one (/usr/lib/lsb/initd_enabled), but for enable/disable it seems
 quite fine?

Well, again, it covers neither --root=, nor is-enabled, and we
shouldn't pollute foreign namespaces like this.

I mean, you can try to get both the --root= and the is-enabled thing
into LSB proper, but that would take ages, of course... (is the LSB
process even still alive?)

Extending the LSB definitions one-sided and stepping into their
namespace is something we really should not do. There's no point in
having namespaces at all if we ignore them and step into them
anyway...

 But if you still say you want /usr/lib/systemd/systemd-sysv-install
 I'll implement it that way. I care more about getting some abstraction
 than getting an LSB compatible one :-)

I think I would prefer that.

Lennart

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


[systemd-devel] [PATCH] cgtop: raw output option (disable conversion to human-readable units) [r2]

2015-05-27 Thread Charles Duffy
From: Charles Duffy chadu...@cisco.com

Replace the single -r (raw) option with separate flags for memory and IO,
patterned off of --cpu[=TYPE], per feedback from Umut.

Fold repeated conditional logic around formatting into a static function, per
feedback from Zbyszek.

Charles Duffy (1):
  cgtop: add options to format memory, IO usage in raw bytes

 src/cgtop/cgtop.c | 64 ---
 1 file changed, 51 insertions(+), 13 deletions(-)

-- 
2.0.0

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


Re: [systemd-devel] [PATCH] cgtop: add options to format memory, IO usage in raw bytes

2015-05-27 Thread systemd github import bot
Patchset imported to github.
Pull request:
https://github.com/systemd-devs/systemd/compare/master...systemd-mailing-devs:1432334687-30411-2-git-send-email-charles%40dyfis.net

--
Generated by https://github.com/haraldh/mail2git
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] how to call dbus ListUnits for user units?

2015-05-27 Thread Chris Morgan
On Wed, May 27, 2015 at 5:23 AM, Simon McVittie
simon.mcvit...@collabora.co.uk wrote:
 On 26/05/15 20:22, Mantas Mikulėnas wrote:
 But right now, the 'user' bus does not exist by default. To create it,
 you need either
 a) enable/install/boot with kdbus,
 or b) obtain the dbus.service  dbus.socket user units. (They're in
 dbus-git, or various other places like
 https://wiki.archlinux.org/index.php/Systemd/User#D-Bus.)

 The Correct™ way to get dbus.service/dbus.socket user units these days
 is with dbus = 1.9.14 configured with --enable-user-session.

 If there are other ways to get similar units (e.g. user-session-units),
 please deprecate them. dbus upstream is where this stuff should have
 been all along, and in particular, dbus = 1.9.14 is where I've made
 sure that libdbus and `dbus-launch --autolaunch` connect to the user bus
 (if it exists) by default.

 Configured this way, the 'user' bus won't replace the session bus yet

 This is not the case. If there is a user bus, then the session bus *is*
 the user bus.

 S


Hmm.

I'm on F21 here. I can't tell if doing this is easy or hard or if it
will break anything else for me or the other 5 or 6 people that will
have to do the same thing on their systems. If F22 did this by default
I'd upgrade yesterday...

I'm still hoping we can get kdbus (and or user space improvements in
dbus performance...)

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


Re: [systemd-devel] [PATCH 1/2] corrected Subject: systemctl: add support for LSB init.d script enabling/disabling

2015-05-27 Thread Martin Pitt
Meh, copypaste fail, Subject: should have been

  systemctl: add support for LSB init.d script enabling/disabling
-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH 1/2] systemctl: Don't skip native units when enabling/disabling SysV init.d scripts

2015-05-27 Thread Jóhann B. Guðmundsson



On 05/27/2015 01:07 PM, Martin Pitt wrote:

Hello,

as discussed in the get some distro patches upstream thread, this is
the generalization for supporting different
chkconfig/update-rc.d/whatnot distro implementations of enabling
init.d scripts, as per LSB specification.



Is this not something that downstream should be carrying tailored to 
what init implementation what was used in the past and or is shipped in 
the present, ( Debian for example ships/supports multiple init systems ) 
and the support for this dropped upstream?


In the end of the day we *want* the init scripted mess be migrated to 
native systemd units and the only way that will ever be done is if the 
support for it will be dropped upstream which forces distribution and 
vendors to either maintain the compatibility layer themselves and or 
actually go through the effort of migrating to native systemd units.


I would think embedded and most distribution ( with the exception of 
Debian and Slackware ) should have migrated all their legacy sysv 
initscripts to native systemd initscripts by now.


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


Re: [systemd-devel] abstracting chkconfig vs. update-rc.d [was: non-merged /usr changes]

2015-05-27 Thread Lennart Poettering
On Wed, 27.05.15 15:17, Martin Pitt (martin.p...@ubuntu.com) wrote:

 Hey Lennart,
 
 Lennart Poettering [2015-05-27 15:08 +0200]:
 /usr/lib/lsb/install_initd /etc/init.d/example.com-coffeed
 /usr/lib/lsb/remove_initd /etc/init.d/example.com-coffeed
   
   So we could make systemctl just call this if it's available, and
   otherwise do nothing for init.d scripts.
  
  Sounds OK to use something like this, that already exists.
  
  However, we actually need not only enabling/disabling, but also
  is-enabled support, and idea on that?
 
 My current version of the patch keeps the chkconfig implementation for
 now; I suppose we don't want to needlessly enforce a lockstep
 situation where you can't use systemd git on Fedora until these
 scripts exist.

We barely have any init scripts left, this isn't really a big issue
hence. I think it's no problem to require an update in lockstep for
this for Fedora.

 LSB does not define an interface for checking whether an init.d script
 is enabled, and e. g. Debian's update-rc.d does not currently either
 (https://bugs.debian.org/705254).
 
 We certainly know whether an init.d script is enabled, as we check
 exactly that in the sysv-generator (and if it's disabled we don't
 create a .service for it). However, right now the systemctl is-enabled
 command will just give you a not supported with sysvinit error with
 --disable-chkconfig.

I think it should be the hook that generates that error, not systemctl...

 
  Also, I'd like to keep Lukas Nykryn in the loop on this, our
  initscripts maintainer.
 
 Did you mean to CC: him?

That was my intention, and I could bet I did add him.

Lukas, I added you now, can you have a look at branch of the thread
please?

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] [PATCH 0/2] Using XML entities for paths in manpages

2015-05-27 Thread Daniel Mack
On 05/27/2015 03:04 PM, Lennart Poettering wrote:
 Hmm, any chance we can somehow define those entities without having to
 add 
 
  !ENTITY % entities SYSTEM custom-entities.ent 
  %entities;
  ]
 
 To each file? Can't we tell xsltproc about this via some command line
 switch or so?
 
 This is in a way similar to how we use gcc's -include config.h
 switch rather than really write #include config.h in each source
 file...

I've looked for some way to do this, but haven't found a nice solution
yet. The problem is that the full XML tag is:

!DOCTYPE refentry PUBLIC -//OASIS//DTD DocBook XML V4.2//EN
  http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd; [
   !ENTITY % entities SYSTEM custom-entities.ent 
   %entities;
]

So that !ENTITY tag needs to live inside the !DOCTYPE tag, which is not
something you can achieve with a command line switch AFAICS.

We could maybe add some hack to the xsl we feed xsltproc with, but
frankly, the above is the common way of including files to define own
entities, so it'd consider that more readable, even though it's a bit
more boilerplate.


Daniel

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


Re: [systemd-devel] [PATCH 1/2] systemctl: Don't skip native units when enabling/disabling SysV init.d scripts

2015-05-27 Thread Lennart Poettering
On Wed, 27.05.15 15:30, Martin Pitt (martin.p...@ubuntu.com) wrote:

 Lennart Poettering [2015-05-27 15:18 +0200]:
  Maybe introducing a new tool for this that covers all options is the
  better idea.  Let's call it /usr/lib/systemd/systemd-sysv-install or
  so, taking the --root= switch as before, plus enable, disable,
  is-enabled plus one or more LSB init script names is the better
  option...
 
 To reiterate, I'm really worried about multiple names. Not only does
 that needlessly complicate the implementation of the wrapper, it also
 seems like unnecessarily introducing ambiguity. What should
 
   is-enabled foo bar baz
 
 mean? any, all, first, error?
 
 Where do we need this? systemctl calls stuff one by one in a loop
 anyway?

OK, sounds Ok to not do this then.

Lennart

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


[systemd-devel] [PATCH] cgtop: add options to format memory, IO usage in raw bytes

2015-05-27 Thread Charles Duffy
From: Charles Duffy chadu...@cisco.com

---
 src/cgtop/cgtop.c | 64 ---
 1 file changed, 51 insertions(+), 13 deletions(-)

diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
index a390cf3..45c8d6f 100644
--- a/src/cgtop/cgtop.c
+++ b/src/cgtop/cgtop.c
@@ -77,6 +77,15 @@ static enum {
 CPU_TIME,
 } arg_cpu_type = CPU_PERCENT;
 
+enum ByteRepresentation {
+BYTES_HUMAN,
+BYTES_RAW,
+};
+typedef enum ByteRepresentation ByteRepresentation;
+
+static ByteRepresentation arg_memory_type = BYTES_HUMAN;
+static ByteRepresentation arg_io_type = BYTES_HUMAN;
+
 static void group_free(Group *g) {
 assert(g);
 
@@ -96,6 +105,16 @@ static void group_hashmap_free(Hashmap *h) {
 hashmap_free(h);
 }
 
+static char *cond_format_bytes(char *buf, size_t l, off_t t, 
ByteRepresentation r, bool is_valid) {
+if (!is_valid)
+return (char*)   -;
+if (r == BYTES_HUMAN)
+return format_bytes(buf, l, t);
+snprintf(buf, l, %lu8, t);
+buf[l-1] = 0;
+return buf;
+}
+
 static int process(const char *controller, const char *path, Hashmap *a, 
Hashmap *b, unsigned iteration) {
 Group *g;
 int r;
@@ -532,18 +551,9 @@ static int display(Hashmap *a) {
 } else
 printf( %*s, maxtcpu, format_timespan(buffer, 
sizeof(buffer), (nsec_t) (g-cpu_usage / NSEC_PER_USEC), 0));
 
-if (g-memory_valid)
-printf( %8s, format_bytes(buffer, sizeof(buffer), 
g-memory));
-else
-fputs(-, stdout);
-
-if (g-io_valid) {
-printf( %8s,
-   format_bytes(buffer, sizeof(buffer), 
g-io_input_bps));
-printf( %8s,
-   format_bytes(buffer, sizeof(buffer), 
g-io_output_bps));
-} else
-fputs(--, stdout);
+printf( %8s, cond_format_bytes(buffer, sizeof(buffer), 
g-memory, arg_memory_type, g-memory_valid));
+printf( %8s, cond_format_bytes(buffer, sizeof(buffer), 
g-io_input_bps, arg_io_type, g-io_valid));
+printf( %8s, cond_format_bytes(buffer, sizeof(buffer), 
g-io_output_bps, arg_io_type, g-io_valid));
 
 putchar('\n');
 }
@@ -562,6 +572,8 @@ static void help(void) {
  -m  Order by memory load\n
  -i  Order by IO load\n
 --cpu[=TYPE] Show CPU usage as time or percentage 
(default)\n
+--memory[=TYPE]  Show memory usage as bytes or human 
(default)\n
+--io[=TYPE]  Show memory usage as bytes or human 
(default)\n
  -d --delay=DELAYDelay between updates\n
  -n --iterations=N   Run for N iterations before exiting\n
  -b --batch  Run in batch mode, accepting no input\n
@@ -574,7 +586,9 @@ static int parse_argv(int argc, char *argv[]) {
 enum {
 ARG_VERSION = 0x100,
 ARG_DEPTH,
-ARG_CPU_TYPE
+ARG_CPU_TYPE,
+ARG_MEM_TYPE,
+ARG_IO_TYPE,
 };
 
 static const struct option options[] = {
@@ -585,6 +599,8 @@ static int parse_argv(int argc, char *argv[]) {
 { batch,  no_argument,   NULL, 'b' },
 { depth,  required_argument, NULL, ARG_DEPTH   },
 { cpu,optional_argument, NULL, ARG_CPU_TYPE},
+{ memory, optional_argument, NULL, ARG_MEM_TYPE},
+{ io, optional_argument, NULL, ARG_IO_TYPE },
 {}
 };
 
@@ -618,6 +634,28 @@ static int parse_argv(int argc, char *argv[]) {
 }
 break;
 
+case ARG_MEM_TYPE:
+if (optarg) {
+if (strcmp(optarg, human) == 0)
+arg_memory_type = BYTES_HUMAN;
+else if (strcmp(optarg, bytes) == 0)
+arg_memory_type = BYTES_RAW;
+else
+return -EINVAL;
+}
+break;
+
+case ARG_IO_TYPE:
+if (optarg) {
+if (strcmp(optarg, human) == 0)
+arg_io_type = BYTES_HUMAN;
+else if (strcmp(optarg, bytes) == 0)
+arg_io_type = BYTES_RAW;
+else
+return -EINVAL;
+}
+  

Re: [systemd-devel] [PATCH 1/1] Ensure that /run/systemd/network exists

2015-05-27 Thread Martin Pitt
Hey Peter,

Peter Lemenkov [2015-05-27 15:30 +0300]:
 This directory is used for storing transient/generated network service
 files. Unfortunately it doesn't generated during systemd-networkd
 startup. Let's fix that.
 ---
  src/network/networkd.c | 3 +++
  1 file changed, 3 insertions(+)
 
 diff --git a/src/network/networkd.c b/src/network/networkd.c
 index 543a4e4..a98855f 100644
 --- a/src/network/networkd.c
 +++ b/src/network/networkd.c
 @@ -67,6 +67,9 @@ int main(int argc, char *argv[]) {
  if (r  0)
  log_warning_errno(r, Could not create runtime directory 
 'lldp': %m);
  
 +/* Create a directory for the generated transient network services */
 +mkdir_p(/run/systemd/network, 0755);

Should that perhaps go into /usr/lib/tmpfiles.d/systemd.conf instead,
together with the related

  d /run/systemd/netif 0755 systemd-network systemd-network -
  d /run/systemd/netif/links 0755 systemd-network systemd-network -
  d /run/systemd/netif/leases 0755 systemd-network systemd-network -

?

Thanks,

Martin
-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] cgtop: raw output option (disable conversion to human-readable units)

2015-05-27 Thread Zbigniew Jędrzejewski-Szmek
On Fri, May 22, 2015 at 04:56:15PM -0500, Charles Duffy wrote:
 From: Charles Duffy chadu...@cisco.com
 
 ---
  src/cgtop/cgtop.c | 28 ++--
  1 file changed, 22 insertions(+), 6 deletions(-)
 
 diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
 index a390cf3..0dbac7f 100644
 --- a/src/cgtop/cgtop.c
 +++ b/src/cgtop/cgtop.c
 @@ -62,6 +62,7 @@ typedef struct Group {
  static unsigned arg_depth = 3;
  static unsigned arg_iterations = 0;
  static bool arg_batch = false;
 +static bool arg_raw = false;
  static usec_t arg_delay = 1*USEC_PER_SEC;
  
  static enum {
 @@ -533,15 +534,24 @@ static int display(Hashmap *a) {
  printf( %*s, maxtcpu, format_timespan(buffer, 
 sizeof(buffer), (nsec_t) (g-cpu_usage / NSEC_PER_USEC), 0));
  
  if (g-memory_valid)
 -printf( %8s, format_bytes(buffer, sizeof(buffer), 
 g-memory));
 +if(arg_raw) {
 +printf( %8ld, g-memory);
 +} else {
 +printf( %8s, format_bytes(buffer, 
 sizeof(buffer), g-memory));
 +}
  else
Please add a new (static) function which wraps format_bytes and instead
of adding if's everywhere, just call that function.

Also, please don't use braces for single statements.

Zbyszek

  fputs(-, stdout);
  
  if (g-io_valid) {
 -printf( %8s,
 -   format_bytes(buffer, sizeof(buffer), 
 g-io_input_bps));
 -printf( %8s,
 -   format_bytes(buffer, sizeof(buffer), 
 g-io_output_bps));
 +if(arg_raw) {
 +printf( %8ld, g-io_input_bps);
 +printf( %8ld, g-io_output_bps);
 +} else {
 +printf( %8s,
 +   format_bytes(buffer, sizeof(buffer), 
 g-io_input_bps));
 +printf( %8s,
 +   format_bytes(buffer, sizeof(buffer), 
 g-io_output_bps));
 +}
  } else
  fputs(--, stdout);
  
 @@ -561,6 +571,7 @@ static void help(void) {
   -c  Order by CPU load\n
   -m  Order by memory load\n
   -i  Order by IO load\n
 + -r  Provide raw (not human-readable) 
 numbers\n
  --cpu[=TYPE] Show CPU usage as time or percentage 
 (default)\n
   -d --delay=DELAYDelay between updates\n
   -n --iterations=N   Run for N iterations before exiting\n
 @@ -583,6 +594,7 @@ static int parse_argv(int argc, char *argv[]) {
  { delay,  required_argument, NULL, 'd' },
  { iterations, required_argument, NULL, 'n' },
  { batch,  no_argument,   NULL, 'b' },
 +{ raw,no_argument,   NULL, 'r' },
  { depth,  required_argument, NULL, ARG_DEPTH   },
  { cpu,optional_argument, NULL, ARG_CPU_TYPE},
  {}
 @@ -594,7 +606,7 @@ static int parse_argv(int argc, char *argv[]) {
  assert(argc = 1);
  assert(argv);
  
 -while ((c = getopt_long(argc, argv, hptcmin:bd:, options, NULL)) 
 = 0)
 +while ((c = getopt_long(argc, argv, hptcmin:brd:, options, NULL)) 
 = 0)
  
  switch (c) {
  
 @@ -649,6 +661,10 @@ static int parse_argv(int argc, char *argv[]) {
  arg_batch = true;
  break;
  
 +case 'r':
 +arg_raw = true;
 +break;
 +
  case 'p':
  arg_order = ORDER_PATH;
  break;
 -- 
 2.0.0
 
 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] missing: add more IFLA_VXLAN_* defines

2015-05-27 Thread Tom Gundersen
Applied. Thanks!

Tom

On Tue, May 26, 2015 at 7:48 AM, Michael Olbrich
m.olbr...@pengutronix.de wrote:
 Otherwise building faild with kernel headers  v3.16
 ---
  configure.ac |  2 +-
  src/shared/missing.h | 11 +--
  2 files changed, 10 insertions(+), 3 deletions(-)

 diff --git a/configure.ac b/configure.ac
 index 48cedb5ab61a..0818dd80cf0c 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -334,7 +334,7 @@ AC_CHECK_DECLS([IFLA_INET6_ADDR_GEN_MODE,
  IFLA_PHYS_PORT_ID,
  IFLA_BOND_AD_INFO,
  IFLA_VLAN_PROTOCOL,
 -IFLA_VXLAN_LOCAL6,
 +IFLA_VXLAN_REMCSUM_NOPARTIAL,
  IFLA_IPTUN_6RD_RELAY_PREFIXLEN,
  IFLA_BRIDGE_VLAN_INFO,
  IFLA_BRPORT_UNICAST_FLOOD,
 diff --git a/src/shared/missing.h b/src/shared/missing.h
 index 8ca6f8edb62c..919400949138 100644
 --- a/src/shared/missing.h
 +++ b/src/shared/missing.h
 @@ -713,7 +713,7 @@ static inline int setns(int fd, int nstype) {
  #define IFLA_VLAN_MAX   (__IFLA_VLAN_MAX - 1)
  #endif

 -#if !HAVE_DECL_IFLA_VXLAN_LOCAL6
 +#if !HAVE_DECL_IFLA_VXLAN_REMCSUM_NOPARTIAL
  #define IFLA_VXLAN_UNSPEC 0
  #define IFLA_VXLAN_ID 1
  #define IFLA_VXLAN_GROUP 2
 @@ -732,7 +732,14 @@ static inline int setns(int fd, int nstype) {
  #define IFLA_VXLAN_PORT 15
  #define IFLA_VXLAN_GROUP6 16
  #define IFLA_VXLAN_LOCAL6 17
 -#define __IFLA_VXLAN_MAX 18
 +#define IFLA_VXLAN_UDP_CSUM 18
 +#define IFLA_VXLAN_UDP_ZERO_CSUM6_TX 19
 +#define IFLA_VXLAN_UDP_ZERO_CSUM6_RX 20
 +#define IFLA_VXLAN_REMCSUM_TX 21
 +#define IFLA_VXLAN_REMCSUM_RX 22
 +#define IFLA_VXLAN_GBP 23
 +#define IFLA_VXLAN_REMCSUM_NOPARTIAL 24
 +#define __IFLA_VXLAN_MAX 25

  #define IFLA_VXLAN_MAX  (__IFLA_VXLAN_MAX - 1)
  #endif
 --
 2.1.4

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


Re: [systemd-devel] 220 tarball erroneously ships keyboard-keys-from-name.gperf

2015-05-27 Thread Lennart Poettering
On Wed, 27.05.15 13:03, Martin Pitt (martin.p...@ubuntu.com) wrote:

 Lennart Poettering [2015-05-27 12:56 +0200]:
   Sounds good. I actually did this twice (not sure if you saw my IRC
   pings about that) I just didn't do it at the right time. I think
   this would have helped to find most issues indeed (except for the
   keys-from-name.gperf thing, but meh -- happens seldomly enough), so
   let's try this for 221!
  
  Any chance to automate that in a cron-job on some server?
 
 Yes, that has been on my wishlist for quite a while. We have
 a fairly comprehensive set of integration tests now which give systemd
 quite some beating; the main thing that's causing throuble is that
 they won't completely succeed without porting patches, but there's
 certainly some heuristics/leeway there (e. g. find the ones which are
 required and ignore failure to apply the others).

And of course: try to reduce them. As the discussion of the last days
has shown I am sure that quite a number of them can be merged upstream
or solved in a different way.

Lennart

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


[systemd-devel] [PATCH 2/2] systemctl: Don't skip native units when enabling/disabling SysV init.d scripts

2015-05-27 Thread Martin Pitt
Hello,

if you have both a systemd unit and a SysV init script with the same
name, systemctl {en,dis}able currently diverts to chkconfig and
friends *only*, without actually enabling/disabling the native unit.
This is a non-issue for Fedora packages which eliminated init.d
scripts, but still an issue for e. g. Debian or third-party packages
which want to support multiple init systems.

This patch calls both chkconfig (or install_initd with the previous
patch) and handles the native unit in that case.

Thanks for considering,

Martin

-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
From 09727b82df8d84d3350ff1339cffc0bb24a3e7ca Mon Sep 17 00:00:00 2001
From: Martin Pitt martin.p...@ubuntu.com
Date: Wed, 27 May 2015 14:52:17 +0200
Subject: [PATCH 2/2] systemctl: Don't skip native units when
 enabling/disabling SysV init.d scripts

If there is both a SysV init.d script and a systemd unit for a given name, we
want to do the same enable/disable operation for both, instead of just on the
SysV unit. In particular, we do not want to assume that chkconfig, update-rc.d,
install_initd etc. know about how to handle systemd units with all their
features (like Alias= links).
---
 src/systemctl/systemctl.c | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 9c87045..a5316e9 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -5153,9 +5153,6 @@ static int enable_sysv_units(const char *verb, char **args) {
 break;
 }
 
-if (found_native)
-continue;
-
 p = path_join(arg_root, SYSTEM_SYSVINIT_PATH, name);
 if (!p)
 return log_oom();
@@ -5191,7 +5188,10 @@ static int enable_sysv_units(const char *verb, char **args) {
 argv[c++] = p;
 #endif
 
-log_info(%s is not a native service, redirecting to %s., name, argv[0]);
+if (found_native)
+log_info(Synchronizing state of %s with SysV init with %s..., name, argv[0]);
+else
+log_info(%s is not a native service, redirecting to %s., name, argv[0]);
 
 argv[c] = NULL;
 
@@ -5233,6 +5233,9 @@ static int enable_sysv_units(const char *verb, char **args) {
 } else
 return -EPROTO;
 
+if (found_native)
+continue;
+
 /* Remove this entry, so that we don't try enabling it as native unit */
 assert(f  0);
 f--;
-- 
2.1.4



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


Re: [systemd-devel] [PATCH 1/2] systemctl: Don't skip native units when enabling/disabling SysV init.d scripts

2015-05-27 Thread Martin Pitt
Lennart Poettering [2015-05-27 15:18 +0200]:
 Maybe introducing a new tool for this that covers all options is the
 better idea.  Let's call it /usr/lib/systemd/systemd-sysv-install or
 so, taking the --root= switch as before, plus enable, disable,
 is-enabled plus one or more LSB init script names is the better
 option...

To reiterate, I'm really worried about multiple names. Not only does
that needlessly complicate the implementation of the wrapper, it also
seems like unnecessarily introducing ambiguity. What should

  is-enabled foo bar baz

mean? any, all, first, error?

Where do we need this? systemctl calls stuff one by one in a loop
anyway?

Martin
-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Adding additional network interfaces dynamically, after networkd startup finishes

2015-05-27 Thread Tom Gundersen
On Wed, May 27, 2015 at 2:03 PM, Peter Lemenkov lemen...@gmail.com wrote:
 Hello All!
 My network is managed via systemd-networkd. I'm trying to create
 additional network bridge after another one service (VPN) is started.

 Right now I'm having a ExecStartPost directive, which creates
 /run/systemd/network, creates a necessary netdev/link/network files
 here, and restarts networkd (/bin/systemctl restart
 systemd-networkd.service).

 I wonder if it's a correct way to dynamically create network
 interfaces? Is it possible to ask networkd to re-read its
 configuration w/o restarting? Maybe D-Bus commands or something?

There is no correct way of doing this at the moment. It is next on my
list of features to work on.

Cheers,

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


[systemd-devel] [PATCH 1/1] Ensure that /run/systemd/network exists

2015-05-27 Thread Peter Lemenkov
This directory is used for storing transient/generated network service
files. Unfortunately it doesn't generated during systemd-networkd
startup. Let's fix that.
---
 src/network/networkd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/network/networkd.c b/src/network/networkd.c
index 543a4e4..a98855f 100644
--- a/src/network/networkd.c
+++ b/src/network/networkd.c
@@ -67,6 +67,9 @@ int main(int argc, char *argv[]) {
 if (r  0)
 log_warning_errno(r, Could not create runtime directory 
'lldp': %m);
 
+/* Create a directory for the generated transient network services */
+mkdir_p(/run/systemd/network, 0755);
+
 r = drop_privileges(uid, gid,
 (1ULL  CAP_NET_ADMIN) |
 (1ULL  CAP_NET_BIND_SERVICE) |
-- 
2.4.1

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


Re: [systemd-devel] 220 tarball erroneously ships keyboard-keys-from-name.gperf

2015-05-27 Thread Lennart Poettering
On Wed, 27.05.15 12:42, Marc-Antoine Perennou (marc-anto...@perennou.com) wrote:

 On 27 May 2015 at 12:26, Lennart Poettering lenn...@poettering.net wrote:
 
  I use make distcheck regularly during regular development, and
  that's how I generate the final tarball.
 
 What about generating a preview tarball before tagging, and letting us
 downstreams a couple of days to test it before you do the actual
 tagging and put it in the official location?

I'd really prefer if downstreams would do this continously, and not
just close to the time of release.

Again, we should try to keep things in a releasable state in git,
every single day if possible.

Any chance you can automate testing like this for your distro? And of
course, hook this up with some but that notifies us about breakages,
maybe via IRC or so...

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] [PATCH 1/1] Ensure that /run/systemd/network exists

2015-05-27 Thread systemd github import bot
Patchset imported to github.
Pull request:
https://github.com/systemd-devs/systemd/compare/master...systemd-mailing-devs:1432729838-16175-1-git-send-email-lemenkov%40gmail.com

--
Generated by https://github.com/haraldh/mail2git
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 1/2] systemctl: Don't skip native units when enabling/disabling SysV init.d scripts

2015-05-27 Thread Martin Pitt
Hello,

as discussed in the get some distro patches upstream thread, this is
the generalization for supporting different
chkconfig/update-rc.d/whatnot distro implementations of enabling
init.d scripts, as per LSB specification.

I figure at some point we might want to drop the explicit
--enable-chkconfig support and instead provide a Fedora/RedHat
chckconfig wrapper in /usr/lib/lsb/{install,remove}_initd ? Then we
can get rid of the #ifdeffery and some code.

I tested this with enabling/disabling with only systemd unit and
only SysV unit, both with and with not having the LSB wrappers. If
there is both a script and a unit for the same name we need a second
patch, will post that separately as 2/2 as it's unrelated to this
change.

Thanks for considering,

Martin

-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
From 24f7c813548740fdba4d1688c77d298f052be935 Mon Sep 17 00:00:00 2001
From: Martin Pitt martin.p...@ubuntu.com
Date: Wed, 27 May 2015 14:45:25 +0200
Subject: [PATCH 1/2] systemctl: add support for LSB init.d script
 enabling/disabling

With --disable-chkconfig, use the LSB specified scripts
/usr/lib/lsb/{install,remove}_initd to enable/disable a SysV init script when
available. This allows distributions to call their specific tools like
update-rc.d, chkconfig etc. there without patching systemd.

See
  http://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/initsrcinstrm.html
---
 configure.ac  |  2 +-
 src/systemctl/systemctl.c | 35 +--
 2 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index 48cedb5..24164d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -492,7 +492,7 @@ fi
 
 # --
 have_chkconfig=yes
-AC_ARG_ENABLE([chkconfig], AS_HELP_STRING([--disable-chkconfig],[Disable optional chkconfig support]),
+AC_ARG_ENABLE([chkconfig], AS_HELP_STRING([--disable-chkconfig],[Disable optional chkconfig support, use generic LSB support instead]),
 [case ${enableval} in
 yes) have_chkconfig=yes ;;
 no) have_chkconfig=no ;;
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index f8e10a4..9c87045 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -5098,7 +5098,7 @@ static int import_environment(sd_bus *bus, char **args) {
 static int enable_sysv_units(const char *verb, char **args) {
 int r = 0;
 
-#if defined(HAVE_SYSV_COMPAT)  defined(HAVE_CHKCONFIG)
+#if defined(HAVE_SYSV_COMPAT)
 unsigned f = 0;
 _cleanup_lookup_paths_free_ LookupPaths paths = {};
 
@@ -5106,8 +5106,12 @@ static int enable_sysv_units(const char *verb, char **args) {
 return 0;
 
 if (!streq(verb, enable) 
-!streq(verb, disable) 
-!streq(verb, is-enabled))
+!streq(verb, disable)
+/* LSB has no way of checking the enablement status */
+#if defined(HAVE_CHKCONFIG)
+ !streq(verb, is-enabled)
+#endif
+)
 return 0;
 
 /* Processes all SysV units, and reshuffles the array so that
@@ -5123,7 +5127,7 @@ static int enable_sysv_units(const char *verb, char **args) {
 _cleanup_free_ char *p = NULL, *q = NULL, *l = NULL;
 bool found_native = false, found_sysv;
 unsigned c = 1;
-const char *argv[6] = { /sbin/chkconfig, NULL, NULL, NULL, NULL };
+const char *argv[6] = { NULL, NULL, NULL, NULL, NULL };
 char **k;
 int j;
 pid_t pid;
@@ -5161,8 +5165,8 @@ static int enable_sysv_units(const char *verb, char **args) {
 if (!found_sysv)
 continue;
 
-log_info(%s is not a native service, redirecting to /sbin/chkconfig., name);
-
+#if defined(HAVE_CHKCONFIG)
+argv[0] = /sbin/chkconfig;
 if (!isempty(arg_root))
 argv[c++] = q = strappend(--root=, arg_root);
 
@@ -5170,6 +5174,25 @@ static int enable_sysv_units(const char *verb, char **args) {
 argv[c++] =
 streq(verb, enable) ? on :
 streq(verb, disable) ? off : --level=5;
+
+#else
+if (!isempty(arg_root)  !streq(arg_root, /)) {
+log_error(Can not %s SysV init script when a root directory other than / is specified, verb);
+continue;
+}
+if (streq(verb, enable))
+argv[0] = /usr/lib/lsb/install_initd;
+else
+argv[0] = /usr/lib/lsb/remove_initd;
+if (access(argv[0], X_OK) != 0) {
+log_error(Can not %s SysV init script, %s does 

Re: [systemd-devel] [PATCH 6/6] udevd: event - port spawn_wait() to sd-event

2015-05-27 Thread Zbigniew Jędrzejewski-Szmek
On Tue, May 26, 2015 at 12:38:48AM +0200, Tom Gundersen wrote:
 This allows us to drop the special sigterm handling in spawn_wait()
 as this will now be passed directly to the worker event loop.
 
 We now log failing processe at 'warning' leve, otherwise the
 behavior is unchanged.

Changes look nice. I think you can push them... if anything is wrong,
we'll see soon enough.

 ---
  src/test/test-udev.c|   7 --
  src/udev/udev-event.c   | 177 
 +---
  src/udev/udev.h |   2 -
  src/udev/udevadm-test.c |   8 ---
  src/udev/udevd.c|   8 ---
  5 files changed, 94 insertions(+), 108 deletions(-)
 
 diff --git a/src/test/test-udev.c b/src/test/test-udev.c
 index 23b7faa..f3953fe 100644
 --- a/src/test/test-udev.c
 +++ b/src/test/test-udev.c
 @@ -120,11 +120,6 @@ int main(int argc, char *argv[]) {
  
  sigfillset(mask);
  sigprocmask(SIG_SETMASK, mask, sigmask_orig);
 -event-fd_signal = signalfd(-1, mask, SFD_NONBLOCK|SFD_CLOEXEC);
 -if (event-fd_signal  0) {
 -fprintf(stderr, error creating signalfd\n);
 -goto out;
 -}
  
  /* do what devtmpfs usually provides us */
  if (udev_device_get_devnode(dev) != NULL) {
 @@ -153,8 +148,6 @@ int main(int argc, char *argv[]) {
 3 * USEC_PER_SEC, USEC_PER_SEC,
 NULL);
  out:
 -if (event != NULL  event-fd_signal = 0)
 -close(event-fd_signal);
  mac_selinux_finish();
  
  return err ? EXIT_FAILURE : EXIT_SUCCESS;
 diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c
 index 2fa26a4..b8c79b1 100644
 --- a/src/udev/udev-event.c
 +++ b/src/udev/udev-event.c
 @@ -32,7 +32,14 @@
  
  #include udev.h
  #include rtnl-util.h
 +#include event-util.h
  #include formats-util.h
 +#include process-util.h
 +
 +typedef struct Spawn {
 +const char *cmd;
 +pid_t pid;
 +} Spawn;
  
  struct udev_event *udev_event_new(struct udev_device *dev) {
  struct udev *udev = udev_device_get_udev(dev);
 @@ -45,7 +52,6 @@ struct udev_event *udev_event_new(struct udev_device *dev) {
  event-udev = udev;
  udev_list_init(udev, event-run_list, false);
  udev_list_init(udev, event-seclabel_list, false);
 -event-fd_signal = -1;
  event-birth_usec = now(CLOCK_MONOTONIC);
  return event;
  }
 @@ -540,102 +546,107 @@ static void spawn_read(struct udev_event *event,
  result[respos] = '\0';
  }
  
 -static int spawn_wait(struct udev_event *event,
 -  usec_t timeout_usec,
 -  usec_t timeout_warn_usec,
 -  const char *cmd, pid_t pid) {
 -struct pollfd pfd[1];
 -int err = 0;
 +static int on_spawn_timeout(sd_event_source *s, uint64_t usec, void 
 *userdata) {
 +Spawn *spawn = userdata;
  
 -pfd[0].events = POLLIN;
 -pfd[0].fd = event-fd_signal;
 +assert(spawn);
  
 -while (pid  0) {
 -int timeout;
 -int timeout_warn = 0;
 -int fdcount;
 +kill_and_sigcont(spawn-pid, SIGKILL);
  
 -if (timeout_usec  0) {
 -usec_t age_usec;
 +log_error(timeout: '%s' [PID_FMT], killing, spawn-cmd, 
 spawn-pid);
  
 -age_usec = now(CLOCK_MONOTONIC) - event-birth_usec;
 -if (age_usec = timeout_usec)
 -timeout = 1000;
 -else {
 -if (timeout_warn_usec  0)
 -timeout_warn = ((timeout_warn_usec - 
 age_usec) / USEC_PER_MSEC) + MSEC_PER_SEC;
 +return 1;
 +}
  
 -timeout = ((timeout_usec - timeout_warn_usec 
 - age_usec) / USEC_PER_MSEC) + MSEC_PER_SEC;
 -}
 -} else {
 -timeout = -1;
 -}
 +static int on_spawn_timeout_warning(sd_event_source *s, uint64_t usec, void 
 *userdata) {
 +Spawn *spawn = userdata;
  
 -fdcount = poll(pfd, 1, timeout_warn);
 -if (fdcount  0) {
 -if (errno == EINTR)
 -continue;
 -err = -errno;
 -log_error_errno(errno, failed to poll: %m);
 -goto out;
 -}
 -if (fdcount == 0) {
 -log_warning(slow: '%s' [PID_FMT], cmd, pid);
 +assert(spawn);
  
 -fdcount = poll(pfd, 1, timeout);
 -if (fdcount  0) {
 -if (errno == EINTR)
 -continue;
 -err = -errno;
 -log_error_errno(errno, 

Re: [systemd-devel] [PATCH 1/2] systemctl: Don't skip native units when enabling/disabling SysV init.d scripts

2015-05-27 Thread Martin Pitt
Lennart Poettering [2015-05-27 15:18 +0200]:
 If we do this, then I'd like to go all the way right-away: strip
 chkconfig support if we add support for the new hook.

OK.

  +if (!isempty(arg_root)  !streq(arg_root, /)) {
  +log_error(Can not %s SysV init script when a root 
  directory other than / is specified, verb);
  +continue;
  +}
 
 Hmm, this makes me feel a bit uneasy about the LSB support... If
 neither is-enabled nor --root= can covered by the LSB tool, I
 wonder if we should use it at all...

You give it the full path, so we could also just invoke it with
path_join(arg_root, p).

As for is-enabled, since that doesn't exist anywhere we could try and
call /usr/lib/lsb/initd_enabled.

 Also, as it appears the LSB tool only takes a single script per
 invocation, which is also incompatible with how we need it...

I didn't see that being used anywhere in the systemd source, did I
miss anything? If so, you can always call stuff in a loop instead, no?

 Maybe introducing a new tool for this that covers all options is the
 better idea.  Let's call it /usr/lib/systemd/systemd-sysv-install or
 so, taking the --root= switch as before, plus enable, disable,
 is-enabled plus one or more LSB init script names is the better
 option... Distros implementing LSB can then direct this tool to the
 LSB tools if they wish, and Fedora can translate this to chkconfig,
 without losing any functionality...

I kinda like adhering to LSB, at least where it makes sense; obviously
we don't have a specification for is-enabled, so we have to make up
one (/usr/lib/lsb/initd_enabled), but for enable/disable it seems
quite fine?

But if you still say you want /usr/lib/systemd/systemd-sysv-install
I'll implement it that way. I care more about getting some abstraction
than getting an LSB compatible one :-)

Thanks,

Martin

-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] 220 udev boot regression: timeout, giving up waiting for workers to finish

2015-05-27 Thread Tom Gundersen
On Tue, May 26, 2015 at 5:11 PM, Martin Pitt martin.p...@ubuntu.com wrote:
 Hello Tom, all,

 with 220 I get a severe boot time regression:

   $ systemd-analyze
   Startup finished in 30.751s (kernel) + 11.706s (userspace) = 42.458s

 which used to be

   $ systemd-analyze
   Startup finished in 703ms (kernel) + 890ms (userspace) = 1.593s

 (this is a VM)

 It seems udevd --daemon spends 30 seconds timing out in the initramfs:

   [0.384519] systemd-udevd[55]: starting version 220
   [   30.736381] systemd-udevd[56]: timeout, giving up waiting for workers to 
 finish

 and then some more in the real root:

$ systemd-analyze blame
  10.826s dev-vda1.device
  10.067s systemd-tmpfiles-setup-dev.service
  10.031s systemd-sysctl.service
  10.019s systemd-journald.service
  10.005s sys-fs-fuse-connections.mount
  10.001s tmp.mount

 (full journal at http://paste.ubuntu.com/11372265/, but it's not very
 useful)

 I bisected this to

   http://cgit.freedesktop.org/systemd/systemd/commit/?id=e237d8c
   udevd: move file descriptors to Manager

 this is hard to revert individually as there are lots of other recent changes
 in udev around this commit, but any version before that commit is fast
 and doesn't give that timeout error.

 Current trunk as of commit 185abfc3 still has that problem, so it
 wasn't fixed by one of the recent udev commits.

 Does anyone else see this too? Any idea what causes this?

It appears a few people see this, but I was not able to reproduce. If
anyone could reproduce with this patch applied [0], it would be most
helpful (and post the output of journalctl -b -u systemd-udevd).

Cheers,

Tom

[0]: http://paste.fedoraproject.org/226122/74140114/
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH 1/1] Ensure that /run/systemd/network exists

2015-05-27 Thread Lennart Poettering
On Wed, 27.05.15 15:40, Lukáš Nykrýn (lnyk...@redhat.com) wrote:

 Lennart Poettering píše v St 27. 05. 2015 v 15:01 +0200:
  On Wed, 27.05.15 14:34, Martin Pitt (martin.p...@ubuntu.com) wrote:
  
   Hey Peter,
   
   Peter Lemenkov [2015-05-27 15:30 +0300]:
This directory is used for storing transient/generated network service
files. Unfortunately it doesn't generated during systemd-networkd
startup. Let's fix that.
---
 src/network/networkd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/network/networkd.c b/src/network/networkd.c
index 543a4e4..a98855f 100644
--- a/src/network/networkd.c
+++ b/src/network/networkd.c
@@ -67,6 +67,9 @@ int main(int argc, char *argv[]) {
 if (r  0)
 log_warning_errno(r, Could not create runtime 
directory 'lldp': %m);
 
+/* Create a directory for the generated transient network 
services */
+mkdir_p(/run/systemd/network, 0755);
   
   Should that perhaps go into /usr/lib/tmpfiles.d/systemd.conf instead,
   together with the related
   
 d /run/systemd/netif 0755 systemd-network systemd-network -
 d /run/systemd/netif/links 0755 systemd-network systemd-network -
 d /run/systemd/netif/leases 0755 systemd-network systemd-network -
   
   ?
  
  This would not suffice, as networkd can run in early-boot, but
  tmpfiles only runs after /var and friends have been mounted.
 
 For some cases we need that directory really soon. For example for a
 generator which creates a .link file that renames a device.

Nah, systemd generators should only generate unit files, and nothing
else, and do so in the directories that are passed to it on the
command line arguments. 

tools that generate .link/.network/.netdev files should probably live
in their own mini-service that is ordered before networkd and
udev. And those tools should probably just create the dirs on their
own if they are missing to make this race-free.

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] 220 udev boot regression: timeout, giving up waiting for workers to finish

2015-05-27 Thread Filipe Brandenburger
Hi Tom,

On Wed, May 27, 2015 at 8:45 AM, Tom Gundersen t...@jklm.no wrote:
 It appears a few people see this, but I was not able to reproduce. If
 anyone could reproduce with this patch applied [0], it would be most
 helpful (and post the output of journalctl -b -u systemd-udevd).

Done.

Console output from udev in initramfs:
http://paste.fedoraproject.org/226145/43216143/

And the output of the journalctl command you asked:
http://paste.fedoraproject.org/226146/43274324/

I have this on Arch Linux with mkinitcpio. Using latest systemd from
git plus your patch.

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


Re: [systemd-devel] abstracting chkconfig vs. update-rc.d [was: non-merged /usr changes]

2015-05-27 Thread Lukáš Nykrýn
Lennart Poettering píše v St 27. 05. 2015 v 15:22 +0200:
 On Wed, 27.05.15 15:17, Martin Pitt (martin.p...@ubuntu.com) wrote:
 
  Hey Lennart,
  
  Lennart Poettering [2015-05-27 15:08 +0200]:
  /usr/lib/lsb/install_initd /etc/init.d/example.com-coffeed
  /usr/lib/lsb/remove_initd /etc/init.d/example.com-coffeed

So we could make systemctl just call this if it's available, and
otherwise do nothing for init.d scripts.
   
   Sounds OK to use something like this, that already exists.
   
   However, we actually need not only enabling/disabling, but also
   is-enabled support, and idea on that?
  
  My current version of the patch keeps the chkconfig implementation for
  now; I suppose we don't want to needlessly enforce a lockstep
  situation where you can't use systemd git on Fedora until these
  scripts exist.
 
 We barely have any init scripts left, this isn't really a big issue
 hence. I think it's no problem to require an update in lockstep for
 this for Fedora.
 
  LSB does not define an interface for checking whether an init.d script
  is enabled, and e. g. Debian's update-rc.d does not currently either
  (https://bugs.debian.org/705254).
  
  We certainly know whether an init.d script is enabled, as we check
  exactly that in the sysv-generator (and if it's disabled we don't
  create a .service for it). However, right now the systemctl is-enabled
  command will just give you a not supported with sysvinit error with
  --disable-chkconfig.
 
 I think it should be the hook that generates that error, not systemctl...
 
  
   Also, I'd like to keep Lukas Nykryn in the loop on this, our
   initscripts maintainer.
  
  Did you mean to CC: him?
 
 That was my intention, and I could bet I did add him.
 
 Lukas, I added you now, can you have a look at branch of the thread
 please?
 
 Lennart
 

We already have /usr/lib/lsb/install_initd in fedora and rhel, it is in 
redhat-lsb-core, but basically it is just a symlink to chkconfig.

But I would be careful about it. The main problem is, that according to
LSB install_initd requires that lsb dependencies are satisfied and
refuses to install an initscript if they are not.

Lukas



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


Re: [systemd-devel] abstracting chkconfig vs. update-rc.d [was: non-merged /usr changes]

2015-05-27 Thread Lukáš Nykrýn
Martin Pitt píše v St 27. 05. 2015 v 17:45 +0200:
 Hey Lukáš,
 
 Lukáš Nykrýn [2015-05-27 17:32 +0200]:
  We already have /usr/lib/lsb/install_initd in fedora and rhel, it is in
  redhat-lsb-core, but basically it is just a symlink to chkconfig.
 
 Ah, that's not technically correct, as
 /usr/lib/lsb/{install,remove}_initd have a different CLI.

In that case our chkconfig behaves differently:
https://git.fedorahosted.org/cgit/chkconfig.git/tree/chkconfig.c#n683

 
 But anyway, this is moot. We won't call those from systemd after all,
 but instead introduce /usr/lib/systemd/systemd-sysv-install.

Yep it probably make sense, in fedora we can do it as yet another alias
for chkconfig.

 
 Thanks!
 
 Martin

Lukas


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


Re: [systemd-devel] [PATCH 1/2] systemctl: Don't skip native units when enabling/disabling SysV init.d scripts

2015-05-27 Thread Lennart Poettering
On Wed, 27.05.15 13:39, Jóhann B. Guðmundsson (johan...@gmail.com) wrote:

 
 
 On 05/27/2015 01:07 PM, Martin Pitt wrote:
 Hello,
 
 as discussed in the get some distro patches upstream thread, this is
 the generalization for supporting different
 chkconfig/update-rc.d/whatnot distro implementations of enabling
 init.d scripts, as per LSB specification.
 
 
 Is this not something that downstream should be carrying tailored to what
 init implementation what was used in the past and or is shipped in the
 present, ( Debian for example ships/supports multiple init systems ) and the
 support for this dropped upstream?

Well, I think it's too early for that. 3rd party software tends to be
written for LSB. Also, Debian/Ubuntu only very recently switched to
sytemd. Out of fairness we owe them to support the old stuff natively
for a while, the same way we benefitted from that during the fedora
transition.

Also, there are still ~100 sysv scripts in fedora too...

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] 220 udev boot regression: timeout, giving up waiting for workers to finish

2015-05-27 Thread Tom Gundersen
On Wed, May 27, 2015 at 6:16 PM, Filipe Brandenburger
filbran...@google.com wrote:
 Hi Tom,

 On Wed, May 27, 2015 at 8:45 AM, Tom Gundersen t...@jklm.no wrote:
 It appears a few people see this, but I was not able to reproduce. If
 anyone could reproduce with this patch applied [0], it would be most
 helpful (and post the output of journalctl -b -u systemd-udevd).

 Done.

 Console output from udev in initramfs:
 http://paste.fedoraproject.org/226145/43216143/

 And the output of the journalctl command you asked:
 http://paste.fedoraproject.org/226146/43274324/

 I have this on Arch Linux with mkinitcpio. Using latest systemd from
 git plus your patch.

Thanks, that explains it (and teaches me how to reproduce)!

Cheers,

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


[systemd-devel] [PATCH] cgtop: raw output option (disable conversion to human-readable units)

2015-05-27 Thread Charles Duffy
From: Charles Duffy chadu...@cisco.com

---
 src/cgtop/cgtop.c | 34 +-
 1 file changed, 21 insertions(+), 13 deletions(-)

diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
index a390cf3..2849a1d 100644
--- a/src/cgtop/cgtop.c
+++ b/src/cgtop/cgtop.c
@@ -62,6 +62,7 @@ typedef struct Group {
 static unsigned arg_depth = 3;
 static unsigned arg_iterations = 0;
 static bool arg_batch = false;
+static bool arg_raw = false;
 static usec_t arg_delay = 1*USEC_PER_SEC;
 
 static enum {
@@ -96,6 +97,16 @@ static void group_hashmap_free(Hashmap *h) {
 hashmap_free(h);
 }
 
+static const char *cond_format_bytes(char *buf, size_t l, off_t t, bool raw, 
bool is_valid) {
+if (!is_valid)
+return -;
+if (raw) {
+snprintf(buf, l, %zd, t);
+return buf;
+}
+return format_bytes(buf, l, t);
+}
+
 static int process(const char *controller, const char *path, Hashmap *a, 
Hashmap *b, unsigned iteration) {
 Group *g;
 int r;
@@ -532,18 +543,9 @@ static int display(Hashmap *a) {
 } else
 printf( %*s, maxtcpu, format_timespan(buffer, 
sizeof(buffer), (nsec_t) (g-cpu_usage / NSEC_PER_USEC), 0));
 
-if (g-memory_valid)
-printf( %8s, format_bytes(buffer, sizeof(buffer), 
g-memory));
-else
-fputs(-, stdout);
-
-if (g-io_valid) {
-printf( %8s,
-   format_bytes(buffer, sizeof(buffer), 
g-io_input_bps));
-printf( %8s,
-   format_bytes(buffer, sizeof(buffer), 
g-io_output_bps));
-} else
-fputs(--, stdout);
+printf( %8s, cond_format_bytes(buffer, sizeof(buffer), 
g-memory, arg_raw, g-memory_valid));
+printf( %8s, cond_format_bytes(buffer, sizeof(buffer), 
g-io_input_bps, arg_raw, g-io_valid));
+printf( %8s, cond_format_bytes(buffer, sizeof(buffer), 
g-io_output_bps, arg_raw, g-io_valid));
 
 putchar('\n');
 }
@@ -561,6 +563,7 @@ static void help(void) {
  -c  Order by CPU load\n
  -m  Order by memory load\n
  -i  Order by IO load\n
+ -r  Provide raw (not human-readable) 
numbers\n
 --cpu[=TYPE] Show CPU usage as time or percentage 
(default)\n
  -d --delay=DELAYDelay between updates\n
  -n --iterations=N   Run for N iterations before exiting\n
@@ -583,6 +586,7 @@ static int parse_argv(int argc, char *argv[]) {
 { delay,  required_argument, NULL, 'd' },
 { iterations, required_argument, NULL, 'n' },
 { batch,  no_argument,   NULL, 'b' },
+{ raw,no_argument,   NULL, 'r' },
 { depth,  required_argument, NULL, ARG_DEPTH   },
 { cpu,optional_argument, NULL, ARG_CPU_TYPE},
 {}
@@ -594,7 +598,7 @@ static int parse_argv(int argc, char *argv[]) {
 assert(argc = 1);
 assert(argv);
 
-while ((c = getopt_long(argc, argv, hptcmin:bd:, options, NULL)) = 
0)
+while ((c = getopt_long(argc, argv, hptcmin:brd:, options, NULL)) = 
0)
 
 switch (c) {
 
@@ -649,6 +653,10 @@ static int parse_argv(int argc, char *argv[]) {
 arg_batch = true;
 break;
 
+case 'r':
+arg_raw = true;
+break;
+
 case 'p':
 arg_order = ORDER_PATH;
 break;
-- 
2.0.0

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


Re: [systemd-devel] abstracting chkconfig vs. update-rc.d [was: non-merged /usr changes]

2015-05-27 Thread Martin Pitt
Hey Lukáš,

Lukáš Nykrýn [2015-05-27 17:32 +0200]:
 We already have /usr/lib/lsb/install_initd in fedora and rhel, it is in
 redhat-lsb-core, but basically it is just a symlink to chkconfig.

Ah, that's not technically correct, as
/usr/lib/lsb/{install,remove}_initd have a different CLI.

But anyway, this is moot. We won't call those from systemd after all,
but instead introduce /usr/lib/systemd/systemd-sysv-install.

Thanks!

Martin
-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH v2 1/2] systemctl: drop hardcoded chkconfig invocation

2015-05-27 Thread Martin Pitt
Hello again,

as discussed previously this second variant of un-hardcoding chkconfig
now uses the proposed /usr/lib/systemd/systemd-sysv-install
abstraction.

I also added a reference implementation for chkconfig which gets
installed with --enable-chkconfig, so on Fedora this should be no net
change.

I tested this with both --enable-chkconfig and --disable-chkconfig,
and with make dist (*cough*)

This doesn't have a manpage yet (as it's not an user-callable
program); where should this be documented? Just adding to README?

Thanks,

Martin
-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
From 77cb2227e2fbfbad4a48837b00f3d9196366a94d Mon Sep 17 00:00:00 2001
From: Martin Pitt martin.p...@ubuntu.com
Date: Wed, 27 May 2015 17:04:49 +0200
Subject: [PATCH 1/2] systemctl: drop hardcoded chkconfig invocation

Introduce /usr/lib/systemd/systemd-sysv-install [--root=] action name
abstraction instead of directly calling chkconfig. This allows distributions to
call their specific tools like update-rc.d without patching systemd.

Provide a reference implementation systemd-sysv-install.chkconfig and install
that with --enable-chkconfig.
---
 Makefile.am  | 12 +
 configure.ac |  4 +--
 src/systemctl/systemctl.c| 10 +++-
 src/systemctl/systemd-sysv-install.chkconfig | 37 
 4 files changed, 54 insertions(+), 9 deletions(-)
 create mode 100755 src/systemctl/systemd-sysv-install.chkconfig

diff --git a/Makefile.am b/Makefile.am
index d6010c5..e8abef0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -624,9 +624,21 @@ nodist_systemunit_DATA += \
 systemgenerator_PROGRAMS += \
 	systemd-sysv-generator \
 	systemd-rc-local-generator
+
+if HAVE_CHKCONFIG
+chkconfig-install-hook:
+	$(install_sh_PROGRAM) $(top_srcdir)/src/systemctl/systemd-sysv-install.chkconfig $(DESTDIR)/$(rootlibexecdir)/systemd-sysv-install
+
+chkconfig-uninstall-hook:
+	rm -f $(DESTDIR)/$(rootlibexecdir)/systemd-sysv-install
+
+INSTALL_EXEC_HOOKS += chkconfig-install-hook
+UNINSTALL_EXEC_HOOKS += chkconfig-uninstall-hook
+endif
 endif
 
 EXTRA_DIST += \
+	src/systemctl/systemd-sysv-install.chkconfig \
 	units/rc-local.service.in \
 	units/halt-local.service.in
 
diff --git a/configure.ac b/configure.ac
index 48cedb5..6cccbc7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -505,9 +505,7 @@ AC_ARG_ENABLE([chkconfig], AS_HELP_STRING([--disable-chkconfig],[Disable optiona
 have_chkconfig=yes
 fi])
 
-if test x${have_chkconfig} != xno ; then
-AC_DEFINE(HAVE_CHKCONFIG, 1, [Define if CHKCONFIG is available])
-fi
+AM_CONDITIONAL(HAVE_CHKCONFIG, test x${have_chkconfig} != xno)
 
 # --
 have_selinux=no
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index f8e10a4..2a81032 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -5098,7 +5098,7 @@ static int import_environment(sd_bus *bus, char **args) {
 static int enable_sysv_units(const char *verb, char **args) {
 int r = 0;
 
-#if defined(HAVE_SYSV_COMPAT)  defined(HAVE_CHKCONFIG)
+#if defined(HAVE_SYSV_COMPAT)
 unsigned f = 0;
 _cleanup_lookup_paths_free_ LookupPaths paths = {};
 
@@ -5123,7 +5123,7 @@ static int enable_sysv_units(const char *verb, char **args) {
 _cleanup_free_ char *p = NULL, *q = NULL, *l = NULL;
 bool found_native = false, found_sysv;
 unsigned c = 1;
-const char *argv[6] = { /sbin/chkconfig, NULL, NULL, NULL, NULL };
+const char *argv[6] = { ROOTLIBEXECDIR /systemd-sysv-install, NULL, NULL, NULL, NULL };
 char **k;
 int j;
 pid_t pid;
@@ -5161,15 +5161,13 @@ static int enable_sysv_units(const char *verb, char **args) {
 if (!found_sysv)
 continue;
 
-log_info(%s is not a native service, redirecting to /sbin/chkconfig., name);
+log_info(%s is not a native service, redirecting to systemd-sysv-install, name);
 
 if (!isempty(arg_root))
 argv[c++] = q = strappend(--root=, arg_root);
 
+argv[c++] = verb;
 argv[c++] = basename(p);
-argv[c++] =
-streq(verb, enable) ? on :
-streq(verb, disable) ? off : --level=5;
 argv[c] = NULL;
 
 l = strv_join((char**)argv,  );
diff --git a/src/systemctl/systemd-sysv-install.chkconfig b/src/systemctl/systemd-sysv-install.chkconfig
new file mode 100755
index 000..5256e26
--- /dev/null
+++ b/src/systemctl/systemd-sysv-install.chkconfig
@@ -0,0 +1,37 @@
+#!/bin/sh
+set -e
+
+usage() {
+echo Usage: $0 [--root=path] 

[systemd-devel] [PATCH] cgtop: raw output option (disable conversion to human-readable units) [r3]

2015-05-27 Thread Charles Duffy
From: Charles Duffy chadu...@cisco.com

Another take, incorporating feedback from r2.

Charles Duffy (1):
  cgtop: raw output option (disable conversion to human-readable units)

 src/cgtop/cgtop.c | 34 +-
 1 file changed, 21 insertions(+), 13 deletions(-)

-- 
2.0.0

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


Re: [systemd-devel] [PATCH 0/2] Using XML entities for paths in manpages

2015-05-27 Thread Filipe Brandenburger
Hi,

On Wed, May 27, 2015 at 6:04 AM, Lennart Poettering
lenn...@poettering.net wrote:
 Hmm, any chance we can somehow define those entities without having to
 add

  !ENTITY % entities SYSTEM custom-entities.ent 
  %entities;
  ]

 To each file? Can't we tell xsltproc about this via some command line
 switch or so?

I don't think that's possible, in part I believe because XML wants the
documents to be completely described by their doctype and having
external magic includes would break that promise.

In particular, two man pages were using this exact same snippet before
my patch: systemd.generator.xml and systemd.unit.xml (though the
latter didn't seem to use any of the named entities at that point...)

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


Re: [systemd-devel] [PATCH] cgtop: add options to format memory, IO usage in raw bytes

2015-05-27 Thread Zbigniew Jędrzejewski-Szmek
On Fri, May 22, 2015 at 05:44:47PM -0500, Charles Duffy wrote:
 From: Charles Duffy chadu...@cisco.com
 
 ---
  src/cgtop/cgtop.c | 64 
 ---
  1 file changed, 51 insertions(+), 13 deletions(-)
 
 diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
 index a390cf3..45c8d6f 100644
 --- a/src/cgtop/cgtop.c
 +++ b/src/cgtop/cgtop.c
 @@ -77,6 +77,15 @@ static enum {
  CPU_TIME,
  } arg_cpu_type = CPU_PERCENT;
  
 +enum ByteRepresentation {
 +BYTES_HUMAN,
 +BYTES_RAW,
 +};
 +typedef enum ByteRepresentation ByteRepresentation;
 +
 +static ByteRepresentation arg_memory_type = BYTES_HUMAN;
 +static ByteRepresentation arg_io_type = BYTES_HUMAN;
 +
  static void group_free(Group *g) {
  assert(g);
  
 @@ -96,6 +105,16 @@ static void group_hashmap_free(Hashmap *h) {
  hashmap_free(h);
  }
  
 +static char *cond_format_bytes(char *buf, size_t l, off_t t, 
 ByteRepresentation r, bool is_valid) {
This should return const char *.

 +if (!is_valid)
 +return (char*)   -;
Width formatting is already done in the caller of this function.
So just - should be enough.

 +if (r == BYTES_HUMAN)
 +return format_bytes(buf, l, t);
 +snprintf(buf, l, %lu8, t);
What is 8 doing in the format? Also off_t is signed. I think %zd is
the right format.

 +buf[l-1] = 0;
snprintf terminates with NUL on its own, always, so this line is not needed.

Zbyszek

 +return buf;
 +}
 +
  static int process(const char *controller, const char *path, Hashmap *a, 
 Hashmap *b, unsigned iteration) {
  Group *g;
  int r;
 @@ -532,18 +551,9 @@ static int display(Hashmap *a) {
  } else
  printf( %*s, maxtcpu, format_timespan(buffer, 
 sizeof(buffer), (nsec_t) (g-cpu_usage / NSEC_PER_USEC), 0));
  
 -if (g-memory_valid)
 -printf( %8s, format_bytes(buffer, sizeof(buffer), 
 g-memory));
 -else
 -fputs(-, stdout);
 -
 -if (g-io_valid) {
 -printf( %8s,
 -   format_bytes(buffer, sizeof(buffer), 
 g-io_input_bps));
 -printf( %8s,
 -   format_bytes(buffer, sizeof(buffer), 
 g-io_output_bps));
 -} else
 -fputs(--, stdout);
 +printf( %8s, cond_format_bytes(buffer, sizeof(buffer), 
 g-memory, arg_memory_type, g-memory_valid));
 +printf( %8s, cond_format_bytes(buffer, sizeof(buffer), 
 g-io_input_bps, arg_io_type, g-io_valid));
 +printf( %8s, cond_format_bytes(buffer, sizeof(buffer), 
 g-io_output_bps, arg_io_type, g-io_valid));
  
  putchar('\n');
  }
 @@ -562,6 +572,8 @@ static void help(void) {
   -m  Order by memory load\n
   -i  Order by IO load\n
  --cpu[=TYPE] Show CPU usage as time or percentage 
 (default)\n
 +--memory[=TYPE]  Show memory usage as bytes or human 
 (default)\n
 +--io[=TYPE]  Show memory usage as bytes or human 
 (default)\n
So, I know that Umut suggested this, but I'm not sure that this is a good
idea. When would you want different units for memory and io? One switch
should be enough.

Zbyszek

   -d --delay=DELAYDelay between updates\n
   -n --iterations=N   Run for N iterations before exiting\n
   -b --batch  Run in batch mode, accepting no 
 input\n
 @@ -574,7 +586,9 @@ static int parse_argv(int argc, char *argv[]) {
  enum {
  ARG_VERSION = 0x100,
  ARG_DEPTH,
 -ARG_CPU_TYPE
 +ARG_CPU_TYPE,
 +ARG_MEM_TYPE,
 +ARG_IO_TYPE,
  };
  
  static const struct option options[] = {
 @@ -585,6 +599,8 @@ static int parse_argv(int argc, char *argv[]) {
  { batch,  no_argument,   NULL, 'b' },
  { depth,  required_argument, NULL, ARG_DEPTH   },
  { cpu,optional_argument, NULL, ARG_CPU_TYPE},
 +{ memory, optional_argument, NULL, ARG_MEM_TYPE},
 +{ io, optional_argument, NULL, ARG_IO_TYPE },
  {}
  };
  
 @@ -618,6 +634,28 @@ static int parse_argv(int argc, char *argv[]) {
  }
  break;
  
 +case ARG_MEM_TYPE:
 +if (optarg) {
 +if (strcmp(optarg, human) == 0)
 +arg_memory_type = BYTES_HUMAN;
 +else if (strcmp(optarg, bytes) == 0)
 +

Re: [systemd-devel] 220 udev boot regression: timeout, giving up waiting for workers to finish

2015-05-27 Thread Filipe Brandenburger
On Wed, May 27, 2015 at 10:08 AM, Tom Gundersen t...@jklm.no wrote:
 This should be fixed by 86c3bece38bcf55da6387d20c6f01da9ad0284dc.
 Thanks for the help in debugging this, and sorry for the
 inconvenience.

And I can confirm the timeout is gone.

Thanks for fixing it quickly Tom! Glad to help you isolate it.

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


Re: [systemd-devel] How to wait for specific interface/IP?

2015-05-27 Thread Ian Pilcher

On 05/23/2015 11:03 AM, Ian Pilcher wrote:

Is there a simple way to make a service require that a specific network
interface/IP address be active?

I have a manually set up bridge and dnsmasq configuration for my VM
traffic, but dnsmasq is getting started before NetworkManager has
configured the bridge and failing because it cannot bind to the bridge's
IP address.


Thanks to all for your responses.  It looks like dnsmasq's (somewhat
hidden) bind-dynamic option will work for my use case.

I am a bit surprised to find that systemd doesn't provide a way to do
this, nor does it appear to be seen as a desirable feature.  To me, this
seems like exactly the sort of asynchronous, event-driven behavior that
I would consider to be the systemd way.

(In my case, I would be waiting for a private VM traffic bridge, so the
NetworkManager or systemd-networkd wait to be online targets aren't
what I'm looking for.)

Thanks again!

--

Ian Pilcher arequip...@gmail.com
 I grew up before Mark Zuckerberg invented friendship 


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


Re: [systemd-devel] [PATCH] cgtop: raw output option (disable conversion to human-readable units)

2015-05-27 Thread systemd github import bot
Patchset imported to github.
Pull request:
https://github.com/systemd-devs/systemd/compare/master...systemd-mailing-devs:1432339750-31673-2-git-send-email-charles%40dyfis.net

--
Generated by https://github.com/haraldh/mail2git
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH 1/1] Ensure that /run/systemd/network exists

2015-05-27 Thread Lennart Poettering
On Wed, 27.05.15 15:30, Peter Lemenkov (lemen...@gmail.com) wrote:

 This directory is used for storing transient/generated network service
 files. Unfortunately it doesn't generated during systemd-networkd
 startup. Let's fix that.

Hmm, how did you generate these network files?

Why not make the tool you used create the dirs on its own?

 ---
  src/network/networkd.c | 3 +++
  1 file changed, 3 insertions(+)
 
 diff --git a/src/network/networkd.c b/src/network/networkd.c
 index 543a4e4..a98855f 100644
 --- a/src/network/networkd.c
 +++ b/src/network/networkd.c
 @@ -67,6 +67,9 @@ int main(int argc, char *argv[]) {
  if (r  0)
  log_warning_errno(r, Could not create runtime directory 
 'lldp': %m);
  
 +/* Create a directory for the generated transient network services */
 +mkdir_p(/run/systemd/network, 0755);
 +
  r = drop_privileges(uid, gid,
  (1ULL  CAP_NET_ADMIN) |
  (1ULL  CAP_NET_BIND_SERVICE) |
 -- 
 2.4.1
 
 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Lennart

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


[systemd-devel] [PATCH v2 2/2] systemctl: Don't skip native units when enabling/disabling SysV init.d scripts

2015-05-27 Thread Martin Pitt
Hello,

same rationale and patch as before, just unfuzzed against the updated
systemctl: drop hardcoded chkconfig invocation.

Martin
-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
From 2ec8c55f4c37a95d7fdaba5241970d8b1334117f Mon Sep 17 00:00:00 2001
From: Martin Pitt martin.p...@ubuntu.com
Date: Wed, 27 May 2015 14:52:17 +0200
Subject: [PATCH 2/2] systemctl: Don't skip native units when
 enabling/disabling SysV init.d scripts

If there is both a SysV init.d script and a systemd unit for a given name, we
want to do the same enable/disable operation for both, instead of just on the
SysV unit. In particular, we do not want to assume that chkconfig, update-rc.d,
install_initd etc. know about how to handle systemd units with all their
features (like Alias= links).
---
 src/systemctl/systemctl.c | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 2a81032..b922aca 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -5149,9 +5149,6 @@ static int enable_sysv_units(const char *verb, char **args) {
 break;
 }
 
-if (found_native)
-continue;
-
 p = path_join(arg_root, SYSTEM_SYSVINIT_PATH, name);
 if (!p)
 return log_oom();
@@ -5161,7 +5158,10 @@ static int enable_sysv_units(const char *verb, char **args) {
 if (!found_sysv)
 continue;
 
-log_info(%s is not a native service, redirecting to systemd-sysv-install, name);
+if (found_native)
++log_info(Synchronizing state of %s with SysV init with %s..., name, argv[0]);
+else
+log_info(%s is not a native service, redirecting to systemd-sysv-install, name);
 
 if (!isempty(arg_root))
 argv[c++] = q = strappend(--root=, arg_root);
@@ -5208,6 +5208,9 @@ static int enable_sysv_units(const char *verb, char **args) {
 } else
 return -EPROTO;
 
+if (found_native)
+continue;
+
 /* Remove this entry, so that we don't try enabling it as native unit */
 assert(f  0);
 f--;
-- 
2.1.4

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


Re: [systemd-devel] 220 udev boot regression: timeout, giving up waiting for workers to finish

2015-05-27 Thread Tom Gundersen
On Wed, May 27, 2015 at 6:23 PM, Tom Gundersen t...@jklm.no wrote:
 On Wed, May 27, 2015 at 6:16 PM, Filipe Brandenburger
 filbran...@google.com wrote:
 Hi Tom,

 On Wed, May 27, 2015 at 8:45 AM, Tom Gundersen t...@jklm.no wrote:
 It appears a few people see this, but I was not able to reproduce. If
 anyone could reproduce with this patch applied [0], it would be most
 helpful (and post the output of journalctl -b -u systemd-udevd).

 Done.

 Console output from udev in initramfs:
 http://paste.fedoraproject.org/226145/43216143/

 And the output of the journalctl command you asked:
 http://paste.fedoraproject.org/226146/43274324/

 I have this on Arch Linux with mkinitcpio. Using latest systemd from
 git plus your patch.

 Thanks, that explains it (and teaches me how to reproduce)!

This should be fixed by 86c3bece38bcf55da6387d20c6f01da9ad0284dc.
Thanks for the help in debugging this, and sorry for the
inconvenience.

Cheers,

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


Re: [systemd-devel] 220 udev boot regression: timeout, giving up waiting for workers to finish

2015-05-27 Thread Martin Pitt
Hey Tom,

Tom Gundersen [2015-05-27 19:08 +0200]:
 This should be fixed by 86c3bece38bcf55da6387d20c6f01da9ad0284dc.
 Thanks for the help in debugging this, and sorry for the
 inconvenience.

Works like a charm. Great work, thanks!

Martin
-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] Fix systemd.resource-control(5) volume number.

2015-05-27 Thread systemd github import bot
Patchset imported to github.
Pull request:
https://github.com/systemd-devs/systemd/compare/master...systemd-mailing-devs:1432756022-29980-1-git-send-email-batrick%40batbytes.com

--
Generated by https://github.com/haraldh/mail2git
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] Fix systemd.resource-control(5) volume number.

2015-05-27 Thread Patrick Donnelly
Signed-off-by: Patrick Donnelly batr...@batbytes.com
---
 man/systemd.slice.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/systemd.slice.xml b/man/systemd.slice.xml
index f0bac41..a501327 100644
--- a/man/systemd.slice.xml
+++ b/man/systemd.slice.xml
@@ -90,7 +90,7 @@
 slice specific configuration options are configured in
 the [Slice] section. Currently, only generic resource control settings
 as described in
-
citerefentryrefentrytitlesystemd.resource-control/refentrytitlemanvolnum7/manvolnum/citerefentry
 are allowed.
+
citerefentryrefentrytitlesystemd.resource-control/refentrytitlemanvolnum5/manvolnum/citerefentry
 are allowed.
 /para
 
 paraUnless varnameDefaultDependencies=false/varname
-- 
Patrick Donnelly

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


Re: [systemd-devel] [PATCH] fix extraneous space in equality check

2015-05-27 Thread systemd github import bot
Patchset imported to github.
Pull request:
https://github.com/systemd-devs/systemd/compare/master...systemd-mailing-devs:1432753344-31461-1-git-send-email-jonathan.boulle%40coreos.com

--
Generated by https://github.com/haraldh/mail2git
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] fix extraneous space in equality check

2015-05-27 Thread Jonathan Boulle
---
 src/core/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/main.c b/src/core/main.c
index c39815b10675..212ab901b18f 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -1496,7 +1496,7 @@ int main(int argc, char *argv[]) {
 setsid();
 
 /* Move out of the way, so that we won't block unmounts */
-assert_se(chdir(/)  == 0);
+assert_se(chdir(/) == 0);
 
 /* Reset the console, but only if this is really init and we
  * are freshly booted */
-- 
1.9.3

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


Re: [systemd-devel] [PATCH] fix extraneous space in equality check

2015-05-27 Thread Tom Gundersen
Applied. Thanks!

Tom

On Wed, May 27, 2015 at 9:02 PM, Jonathan Boulle
jonathan.bou...@coreos.com wrote:
 ---
  src/core/main.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/src/core/main.c b/src/core/main.c
 index c39815b10675..212ab901b18f 100644
 --- a/src/core/main.c
 +++ b/src/core/main.c
 @@ -1496,7 +1496,7 @@ int main(int argc, char *argv[]) {
  setsid();

  /* Move out of the way, so that we won't block unmounts */
 -assert_se(chdir(/)  == 0);
 +assert_se(chdir(/) == 0);

  /* Reset the console, but only if this is really init and we
   * are freshly booted */
 --
 1.9.3

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


Re: [systemd-devel] [PATCH] Fix systemd.resource-control(5) volume number.

2015-05-27 Thread Tom Gundersen
On Wed, May 27, 2015 at 9:47 PM, Patrick Donnelly batr...@batbytes.com wrote:
 Signed-off-by: Patrick Donnelly batr...@batbytes.com

We don't use s-o-b in systemd, so dropped this when applying. Also
adjusted the subject line a bit (for future reference).

Thanks for the patch! Pushed.

Cheers,

Tom
 ---
  man/systemd.slice.xml | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/man/systemd.slice.xml b/man/systemd.slice.xml
 index f0bac41..a501327 100644
 --- a/man/systemd.slice.xml
 +++ b/man/systemd.slice.xml
 @@ -90,7 +90,7 @@
  slice specific configuration options are configured in
  the [Slice] section. Currently, only generic resource control settings
  as described in
 -
 citerefentryrefentrytitlesystemd.resource-control/refentrytitlemanvolnum7/manvolnum/citerefentry
  are allowed.
 +
 citerefentryrefentrytitlesystemd.resource-control/refentrytitlemanvolnum5/manvolnum/citerefentry
  are allowed.
  /para

  paraUnless varnameDefaultDependencies=false/varname
 --
 Patrick Donnelly

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


[systemd-devel] Alienware graphics amplifier scancodes

2015-05-27 Thread Mario Limonciello

Hi,

Some Alienware notebooks and desktops support an external graphics
housing called the Alienware Graphics Amplifier. It allows the usage
of a larger or more modern graphics card than your gaming PC would
already support.  In order to provide a good experience, systems that
support it can provide notification to the OS via the scancodes on the
the keyboard controller of events related to the cable.

The following 4 events are supported (and the presumed OS response):
* Cable plugged in (An app on the existing display or terminal would
tell the user to reboot the system to activate)
* Undock cable pressed (An app would let the user know to reboot the
system to complete undock process; also when supported by GFX driver,
driver can clean up and work without a reboot)
* Undock hotkey pressed (Same result as undock cable expected)
* Surprise removal of cable (System immediately reboots).

The first three events I think it would make sense to assign to a
keycode that a userspace application in X land can pickup and recognize,
but I'm at a loss what makes most sense (prog1, prog2, prog3 maybe?).
This userspace application hasn't yet been made or decided, I just want
to pave the path for it first.

The fourth event I'm submitting a kernel patch
(https://lkml.org/lkml/2015/5/27/817) so that the kernel would issue a
reboot when this was detected, so I believe it would  make sense to mark
it 'unknown' in systemd.

Also, these don't show up in xev output, but they do show up in evtest.

Can I get some advice on these?  I'll gladly submit a bug with a patch
afterward.

Thanks,

-- *Mario Limonciello* *Dell*| EUC SW Dev Engineering

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


Re: [systemd-devel] crda broken with systemd 220

2015-05-27 Thread Tom Gundersen
On Tue, May 26, 2015 at 11:53 AM, Michał Bartoszkiewicz
mbartoszkiew...@gmail.com wrote:
 Hello,

 it seems that udev from systemd 220 does passes empty environment to a
 process spawned by a RUN rule.
 execve(/usr/sbin/crda, [/usr/sbin/crda], [/* 0 vars */]) = 0
 This breaks crda, as it expects to see COUNTRY in its environment.

Thanks for the report! This should now be fixed in git. Let me know if
that is not the case.

Cheers,

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


[systemd-devel] fsck, /home, btrfs, multiple partitions/drives, boot failure [Ubuntu 15.04]

2015-05-27 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

My immediate problem is a boot failure with systemd on Ubuntu 15.04
because of fsck issues (systemd timing out fscking something it
shouldn't).  Prior Ubuntu releases and upstart work just fine.  Martin
Pitt @ Ubuntu said I should bring the issue here in the Ubuntu bug report:

  https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1447879

I have 6 drives in my system.  Two identical 960GB SSDs (model,
firmware etc all the same, only serial number difference), another two
identical 256GB SSDs (same story), and two spinning drives.

Of note is that my root and /home are both btrfs subvolumes of a RAID0
btrfs using the two first SSDs.  /etc/fstab has these two lines for
them (wrapped by email client):

UUID=3ff68715-0daa-4e44-8de2-0997f36d8ab6 / btrfs
defaults,autodefrag,compress=lzo,subvol=@ 0 1

UUID=3ff68715-0daa-4e44-8de2-0997f36d8ab6 /home btrfs
defaults,autodefrag,compress=lzo,subvol=@home 0 2

blkid output mentioning that UUID:

/dev/sda1: LABEL=main UUID=3ff68715-0daa-4e44-8de2-0997f36d8ab6
UUID_SUB=12243c27-9502-4a1e-b1d1-d1998107b9e4 TYPE=btrfs
PARTUUID=011a8e03-01

/dev/sdb1: LABEL=main UUID=3ff68715-0daa-4e44-8de2-0997f36d8ab6
UUID_SUB=abda2c4f-3346-44e5-b32e-7c1bba0ba728 TYPE=btrfs
PARTUUID=1537012a-01

What happens is that / is mounted successfully, as are all the other
filesystems that aren't /home or mounted below /home.

There will be a message about waiting for fsck either including the
UUID above, or CT960M500SSD1 (drive id), and after 1m30s it times out
and dumps me in a root shell.

The devices/partitions are already mounted as root, so no amount of
further checking makes sense.  If it just went ahead and mounted the
@home subvolume it would be fine.  Instead systemd is unhelpfully
timing out, without any diagnostics as to why it is trying this and
why it doesn't succeed.

Note that /sbin/fsck.btrfs is a shell script (Suse/SGI copyright) that
just prints out BTRFS file system if the device node exists - and
doesn't do anything else.

The Ubuntu bug report includes numerous attachments with various
systemctl and similar outputs, full /etc/fstab etc.  I'll happily
capture whatever else can help diagnose and fix this problem.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iEYEARECAAYFAlVmMQoACgkQmOOfHg372QQ7xgCgy1K0bak/EEy+7YcNR2YZSFcD
GxUAn293LNyeEYpQMIqKv5KNMLaEcv9G
=Ms/5
-END PGP SIGNATURE-

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


Re: [systemd-devel] [PATCH] cgtop: raw output option (disable conversion to human-readable units)

2015-05-27 Thread Umut Tezduyar Lindskog
Hi Charles,

We have done something similar to this with the cpu accounting. The
option is --cpu=TYPE (There is also hidden key '%' on the tty output
which toggles between different display modes). If this patch will be
taken I think we should be consistent. Maybe something like --io=TYPE
or --memory=TYPE.

Umut

On Fri, May 22, 2015 at 11:56 PM, Charles Duffy char...@dyfis.net wrote:
 From: Charles Duffy chadu...@cisco.com

 ---
  src/cgtop/cgtop.c | 28 ++--
  1 file changed, 22 insertions(+), 6 deletions(-)

 diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
 index a390cf3..0dbac7f 100644
 --- a/src/cgtop/cgtop.c
 +++ b/src/cgtop/cgtop.c
 @@ -62,6 +62,7 @@ typedef struct Group {
  static unsigned arg_depth = 3;
  static unsigned arg_iterations = 0;
  static bool arg_batch = false;
 +static bool arg_raw = false;
  static usec_t arg_delay = 1*USEC_PER_SEC;

  static enum {
 @@ -533,15 +534,24 @@ static int display(Hashmap *a) {
  printf( %*s, maxtcpu, format_timespan(buffer, 
 sizeof(buffer), (nsec_t) (g-cpu_usage / NSEC_PER_USEC), 0));

  if (g-memory_valid)
 -printf( %8s, format_bytes(buffer, sizeof(buffer), 
 g-memory));
 +if(arg_raw) {
 +printf( %8ld, g-memory);
 +} else {
 +printf( %8s, format_bytes(buffer, 
 sizeof(buffer), g-memory));
 +}
  else
  fputs(-, stdout);

  if (g-io_valid) {
 -printf( %8s,
 -   format_bytes(buffer, sizeof(buffer), 
 g-io_input_bps));
 -printf( %8s,
 -   format_bytes(buffer, sizeof(buffer), 
 g-io_output_bps));
 +if(arg_raw) {
 +printf( %8ld, g-io_input_bps);
 +printf( %8ld, g-io_output_bps);
 +} else {
 +printf( %8s,
 +   format_bytes(buffer, sizeof(buffer), 
 g-io_input_bps));
 +printf( %8s,
 +   format_bytes(buffer, sizeof(buffer), 
 g-io_output_bps));
 +}
  } else
  fputs(--, stdout);

 @@ -561,6 +571,7 @@ static void help(void) {
   -c  Order by CPU load\n
   -m  Order by memory load\n
   -i  Order by IO load\n
 + -r  Provide raw (not human-readable) 
 numbers\n
  --cpu[=TYPE] Show CPU usage as time or percentage 
 (default)\n
   -d --delay=DELAYDelay between updates\n
   -n --iterations=N   Run for N iterations before exiting\n
 @@ -583,6 +594,7 @@ static int parse_argv(int argc, char *argv[]) {
  { delay,  required_argument, NULL, 'd' },
  { iterations, required_argument, NULL, 'n' },
  { batch,  no_argument,   NULL, 'b' },
 +{ raw,no_argument,   NULL, 'r' },
  { depth,  required_argument, NULL, ARG_DEPTH   },
  { cpu,optional_argument, NULL, ARG_CPU_TYPE},
  {}
 @@ -594,7 +606,7 @@ static int parse_argv(int argc, char *argv[]) {
  assert(argc = 1);
  assert(argv);

 -while ((c = getopt_long(argc, argv, hptcmin:bd:, options, NULL)) 
 = 0)
 +while ((c = getopt_long(argc, argv, hptcmin:brd:, options, NULL)) 
 = 0)

  switch (c) {

 @@ -649,6 +661,10 @@ static int parse_argv(int argc, char *argv[]) {
  arg_batch = true;
  break;

 +case 'r':
 +arg_raw = true;
 +break;
 +
  case 'p':
  arg_order = ORDER_PATH;
  break;
 --
 2.0.0

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


Re: [systemd-devel] [PATCH 4/4] cgtop: support time header with user-specified format string

2015-05-27 Thread Daurnimator
On 28 May 2015 at 09:58, Filipe Brandenburger filbran...@google.com wrote:
 Though I'm not sure whether taking a strftime format as a command line
 argument is really a good idea... But I'll defer that to other
 reviewers.

From working with lua, I recall that accepting arbitary strftime
format strings is unsafe in general.
Behaviour for non-spec'd format specifiers is undefined.
However, all of the linux libcs handle it correctly.
== I remember that Microsoft's libc in particular had issues.

Of course, this isn't an issue for systemd (as it's linux only), so
it's more of a theoretical concern.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] fsck, /home, btrfs, multiple partitions/drives, boot failure [Ubuntu 15.04]

2015-05-27 Thread Andrei Borzenkov
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

В Thu, 28 May 2015 08:27:30 +0300
Andrei Borzenkov arvidj...@gmail.com пишет:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 В Wed, 27 May 2015 14:03:10 -0700
 Roger Binns rog...@rogerbinns.com пишет:
 
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
  
  My immediate problem is a boot failure with systemd on Ubuntu 15.04
  because of fsck issues (systemd timing out fscking something it
  shouldn't).  Prior Ubuntu releases and upstart work just fine.  Martin
  Pitt @ Ubuntu said I should bring the issue here in the Ubuntu bug report:
  
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1447879
  
  I have 6 drives in my system.  Two identical 960GB SSDs (model,
  firmware etc all the same, only serial number difference), another two
  identical 256GB SSDs (same story), and two spinning drives.
  
  Of note is that my root and /home are both btrfs subvolumes of a RAID0
  btrfs using the two first SSDs.  /etc/fstab has these two lines for
  them (wrapped by email client):
  
  UUID=3ff68715-0daa-4e44-8de2-0997f36d8ab6 / btrfs
  defaults,autodefrag,compress=lzo,subvol=@ 0 1
  
  UUID=3ff68715-0daa-4e44-8de2-0997f36d8ab6 /home btrfs
  defaults,autodefrag,compress=lzo,subvol=@home 0 2
  
  blkid output mentioning that UUID:
  
  /dev/sda1: LABEL=main UUID=3ff68715-0daa-4e44-8de2-0997f36d8ab6
  UUID_SUB=12243c27-9502-4a1e-b1d1-d1998107b9e4 TYPE=btrfs
  PARTUUID=011a8e03-01
  
  /dev/sdb1: LABEL=main UUID=3ff68715-0daa-4e44-8de2-0997f36d8ab6
  UUID_SUB=abda2c4f-3346-44e5-b32e-7c1bba0ba728 TYPE=btrfs
  PARTUUID=1537012a-01
  
 
 Apr 24 14:18:41 workstation systemd[1]: Job 
 dev-disk-by\x2duuid-3ff68715\x2d0daa\x2d4e44\x2d8de2\x2d0997f36d8ab6.device/start
  timed out.
 
 systemd times out waiting for UUID alias. Neither sda1 nor sdb1 are
 present in list of active device units. Please show udevadm info -q
 all -n sda1 and udevadm info -q all -n sdb1 after boot.
 

OK, found them in bug report. As expected

P: 
/devices/pci:00/:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda1
E: ID_BTRFS_READY=0
E: SYSTEMD_READY=0


P: 
/devices/pci:00/:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sdb/sdb1
E: ID_BTRFS_READY=0
E: SYSTEMD_READY=0

Something is wrong with scanning for btrfs either in initrd or in
running system.

 
  What happens is that / is mounted successfully, as are all the other
  filesystems that aren't /home or mounted below /home.
 
 
 If your initrd does not properly enters information in udev database,
 this would explain the problem. 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v2
 
 iEYEARECAAYFAlVmp0IACgkQR6LMutpd94zQdgCeI0gZeEHLvobg0+BNCYO8BKzp
 nOAAn0W2E4aZC8qrzxeyEHERfYSVKqHR
 =4XiK
 -END PGP SIGNATURE-

-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iEYEARECAAYFAlVmqM8ACgkQR6LMutpd94yrnQCfbHjRJnIrobWkmUUUsKk+LPZX
IxoAmwcITeP9AWYY3PtLqGOGndSnnSJg
=z+cT
-END PGP SIGNATURE-
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] fsck, /home, btrfs, multiple partitions/drives, boot failure [Ubuntu 15.04]

2015-05-27 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 05/27/2015 04:00 PM, Reindl Harald wrote:
 sounds like https://bugzilla.redhat.com/show_bug.cgi?id=1217969

Thanks for the pointer.  I think my situation is different but it does
show that I should test with fsck.mode=skip and hopefully systemd will
skip whatever is confusing it.

I only have one non-btrfs filesystem (/boot ext4) so I don't need fsck
that much anyway.

Roger

-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iEYEARECAAYFAlVmVG8ACgkQmOOfHg372QTxSACdFW+pZfRWBywf4/eoaM3TgTYR
+skAoIIu8KbEuHroZeyW/jFLePCxH4Tv
=Nfmt
-END PGP SIGNATURE-

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


Re: [systemd-devel] fsck, /home, btrfs, multiple partitions/drives, boot failure [Ubuntu 15.04]

2015-05-27 Thread Martin Pitt
Reindl Harald [2015-05-28  1:00 +0200]:
 
 Am 27.05.2015 um 23:03 schrieb Roger Binns:
 My immediate problem is a boot failure with systemd on Ubuntu 15.04
 because of fsck issues (systemd timing out fscking something it
 shouldn't)
 
 sounds like https://bugzilla.redhat.com/show_bug.cgi?id=1217969

Out of interest, why does it sound the same? Roger's specific
situation is that he has a btrfs device which is spread over multiple
partitions, and all these partitions have the exact same UUID. Do you
actually have that as well? The bug report doesn't mention that, or a
blkid output etc.; I'd say that this kind of striped btrfs is a
special case enough to at least be worth mentioning.

Thanks,

Martin

-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)


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


Re: [systemd-devel] fsck, /home, btrfs, multiple partitions/drives, boot failure [Ubuntu 15.04]

2015-05-27 Thread Andrei Borzenkov
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

В Thu, 28 May 2015 08:34:07 +0300
Andrei Borzenkov arvidj...@gmail.com пишет:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 В Thu, 28 May 2015 08:27:30 +0300
 Andrei Borzenkov arvidj...@gmail.com пишет:
 
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
  
  В Wed, 27 May 2015 14:03:10 -0700
  Roger Binns rog...@rogerbinns.com пишет:
  
   -BEGIN PGP SIGNED MESSAGE-
   Hash: SHA1
   
   My immediate problem is a boot failure with systemd on Ubuntu 15.04
   because of fsck issues (systemd timing out fscking something it
   shouldn't).  Prior Ubuntu releases and upstart work just fine.  Martin
   Pitt @ Ubuntu said I should bring the issue here in the Ubuntu bug report:
   
 https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1447879
   
   I have 6 drives in my system.  Two identical 960GB SSDs (model,
   firmware etc all the same, only serial number difference), another two
   identical 256GB SSDs (same story), and two spinning drives.
   
   Of note is that my root and /home are both btrfs subvolumes of a RAID0
   btrfs using the two first SSDs.  /etc/fstab has these two lines for
   them (wrapped by email client):
   
   UUID=3ff68715-0daa-4e44-8de2-0997f36d8ab6 / btrfs
   defaults,autodefrag,compress=lzo,subvol=@ 0 1
   
   UUID=3ff68715-0daa-4e44-8de2-0997f36d8ab6 /home btrfs
   defaults,autodefrag,compress=lzo,subvol=@home 0 2
   
   blkid output mentioning that UUID:
   
   /dev/sda1: LABEL=main UUID=3ff68715-0daa-4e44-8de2-0997f36d8ab6
   UUID_SUB=12243c27-9502-4a1e-b1d1-d1998107b9e4 TYPE=btrfs
   PARTUUID=011a8e03-01
   
   /dev/sdb1: LABEL=main UUID=3ff68715-0daa-4e44-8de2-0997f36d8ab6
   UUID_SUB=abda2c4f-3346-44e5-b32e-7c1bba0ba728 TYPE=btrfs
   PARTUUID=1537012a-01
   
  
  Apr 24 14:18:41 workstation systemd[1]: Job 
  dev-disk-by\x2duuid-3ff68715\x2d0daa\x2d4e44\x2d8de2\x2d0997f36d8ab6.device/start
   timed out.
  
  systemd times out waiting for UUID alias. Neither sda1 nor sdb1 are
  present in list of active device units. Please show udevadm info -q
  all -n sda1 and udevadm info -q all -n sdb1 after boot.
  
 
 OK, found them in bug report. As expected
 
 P: 
 /devices/pci:00/:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sda/sda1
 E: ID_BTRFS_READY=0
 E: SYSTEMD_READY=0
 
 
 P: 
 /devices/pci:00/:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sdb/sdb1
 E: ID_BTRFS_READY=0
 E: SYSTEMD_READY=0
 
 Something is wrong with scanning for btrfs either in initrd or in
 running system.
 


Hmm ... looking in kernel, btrfs_scan_one_device tries to open device
exclusively. If device is already mounted, it will likely fail. That
explains ID_BTRFS_READY=0. I suppose, udev should first check whether
device is part of mounted filesystem, at which point it obviously is
present and active.

Or should this logic better go into kernel handling of
BTRFS_IOC_DEVICES_READY?
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iEYEARECAAYFAlVmq80ACgkQR6LMutpd94xWaACbBPiw4MViBo846fW38o83Wo5U
XGQAnRH0HOlnGAbG+QatWHV3/T5T00Qn
=A2z8
-END PGP SIGNATURE-
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH 4/4] cgtop: support time header with user-specified format string

2015-05-27 Thread Filipe Brandenburger
Hi,

On Wed, May 27, 2015 at 3:40 PM, Charles Duffy char...@dyfis.net wrote:
 +#pragma GCC diagnostic push
 +#pragma GCC diagnostic ignored -Wformat-nonliteral
 +time_len = strftime(buf, l, arg_time_format, curr_time);
 +if (time_len = 0)
 +return;
 +#pragma GCC diagnostic pop

You could instead use gcc's __attribute__ ((format (strftime, ...)))
to indicate that arg_time_format is supposed to be a valid strftime
format.

https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-g_t_0040code_007bflatten_007d-function-attribute-3080

See also the definition of _printf_ in src/shared/macro.h and its uses.

Though I'm not sure whether taking a strftime format as a command line
argument is really a good idea... But I'll defer that to other
reviewers.

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


Re: [systemd-devel] fsck, /home, btrfs, multiple partitions/drives, boot failure [Ubuntu 15.04]

2015-05-27 Thread Andrei Borzenkov
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

В Wed, 27 May 2015 14:03:10 -0700
Roger Binns rog...@rogerbinns.com пишет:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 My immediate problem is a boot failure with systemd on Ubuntu 15.04
 because of fsck issues (systemd timing out fscking something it
 shouldn't).  Prior Ubuntu releases and upstart work just fine.  Martin
 Pitt @ Ubuntu said I should bring the issue here in the Ubuntu bug report:
 
   https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1447879
 
 I have 6 drives in my system.  Two identical 960GB SSDs (model,
 firmware etc all the same, only serial number difference), another two
 identical 256GB SSDs (same story), and two spinning drives.
 
 Of note is that my root and /home are both btrfs subvolumes of a RAID0
 btrfs using the two first SSDs.  /etc/fstab has these two lines for
 them (wrapped by email client):
 
 UUID=3ff68715-0daa-4e44-8de2-0997f36d8ab6 / btrfs
 defaults,autodefrag,compress=lzo,subvol=@ 0 1
 
 UUID=3ff68715-0daa-4e44-8de2-0997f36d8ab6 /home btrfs
 defaults,autodefrag,compress=lzo,subvol=@home 0 2
 
 blkid output mentioning that UUID:
 
 /dev/sda1: LABEL=main UUID=3ff68715-0daa-4e44-8de2-0997f36d8ab6
 UUID_SUB=12243c27-9502-4a1e-b1d1-d1998107b9e4 TYPE=btrfs
 PARTUUID=011a8e03-01
 
 /dev/sdb1: LABEL=main UUID=3ff68715-0daa-4e44-8de2-0997f36d8ab6
 UUID_SUB=abda2c4f-3346-44e5-b32e-7c1bba0ba728 TYPE=btrfs
 PARTUUID=1537012a-01
 

Apr 24 14:18:41 workstation systemd[1]: Job 
dev-disk-by\x2duuid-3ff68715\x2d0daa\x2d4e44\x2d8de2\x2d0997f36d8ab6.device/start
 timed out.

systemd times out waiting for UUID alias. Neither sda1 nor sdb1 are
present in list of active device units. Please show udevadm info -q
all -n sda1 and udevadm info -q all -n sdb1 after boot.


 What happens is that / is mounted successfully, as are all the other
 filesystems that aren't /home or mounted below /home.


If your initrd does not properly enters information in udev database,
this would explain the problem. 
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iEYEARECAAYFAlVmp0IACgkQR6LMutpd94zQdgCeI0gZeEHLvobg0+BNCYO8BKzp
nOAAn0W2E4aZC8qrzxeyEHERfYSVKqHR
=4XiK
-END PGP SIGNATURE-
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH 1/4] cgtop: raw output option (disable conversion to human-readable units)

2015-05-27 Thread Charles Duffy
From: Charles Duffy chadu...@cisco.com

---
 src/cgtop/cgtop.c | 34 +-
 1 file changed, 21 insertions(+), 13 deletions(-)

diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
index a390cf3..2849a1d 100644
--- a/src/cgtop/cgtop.c
+++ b/src/cgtop/cgtop.c
@@ -62,6 +62,7 @@ typedef struct Group {
 static unsigned arg_depth = 3;
 static unsigned arg_iterations = 0;
 static bool arg_batch = false;
+static bool arg_raw = false;
 static usec_t arg_delay = 1*USEC_PER_SEC;
 
 static enum {
@@ -96,6 +97,16 @@ static void group_hashmap_free(Hashmap *h) {
 hashmap_free(h);
 }
 
+static const char *cond_format_bytes(char *buf, size_t l, off_t t, bool raw, 
bool is_valid) {
+if (!is_valid)
+return -;
+if (raw) {
+snprintf(buf, l, %zd, t);
+return buf;
+}
+return format_bytes(buf, l, t);
+}
+
 static int process(const char *controller, const char *path, Hashmap *a, 
Hashmap *b, unsigned iteration) {
 Group *g;
 int r;
@@ -532,18 +543,9 @@ static int display(Hashmap *a) {
 } else
 printf( %*s, maxtcpu, format_timespan(buffer, 
sizeof(buffer), (nsec_t) (g-cpu_usage / NSEC_PER_USEC), 0));
 
-if (g-memory_valid)
-printf( %8s, format_bytes(buffer, sizeof(buffer), 
g-memory));
-else
-fputs(-, stdout);
-
-if (g-io_valid) {
-printf( %8s,
-   format_bytes(buffer, sizeof(buffer), 
g-io_input_bps));
-printf( %8s,
-   format_bytes(buffer, sizeof(buffer), 
g-io_output_bps));
-} else
-fputs(--, stdout);
+printf( %8s, cond_format_bytes(buffer, sizeof(buffer), 
g-memory, arg_raw, g-memory_valid));
+printf( %8s, cond_format_bytes(buffer, sizeof(buffer), 
g-io_input_bps, arg_raw, g-io_valid));
+printf( %8s, cond_format_bytes(buffer, sizeof(buffer), 
g-io_output_bps, arg_raw, g-io_valid));
 
 putchar('\n');
 }
@@ -561,6 +563,7 @@ static void help(void) {
  -c  Order by CPU load\n
  -m  Order by memory load\n
  -i  Order by IO load\n
+ -r  Provide raw (not human-readable) 
numbers\n
 --cpu[=TYPE] Show CPU usage as time or percentage 
(default)\n
  -d --delay=DELAYDelay between updates\n
  -n --iterations=N   Run for N iterations before exiting\n
@@ -583,6 +586,7 @@ static int parse_argv(int argc, char *argv[]) {
 { delay,  required_argument, NULL, 'd' },
 { iterations, required_argument, NULL, 'n' },
 { batch,  no_argument,   NULL, 'b' },
+{ raw,no_argument,   NULL, 'r' },
 { depth,  required_argument, NULL, ARG_DEPTH   },
 { cpu,optional_argument, NULL, ARG_CPU_TYPE},
 {}
@@ -594,7 +598,7 @@ static int parse_argv(int argc, char *argv[]) {
 assert(argc = 1);
 assert(argv);
 
-while ((c = getopt_long(argc, argv, hptcmin:bd:, options, NULL)) = 
0)
+while ((c = getopt_long(argc, argv, hptcmin:brd:, options, NULL)) = 
0)
 
 switch (c) {
 
@@ -649,6 +653,10 @@ static int parse_argv(int argc, char *argv[]) {
 arg_batch = true;
 break;
 
+case 'r':
+arg_raw = true;
+break;
+
 case 'p':
 arg_order = ORDER_PATH;
 break;
-- 
2.0.0

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


[systemd-devel] [PATCH 2/4] cgtop: allow user to force looping behavior even in non-TTY mode

2015-05-27 Thread Charles Duffy
From: Charles Duffy chadu...@cisco.com

---
 src/cgtop/cgtop.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
index 2849a1d..8a0e075 100644
--- a/src/cgtop/cgtop.c
+++ b/src/cgtop/cgtop.c
@@ -60,7 +60,7 @@ typedef struct Group {
 } Group;
 
 static unsigned arg_depth = 3;
-static unsigned arg_iterations = 0;
+static int64_t arg_iterations = -1;
 static bool arg_batch = false;
 static bool arg_raw = false;
 static usec_t arg_delay = 1*USEC_PER_SEC;
@@ -641,7 +641,7 @@ static int parse_argv(int argc, char *argv[]) {
 break;
 
 case 'n':
-r = safe_atou(optarg, arg_iterations);
+r = safe_atoi64(optarg, arg_iterations);
 if (r  0) {
 log_error(Failed to parse iterations 
parameter.);
 return -EINVAL;
@@ -715,8 +715,8 @@ int main(int argc, char *argv[]) {
 
 signal(SIGWINCH, columns_lines_cache_reset);
 
-if (!on_tty())
-arg_iterations = 1;
+if (arg_iterations  0)
+arg_iterations = on_tty() ? 0 : 1;
 
 while (!quit) {
 Hashmap *c;
-- 
2.0.0

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


[systemd-devel] [PATCH 4/4] cgtop: support time header with user-specified format string

2015-05-27 Thread Charles Duffy
From: Charles Duffy chadu...@cisco.com

---
 src/cgtop/cgtop.c | 50 +-
 1 file changed, 49 insertions(+), 1 deletion(-)

diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
index 53e3a64..c3db62b 100644
--- a/src/cgtop/cgtop.c
+++ b/src/cgtop/cgtop.c
@@ -63,6 +63,8 @@ static unsigned arg_depth = 3;
 static int64_t arg_iterations = -1;
 static bool arg_batch = false;
 static bool arg_raw = false;
+static char *arg_time_format = NULL;
+static bool arg_time_utc = false;
 static usec_t arg_delay = 1*USEC_PER_SEC;
 
 static enum {
@@ -107,6 +109,37 @@ static const char *cond_format_bytes(char *buf, size_t l, 
off_t t, bool raw, boo
 return format_bytes(buf, l, t);
 }
 
+static void print_time_header(char *buf, size_t l, size_t width) {
+struct tm *curr_time;
+size_t time_len;
+time_t raw_time;
+
+if (arg_time_format == NULL)
+return;
+
+time(raw_time);
+
+if (arg_time_utc)
+curr_time = gmtime(raw_time);
+else
+curr_time = localtime(raw_time);
+
+if(curr_time == NULL)
+return;
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored -Wformat-nonliteral
+time_len = strftime(buf, l, arg_time_format, curr_time);
+if (time_len = 0)
+return;
+#pragma GCC diagnostic pop
+
+if (on_tty())
+fprintf(stdout, %*s, (int)(width - time_len), );
+
+fprintf(stdout, %s\n, buf);
+}
+
 static int process(const char *controller, const char *path, Hashmap *a, 
Hashmap *b, unsigned iteration) {
 Group *g;
 int r;
@@ -477,6 +510,9 @@ static int display(Hashmap *a) {
 
 qsort_safe(array, n, sizeof(Group*), group_compare);
 
+/* If timestamp is requested, print right-justified above header */
+print_time_header(buffer, sizeof(buffer), columns());
+
 /* Find the longest names in one run */
 for (j = 0; j  n; j++) {
 unsigned cputlen, pathtlen;
@@ -569,6 +605,8 @@ static void help(void) {
  -n --iterations=N   Run for N iterations before exiting\n
  -b --batch  Run in batch mode, accepting no input\n
 --depth=DEPTHMaximum traversal depth (default: %u)\n
+ -T --time=FORMATprint time, optionally with format 
string\n
+ -U --utcuse UTC rather than localtime for time 
header\n
, program_invocation_short_name, arg_depth);
 }
 
@@ -589,6 +627,8 @@ static int parse_argv(int argc, char *argv[]) {
 { raw,no_argument,   NULL, 'r' },
 { depth,  required_argument, NULL, ARG_DEPTH   },
 { cpu,optional_argument, NULL, ARG_CPU_TYPE},
+{ time,optional_argument, NULL, 'T' },
+{ utc,no_argument,   NULL, 'U' },
 {}
 };
 
@@ -598,7 +638,7 @@ static int parse_argv(int argc, char *argv[]) {
 assert(argc = 1);
 assert(argv);
 
-while ((c = getopt_long(argc, argv, hptcmin:brd:, options, NULL)) = 
0)
+while ((c = getopt_long(argc, argv, hptcmin:brd:TU, options, NULL)) 
= 0)
 
 switch (c) {
 
@@ -611,6 +651,14 @@ static int parse_argv(int argc, char *argv[]) {
 puts(SYSTEMD_FEATURES);
 return 0;
 
+case 'T':
+arg_time_format = strdup(optarg ? optarg : %a 
%Y-%m-%d %H:%M:%S);
+break;
+
+case 'U':
+arg_time_utc = true;
+break;
+
 case ARG_CPU_TYPE:
 if (optarg) {
 if (strcmp(optarg, time) == 0)
-- 
2.0.0

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


[systemd-devel] [PATCH 3/4] cgtop: more sensible flushing behavior w/ non-TTY output

2015-05-27 Thread Charles Duffy
From: Charles Duffy chadu...@cisco.com

- Explicitly flush stdout before sleep between iterations
- Only clear user keystrokes when output is to TTY
- Add a newline between output batches when output is not to TTY
---
 src/cgtop/cgtop.c | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
index 8a0e075..53e3a64 100644
--- a/src/cgtop/cgtop.c
+++ b/src/cgtop/cgtop.c
@@ -749,6 +749,10 @@ int main(int argc, char *argv[]) {
 if (arg_iterations  iteration = arg_iterations)
 break;
 
+if (!on_tty()) /* non-TTY: Empty newline as delimiter between 
polls */
+fputs(\n, stdout);
+fflush(stdout);
+
 if (arg_batch) {
 usleep(last_refresh + arg_delay - t);
 } else {
@@ -762,8 +766,10 @@ int main(int argc, char *argv[]) {
 }
 }
 
-fputs(\r \r, stdout);
-fflush(stdout);
+if (on_tty()) { /* TTY: Clear any user keystroke */
+fputs(\r \r, stdout);
+fflush(stdout);
+}
 
 if (arg_batch)
 continue;
-- 
2.0.0

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


[systemd-devel] [PATCH 0/4] More cgtop enhancements

2015-05-27 Thread Charles Duffy
From: Charles Duffy chadu...@cisco.com

In addition to the previously-submitted patch adding support for raw (numeric
byte-count, as opposed to human-readable) values, this series adds several new
enhancements:

- Allow the user to specify a strftime-compatible string to use as header.
- Retain default behavior of using only one iteration when output is not to a
  TTY, but allow endless looping or a set iteration count to be selected.
- Improve output format in the non-TTY case for easy parsing (separating
  batches with an empty line, rather than the de facto \r \r string intended
  to clear artifacts from user input, and ensuring that flushing stdout happens
  *before* the sleep between runs).

The strftime support, by its nature, requires use of an externally-provided
format string; consequently, an appropriate pragma is used to suppress warnings
from gcc. Feedback appreciated.

Charles Duffy (4):
  cgtop: raw output option (disable conversion to human-readable units)
  cgtop: allow user to force looping behavior even in non-TTY mode
  cgtop: more sensible flushing behavior w/ non-TTY output
  cgtop: support time header with user-specified format string

 src/cgtop/cgtop.c | 100 +++---
 1 file changed, 81 insertions(+), 19 deletions(-)

-- 
2.0.0

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


Re: [systemd-devel] fsck, /home, btrfs, multiple partitions/drives, boot failure [Ubuntu 15.04]

2015-05-27 Thread Reindl Harald


Am 27.05.2015 um 23:03 schrieb Roger Binns:

My immediate problem is a boot failure with systemd on Ubuntu 15.04
because of fsck issues (systemd timing out fscking something it
shouldn't)


sounds like https://bugzilla.redhat.com/show_bug.cgi?id=1217969



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH 4/4] cgtop: support time header with user-specified format string

2015-05-27 Thread systemd github import bot
Patchset imported to github.
Pull request:
https://github.com/systemd-devs/systemd/compare/master...systemd-mailing-devs:1432766423-4578-5-git-send-email-charles%40dyfis.net

--
Generated by https://github.com/haraldh/mail2git
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] path-util: Fix path_is_mount_point for files

2015-05-27 Thread Martin Pitt
Martin Pitt [2015-05-25 21:06 +0200]:
 in 220, path_is_mount_point() now always fails with -20 ENOTDIR when
 calling it on files. This is problematic as it's perfectly valid to
 have bind-mounted files; in fact, systemd's machine_id_setup() itself
 creates a /run/machine-id → /etc/machine-id bind mount if /etc is
 read-only at that time (and systemd-machine-id-commit will write it
 once root fs becomes writable).
 
 This was first introduced here:
 
   http://cgit.freedesktop.org/systemd/systemd/commit/?id=27cc6f166
   path-util: fix path_is_mount_point() for symlinks
 
 which added O_DIRECTORY, so that openat() fails with the above error.
 It also replaced path_get_parent() (which works fine for files) with
 name_to_handle_at(fd, .., ...) which only works for directories.
 
 In fd_is_mount_point() we obviously don't have access to the file name
 any more, and presumably we do want to keep it for efficiently
 implementing the rm-rf: never cross mount points commit f25afeb.

This patch fixes this. When writing the new tests I also noticed that
allow_symlink==false was broken, this also gets fixed.

Martin
-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
From 4cdedcfd8f6de20f7d7eec7fa9ac3385ca18cffe Mon Sep 17 00:00:00 2001
From: Martin Pitt martin.p...@ubuntu.com
Date: Wed, 27 May 2015 09:56:03 +0200
Subject: [PATCH] path-util: Fix path_is_mount_point for files
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Commits 27cc6f166 and f25afeb broke path_is_mount_point() for files (such as
/etc/machine-id → /run/machine-id bind mounts) as with the factorization of
fd_is_mount_point() we lost the parent directory. We cannot determine that from
an fd only as openat(fd, ..) only works for directory fds.

Change fd_is_mount_point() to get a parent path, which we use instead of ..
when it's not NULL.

Drop the O_DIRECTORY restriction in path_is_mount_point() so that we can handle
files, and add the missing O_NOFOLLOW so that symlinks actually get opened as
symlinks; the latter fixes path_is_mountpoint(some/symlink, false).

Add test cases for files, links, and file bind mounts (the latter will only
work when running as root). Split out a new test_path_is_mount_point() test
case function as it got significantly larger now.
---
 src/shared/path-util.c| 30 +++
 src/shared/path-util.h|  2 +-
 src/shared/rm-rf.c|  4 +--
 src/test/test-path-util.c | 76 +++
 4 files changed, 90 insertions(+), 22 deletions(-)

diff --git a/src/shared/path-util.c b/src/shared/path-util.c
index 7090989..a43cde2 100644
--- a/src/shared/path-util.c
+++ b/src/shared/path-util.c
@@ -509,7 +509,7 @@ static int fd_fdinfo_mnt_id(int fd, const char *filename, int flags, int *mnt_id
 return safe_atoi(p, mnt_id);
 }
 
-int fd_is_mount_point(int fd) {
+int fd_is_mount_point(int fd, const char *parent) {
 union file_handle_union h = FILE_HANDLE_INIT, h_parent = FILE_HANDLE_INIT;
 int mount_id = -1, mount_id_parent = -1;
 bool nosupp = false, check_st_dev = true;
@@ -558,7 +558,11 @@ int fd_is_mount_point(int fd) {
 return -errno;
 }
 
-r = name_to_handle_at(fd, .., h_parent.handle, mount_id_parent, 0);
+if (parent)
+r = name_to_handle_at(AT_FDCWD, parent, h_parent.handle, mount_id_parent, 0);
+else
+/* this only works for directories */
+r = name_to_handle_at(fd, .., h_parent.handle, mount_id_parent, 0);
 if (r  0) {
 if (errno == EOPNOTSUPP) {
 if (nosupp)
@@ -599,7 +603,11 @@ fallback_fdinfo:
 if (r  0)
 return r;
 
-r = fd_fdinfo_mnt_id(fd, .., 0, mount_id_parent);
+if (parent)
+r = fd_fdinfo_mnt_id(AT_FDCWD, parent, 0, mount_id_parent);
+else
+/* this only works for directories */
+r = fd_fdinfo_mnt_id(fd, .., 0, mount_id_parent);
 if (r  0)
 return r;
 
@@ -618,7 +626,11 @@ fallback_fstat:
 if (fstatat(fd, , a, AT_EMPTY_PATH)  0)
 return -errno;
 
-if (fstatat(fd, .., b, 0)  0)
+if (parent)
+r = fstatat(AT_FDCWD, parent, b, 0);
+else
+r = fstatat(fd, .., b, 0);
+if (r  0)
 return -errno;
 
 /* A directory with same device and inode as its parent? Must
@@ -632,17 +644,23 @@ fallback_fstat:
 
 int path_is_mount_point(const char *t, bool allow_symlink) {
 _cleanup_close_ int fd = -1;
+_cleanup_free_ char *parent = NULL;
+int r;
 
 assert(t);
 
 if (path_equal(t, /))
 return 1;
 
-fd = openat(AT_FDCWD, t, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|(allow_symlink ? 0 : O_PATH));
+