platform/upstream/systemd.git
9 years agosd-device: get_driver - remember if a device does not have a driver
Tom Gundersen [Mon, 1 Jun 2015 21:53:37 +0000 (23:53 +0200)]
sd-device: get_driver - remember if a device does not have a driver

Don't try to read it again.

9 years agosd-device: get_subsystem - don't complain if a device does not have a subsystem
Tom Gundersen [Mon, 1 Jun 2015 21:51:37 +0000 (23:51 +0200)]
sd-device: get_subsystem - don't complain if a device does not have a subsystem

9 years agoMerge pull request #5 from systemd-mailing-devs/1432910411-14517-1-git-send-email...
Daniel Mack [Tue, 2 Jun 2015 15:57:43 +0000 (17:57 +0200)]
Merge pull request #5 from systemd-mailing-devs/1432910411-14517-1-git-send-email-llua@gmx.com

zsh-completion: a more style/tag aware _systemctl

9 years agoMerge pull request #4 from systemd-mailing-devs/1431989131-25145-1-git-send-email...
Daniel Mack [Tue, 2 Jun 2015 15:43:29 +0000 (17:43 +0200)]
Merge pull request #4 from systemd-mailing-devs/1431989131-25145-1-git-send-email-llua@gmx.com

zsh-completion: fix completion of --user services

9 years agoMerge pull request #34 from systemd-mailing-devs/1432619328-32030-1-git-send-email...
Tom Gundersen [Tue, 2 Jun 2015 15:29:52 +0000 (17:29 +0200)]
Merge pull request #34 from systemd-mailing-devs/1432619328-32030-1-git-send-email-m.olbrich@pengutronix.de

missing: add more IFLA_VXLAN_* defines

9 years agoMerge pull request #8 from systemd-mailing-devs/1433236059-9824-1-git-send-email...
Martin Pitt [Tue, 2 Jun 2015 15:24:34 +0000 (17:24 +0200)]
Merge pull request #8 from systemd-mailing-devs/1433236059-9824-1-git-send-email-m.olbrich@pengutronix.de

random-util: guard including sys/auxv.h with the corresponding ifdef …

9 years agoMerge pull request #39 from filbranden/manpages_rootprefix
Daniel Mack [Tue, 2 Jun 2015 15:22:06 +0000 (17:22 +0200)]
Merge pull request #39 from filbranden/manpages_rootprefix

Manpages rootprefix

9 years agobuild-sys: Normalize paths of configure options
Michael Biebl [Sat, 30 May 2015 01:04:55 +0000 (03:04 +0200)]
build-sys: Normalize paths of configure options

Strip trailing slashes from options such as --with-rootprefix, so that building
with rootprefix="/" results in paths like "/lib" instead of "//lib".

Also handle paths such as "/usr/" gracefully.

Use m4/ax_normalize_path.m4 from the autoconf-archive project, which is now
included in our tree as per usual practices in using autoconf-archive macros.

Tested with the following configure options:
  ./configure \
        --with-rootprefix=/ \
        --with-rootlibdir=/lib64/ \
        --prefix=/usr/ \
        --libdir=/lib/ \
        --with-bashcompletiondir=/bash-completion/completions/

(The "prefix" and "libdir" are already automatically normalized by Autoconf,
this command is testing the others.)

Compared the config.log and resulting trees (in particular man pages) to
confirm double slashes were not present in the latter.

Also tested that a configuration using default options is not affected and that
`make distcheck` still works as expected.

9 years agoman: replace hard-coded /usr/lib
Daniel Mack [Sat, 30 May 2015 00:05:33 +0000 (02:05 +0200)]
man: replace hard-coded /usr/lib

Replace some /usr/lib occurences in man/ with &rootprefix;/lib.

9 years agoMerge pull request #37 from haraldh/boot-options
Kay Sievers [Tue, 2 Jun 2015 14:28:28 +0000 (16:28 +0200)]
Merge pull request #37 from haraldh/boot-options

90-loaderentry.install: fixup BOOT_OPTIONS

9 years ago90-loaderentry.install: fixup BOOT_OPTIONS
Harald Hoyer [Mon, 1 Jun 2015 09:28:03 +0000 (11:28 +0200)]
90-loaderentry.install: fixup BOOT_OPTIONS

better use "read -r -d '' -a" to read in the array. It handles multiple
lines and missing newline at the EOF.

9 years agoSeparate the % sign from the number
Pablo Lezaeta Reyes [pˈaβ̞lo lˌe̞θaˈeta rˈejɛ] [Tue, 31 Mar 2015 05:47:39 +0000 (02:47 -0300)]
Separate the % sign from the number

In spanish the % sign is supposed to be separated from the number [1 and 2 both in spanish] so I separated the %% that draw the percentage sign from the number.

[1] http://www.fundeu.es/recomendacion/el-se-escribe-separado-de-la-cifra-a-la-que-acompana-802/
[2] http://aplica.rae.es/orweb/cgi-bin/v.cgi?i=QGkHLBzKcEgZrQyD

PD: I know that probably this is not the propper place but I don't know where submit the fix or if I do it right

9 years agorandom-util: guard including sys/auxv.h with the corresponding ifdef check
Michael Olbrich [Tue, 2 Jun 2015 09:07:39 +0000 (11:07 +0200)]
random-util: guard including sys/auxv.h with the corresponding ifdef check

9 years agotest-unit-file: add test for improperly escaped exec string
Daniel Mack [Mon, 1 Jun 2015 16:05:02 +0000 (18:05 +0200)]
test-unit-file: add test for improperly escaped exec string

Add a regression test for the recent breakage of handling improperly
escaped exec strings in unit files.

Code contributed by Martin Pitt:

  https://bugs.freedesktop.org/show_bug.cgi?id=90794

9 years agoload-fragment: use UNESCAPE_RELAX flag to parse exec directives
Daniel Mack [Mon, 1 Jun 2015 15:49:04 +0000 (17:49 +0200)]
load-fragment: use UNESCAPE_RELAX flag to parse exec directives

The cunescape() helper function used to handle unknown escaping sequences
gracefully by copying them over verbatim.

Commit 527b7a42 ("util: rework cunescape(), improve error handling") added
a flag to make that behavior optional, and changed to default to error out
with -EINVAL otherwise.

However, config_parse_exec(), which is used to parse the
Exec{Start,Stop}{Post,Pre,} directives of unit files, was not changed along
with that commit, which means that directives with improperly escaped
command line strings are no longer parsed.

Relevant bugreports include:

  https://bugs.freedesktop.org/show_bug.cgi?id=90794
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=787256

Fix this by passing UNESCAPE_RELAX to config_parse_exec() in order to
restore the original behavior.

9 years agosd-device: ensure update_properties_buf() is a noop on failure
Tom Gundersen [Mon, 1 Jun 2015 14:28:58 +0000 (16:28 +0200)]
sd-device: ensure update_properties_buf() is a noop on failure

Don't clobber the sd_device struct, and don't leak memory when memory allocation fails.

9 years agozsh-completion: fix typo in _bootctl
Daniel Mack [Mon, 1 Jun 2015 10:06:07 +0000 (12:06 +0200)]
zsh-completion: fix typo in _bootctl

The command is 'install', not 'instal'. Fix that typo.

9 years agosd-device: fix invalid property strv pointers
Martin Pitt [Mon, 1 Jun 2015 09:32:39 +0000 (11:32 +0200)]
sd-device: fix invalid property strv pointers

In device_update_properties_bufs(), the strv is built from pointers into the
single nul-terminated buf_nulstr string, to avoid allocating the key=value
strings twice. However, we must not do that while building and
GREEDY_REALLOC0()'ing buf_nulstr, as each time when this actually reallocates
memory the pointers we wrote into buf_strv so far become invalid.

So change the logic to first completely build the new buf_nulstr, and then
iterate over it to pick out the pointers to the individual key=value strings
for properties_strv.

This fixes invalid environment for udev callouts.

9 years agoudev: Bring back persistant storage symlinks for bcache
David Mohr [Mon, 1 Jun 2015 06:10:28 +0000 (08:10 +0200)]
udev: Bring back persistant storage symlinks for bcache

https://bugs.debian.org/787367

9 years agotmpfiles: Fix comment typo
Colin Guthrie [Mon, 1 Jun 2015 08:27:40 +0000 (09:27 +0100)]
tmpfiles: Fix comment typo

9 years agoudevd: open sockets before forking
Tom Gundersen [Sun, 31 May 2015 21:58:39 +0000 (23:58 +0200)]
udevd: open sockets before forking

The communication channels must all be opened before forknig in daemon mode,
or we cannot guarantee that udevadm will work correctly as soon as udevd is
started.

9 years agoudevd: don't allocate sd_event object before fork
Tom Gundersen [Sun, 31 May 2015 21:52:53 +0000 (23:52 +0200)]
udevd: don't allocate sd_event object before fork

In daemon mode we would break sd-event as it cannot work accross different processes.
Simply delay the allocation to after the fork.

9 years agoudevd: don't sanitize fd 0,1,2
Tom Gundersen [Sun, 31 May 2015 20:38:30 +0000 (22:38 +0200)]
udevd: don't sanitize fd 0,1,2

Kay said: 'it is from ancient times, when we started udevd from the
kernel's usermodhelper which had no fd 0,1,2'.

9 years agocore/namespace: Protect /usr instead of /home with ProtectSystem=yes
Jason Pleau [Sun, 31 May 2015 16:51:17 +0000 (12:51 -0400)]
core/namespace: Protect /usr instead of /home with ProtectSystem=yes

A small typo in ee818b8 caused /home to be put in read-only instead of
/usr when ProtectSystem was enabled (ie: not set to "no").

9 years agoconf-parser: parsing error logs should show a type not a vartype
Ronny Chevalier [Sat, 30 May 2015 10:21:26 +0000 (12:21 +0200)]
conf-parser: parsing error logs should show a type not a vartype

Instead of this:
[filename:1] Failed to parse nsec_t value, ignoring: garbage

we show this:
[filename:1] Failed to parse nsec value, ignoring: garbage

9 years agonetworkctl: fix uninitialized variable
Ronny Chevalier [Sat, 30 May 2015 08:51:41 +0000 (10:51 +0200)]
networkctl: fix uninitialized variable

We ignore the return value of sd_device_get_devtype, then devtype could
be uninitialized when used with streq_ptr. So we need to initialize it
first.

9 years agoREADME: fix typo
Ronny Chevalier [Sat, 30 May 2015 08:31:41 +0000 (10:31 +0200)]
README: fix typo

9 years agozsh-completion: update bootctl
Ronny Chevalier [Sun, 24 May 2015 11:25:52 +0000 (13:25 +0200)]
zsh-completion: update bootctl

9 years agotest-fdset: add more tests
Ronny Chevalier [Sat, 23 May 2015 16:51:38 +0000 (18:51 +0200)]
test-fdset: add more tests

add tests for the following functions:
- fdset_new_array
- fdset_steal_first
- fdset_isempty

9 years agotests: add test-conf-parser
Ronny Chevalier [Sat, 23 May 2015 16:32:57 +0000 (18:32 +0200)]
tests: add test-conf-parser

9 years agorules: restore block watch after CHANGE events
Tom Gundersen [Fri, 29 May 2015 18:55:39 +0000 (20:55 +0200)]
rules: restore block watch after CHANGE events

When processing an event, the watch is disabled, make sure it is restorted after
a CHANGE event has been processed.

9 years agorules: fix typo in block watch rule
Tom Gundersen [Fri, 29 May 2015 17:59:24 +0000 (19:59 +0200)]
rules: fix typo in block watch rule

The intention was to turn this rule from using a blacklist to a whitelist, but
there was a stray '!'.

9 years agoRevert "Makefile: make custom-entities.ent depend on Makefile.am"
Daniel Mack [Fri, 29 May 2015 22:59:22 +0000 (00:59 +0200)]
Revert "Makefile: make custom-entities.ent depend on Makefile.am"

This reverts commit 6096d9cc. As discussed on the mailing list, we
should accept some formal incorrectness in the dependency here, and
not rebuild the man pages every time Makefile.am changes - xsltproc
is simply too expensive.

Instead, let's move man/custom-entities.ent from DISTCLEANFILES to
CLEANFILES, so a 'make clean' is sufficient to actually make changes
in Makefile.am efficient for the contents of the man pages.

9 years agoterminal: fix include ordering
Thomas Hindoe Paaboel Andersen [Fri, 29 May 2015 22:01:18 +0000 (00:01 +0200)]
terminal: fix include ordering

9 years agoconsole: use signal-util.h and reorder includes
Thomas Hindoe Paaboel Andersen [Fri, 29 May 2015 19:11:30 +0000 (21:11 +0200)]
console: use signal-util.h and reorder includes

Missed this one from the previous commit

9 years agoterminal: use signal-util.h and reorder includes
Thomas Hindoe Paaboel Andersen [Fri, 29 May 2015 18:50:37 +0000 (20:50 +0200)]
terminal: use signal-util.h and reorder includes

9 years agoutil: split out signal-util.[ch] from util.[ch]
Lennart Poettering [Fri, 29 May 2015 18:14:11 +0000 (20:14 +0200)]
util: split out signal-util.[ch] from util.[ch]

No functional changes.

9 years agoCODING_STYLE: document order in which to #include headers
Lennart Poettering [Fri, 29 May 2015 18:12:17 +0000 (20:12 +0200)]
CODING_STYLE: document order in which to #include headers

9 years agoudevd: hook up watchdog support
Tom Gundersen [Fri, 29 May 2015 16:41:26 +0000 (18:41 +0200)]
udevd: hook up watchdog support

We are already sending watchdog notification, this tells PID1 to actually listen for
them and restart udevd in case it gets stuck.

9 years agoudevd: notify - expose a bit more of the internal state
Tom Gundersen [Fri, 29 May 2015 16:38:44 +0000 (18:38 +0200)]
udevd: notify - expose a bit more of the internal state

This notifies PID1 about config being flushed, about shutdown starting and shutdown finalizing.

9 years agoudevd: notify - keep NOTIFY_SOCKET around
Tom Gundersen [Fri, 29 May 2015 16:32:15 +0000 (18:32 +0200)]
udevd: notify - keep NOTIFY_SOCKET around

Only unset the env var in the workers, but otherwise keep it around in the main daemon.

9 years agoudevd: modernize status notification
Tom Gundersen [Fri, 29 May 2015 16:31:01 +0000 (18:31 +0200)]
udevd: modernize status notification

Only log about starting in daemon mode, rely on PID1 to log this in notify mode. Also
explicitly set the STATUS variable, as is done in notify mode as is done for other
serivecs.

9 years agoudevd: event - port spawn_wait() to sd-event
Tom Gundersen [Fri, 15 May 2015 09:35:15 +0000 (11:35 +0200)]
udevd: event - port spawn_wait() to sd-event

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 spawend processes at 'warning' level, and timeouts
are in terms of CLOCK_BOOTTIME when available, otherwise the behavior
is unchanged.

9 years agoudevd: move main-loop to sd-event
Tom Gundersen [Mon, 18 May 2015 15:22:36 +0000 (17:22 +0200)]
udevd: move main-loop to sd-event

9 years agoudevd: explicitly try to start event queue when it may be possible
Tom Gundersen [Mon, 18 May 2015 15:06:00 +0000 (17:06 +0200)]
udevd: explicitly try to start event queue when it may be possible

Rather than trying to schedule new events on every main-loop iteration, do it explicitly when
processing an event finishes, a worker is killed, a new uevent is received, or the event queue
is explicitly restarted.

9 years agoudevd: only check for changed config before scheduling new events
Tom Gundersen [Mon, 18 May 2015 14:25:22 +0000 (16:25 +0200)]
udevd: only check for changed config before scheduling new events

Also move builtin and rules initialization from main loop to
event_queue_start().

No functional change.

9 years agoudevd: introduce manager_exit() and manager_reload()
Tom Gundersen [Wed, 13 May 2015 09:26:32 +0000 (11:26 +0200)]
udevd: introduce manager_exit() and manager_reload()

The behavior is mostly unchanged, but rather than only ever calling these functions at
fixed points in the event loop, they are called directly whenever they are invoked.

9 years agopath-util: Change path_is_mount_point() symlink arg from bool to flags
Martin Pitt [Fri, 29 May 2015 15:13:12 +0000 (17:13 +0200)]
path-util: Change path_is_mount_point() symlink arg from bool to flags

This makes path_is_mount_point() consistent with fd_is_mount_point() wrt.
flags.

9 years agopath-util: Fix path_is_mount_point for files
Martin Pitt [Wed, 27 May 2015 07:56:03 +0000 (09:56 +0200)]
path-util: Fix path_is_mount_point for files

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 behave like openat(): It now takes a file
descriptor of the containing directory, a file name in it, and flags (which can
be 0 or AT_SYMLINK_FOLLOW). Unlike name_to_handle_at() or openat(), fstatat()
only accepts the inverse flag AT_SYMLINK_NOFOLLOW and complains with EINVAL
about AT_SYMLINK_FOLLOW; so we need to transform the flags for that fallback.

Adjust rm_rf_children() accordingly (only other caller of fd_is_mount_point()
aside from path_is_mount_point()).

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.

9 years agozsh-completion: a more style/tag aware _systemctl
Eric Cook [Fri, 29 May 2015 14:40:11 +0000 (10:40 -0400)]
zsh-completion: a more style/tag aware _systemctl

using _wanted instead of calling compadd directly. this allows the user to customize
possible matches.

An example being, grouping units by type:
autoload -Uz compinit; compinit
zstyle ':completion:*' menu select
zstyle ':completion:*' group-name ''
zstyle ':completion:*' format 'Completing %d'
zstyle -e ':completion:*:*:systemctl-(((re|)en|dis)able|(*re|)start|reload*):*' \
tag-order 'local type; for type in service template target socket;
    reply+=( systemd-units:-${type}:${type} ); reply=( "$reply systemd-units:-misc:misc" )'
zstyle ':completion:*:systemd-units-template' ignored-patterns '^*@'
zstyle ':completion:*:systemd-units-target' ignored-patterns '^*.target'
zstyle ':completion:*:systemd-units-socket' ignored-patterns '^*.socket'
zstyle ':completion:*:systemd-units-service' ignored-patterns '^*.service'
zstyle ':completion:*:systemd-units-misc' ignored-patterns '*(@|.(service|socket|target))'

also, <poke> http://lists.freedesktop.org/archives/systemd-devel/2015-May/032012.html

9 years agobuild-sys: pass originally configured --enable-split-usr to distcheck
Martin Pitt [Fri, 29 May 2015 05:39:53 +0000 (07:39 +0200)]
build-sys: pass originally configured --enable-split-usr to distcheck

Previously we always ran distcheck with --disable-split-usr. This caused
test-path-util to fail with

  Assertion 'fsck_exists("minix") == 0' failed at ../src/test/test-path-util.c:224, function test_fsck_exists(). Aborting.

as looking up fsck.minix would only look into DEFAULT_PATH_NORMAL, but on these
systems fsck is in /sbin/.

9 years agobuild-sys: fix typo
Karel Zak [Fri, 29 May 2015 11:42:35 +0000 (13:42 +0200)]
build-sys: fix typo

There is nothing like systemd_verify_* in Makefile.am. The bug has
been invisible because automake uses the default CFLAGS when component
CFLAGS are undefined.

9 years agobuild-sys: Stop depending on current configure options for EXTRA_DIST
Martin Pitt [Thu, 28 May 2015 10:03:17 +0000 (12:03 +0200)]
build-sys: Stop depending on current configure options for EXTRA_DIST

Consistently move EXTRA_DIST out of conditional blocks. This would have
produced incomplete dist tarballs when being run in a built tree with not
every feature enabled, which can cause broken dist tarballs.

9 years agoMakefile: make custom-entities.ent depend on Makefile.am
Daniel Mack [Fri, 29 May 2015 10:00:58 +0000 (12:00 +0200)]
Makefile: make custom-entities.ent depend on Makefile.am

When Makefile.am is modified, make sure custom-entities.ent is rebuilt.
After all, $(substitutions) is defined there, so changes of that variable
must be reflected in the resulting file.

9 years agosystemctl: Don't skip SysV init.d scripts when enabling/disabling units
Martin Pitt [Wed, 27 May 2015 12:52:17 +0000 (14:52 +0200)]
systemctl: Don't skip SysV init.d scripts when enabling/disabling units

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
systemd unit. This keeps the enablement status in sync so that switching init
systems behaves as expected.

9 years agosystemctl: drop hardcoded chkconfig invocation
Martin Pitt [Wed, 27 May 2015 15:04:49 +0000 (17:04 +0200)]
systemctl: drop hardcoded chkconfig invocation

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

Ship systemd-sysv-install.SKELETON as an example for packagers how to implement
this.

Drop the --enable-chkconfig configure option.

Document this in README and point to it in NEWS.

9 years agoman: use configured path for mount and umount binaries in manpages
Filipe Brandenburger [Wed, 27 May 2015 09:38:20 +0000 (02:38 -0700)]
man: use configured path for mount and umount binaries in manpages

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.

9 years agoman: generate configured paths in manpages
Filipe Brandenburger [Wed, 27 May 2015 09:38:19 +0000 (02:38 -0700)]
man: generate configured paths in manpages

In particular, use /lib/systemd instead of /usr/lib/systemd in distributions
like Debian which still have not adopted a /usr merge setup.

Use XML entities from man/custom-entities.ent to replace configured paths while
doing XSLT processing of the original XML files. There was precedent of some
files (such as systemd.generator.xml) which were already using this approach.

This addresses most of the (manual) fixes from this patch:
http://anonscm.debian.org/cgit/pkg-systemd/systemd.git/tree/debian/patches/Fix-paths-in-man-pages.patch?h=experimental-220

The idea of using generic XML entities was presented here:
http://lists.freedesktop.org/archives/systemd-devel/2015-May/032240.html

This patch solves almost all the issues, with the exception of:
- Path to /bin/mount and /bin/umount.
- Generic statements about preference of /lib over /etc.

These will be handled separately by follow up patches.

Tested:
- With default configure settings, ran "make install" to two separate
  directories and compared the output to confirm they matched exactly.
- Used a set of configure flags including $CONFFLAGS from Debian:
  http://anonscm.debian.org/cgit/pkg-systemd/systemd.git/tree/debian/rules
  Installed the tree and confirmed the paths use /lib/systemd instead of
  /usr/lib/systemd and that no other unexpected differences exist.
- Confirmed that `make distcheck` still passes.

9 years agosd-device: enumerator - fix matching on properties and sysattrs
Tom Gundersen [Thu, 28 May 2015 15:18:33 +0000 (17:18 +0200)]
sd-device: enumerator - fix matching on properties and sysattrs

This was a regression that broke

  $ udevadm trigger -nv --property-match=DEVNAME=/dev/sda1 --attr-match=size=409600

Reported by David Reisner.

9 years agoman: fix systemd.resource-control(5) volume number
Patrick Donnelly [Wed, 27 May 2015 19:47:02 +0000 (15:47 -0400)]
man: fix systemd.resource-control(5) volume number

9 years agofix extraneous space in equality check
Jonathan Boulle [Wed, 27 May 2015 19:02:24 +0000 (12:02 -0700)]
fix extraneous space in equality check

9 years agosd-device: fix device_get_properties_strv()
Tom Gundersen [Wed, 27 May 2015 21:26:39 +0000 (23:26 +0200)]
sd-device: fix device_get_properties_strv()

A NULL pointer was inserted as the first element of the strv.

This had the effect of always passing the empty environment to processes
spawned by udev.

Reported by Michał Bartoszkiewicz.

9 years agoudevd: fix SIGCHLD handling in --daemon mode
Tom Gundersen [Wed, 27 May 2015 16:39:36 +0000 (18:39 +0200)]
udevd: fix SIGCHLD handling in --daemon mode

We were listening for SIGCHLD in the wrong process.

9 years agomissing: add more IFLA_VXLAN_* defines
Michael Olbrich [Tue, 26 May 2015 05:48:48 +0000 (07:48 +0200)]
missing: add more IFLA_VXLAN_* defines

Otherwise building faild with kernel headers < v3.16

9 years agologind: prefix some calls to unlink with (void)
Daniel Mack [Wed, 27 May 2015 13:20:58 +0000 (15:20 +0200)]
logind: prefix some calls to unlink with (void)

Make Coverity happy and tell it we're not interested in the return
value of these two calls.

9 years agologind: unlink /run/nologin when shutdown is cancelled
Daniel Mack [Tue, 26 May 2015 16:56:40 +0000 (18:56 +0200)]
logind: unlink /run/nologin when shutdown is cancelled

When a scheduled is cancelled, make sure to remove /run/nologin.
This is a regression from the recent shutdownd removal and logind rework.

9 years agotreewide: fix typos
Torstein Husebø [Tue, 26 May 2015 17:17:30 +0000 (19:17 +0200)]
treewide: fix typos

9 years agoudev: fix inotify handling
David Herrmann [Tue, 26 May 2015 11:03:15 +0000 (13:03 +0200)]
udev: fix inotify handling

This partly reverts:

    commit 6d1b1e0bc6bd020218afc5f05286bf372be283d5
    Author: Tom Gundersen <teg@jklm.no>
    Date:   Sun May 24 15:10:04 2015 +0200

        udevd: worker - fully clean up unnecessary fds

The inotify-fd _is_ used in the workers, so don't close it! Have a look at
udev-watch.c, which keeps track of the inotify-fd as a global variable
(ugh!).

9 years agomissing: add more IFLA_VXLAN_* defines
Michael Olbrich [Tue, 26 May 2015 05:48:48 +0000 (07:48 +0200)]
missing: add more IFLA_VXLAN_* defines

Otherwise building faild with kernel headers < v3.16

9 years agobuild-sys: ship fsck mock in tarball
Martin Pitt [Tue, 26 May 2015 05:16:00 +0000 (07:16 +0200)]
build-sys: ship fsck mock in tarball

Useful for downstream integration test cases.

9 years agotest: hostname - test that hostname is truly initialized
Tom Gundersen [Mon, 25 May 2015 21:10:26 +0000 (23:10 +0200)]
test: hostname - test that hostname is truly initialized

Fixes CID CID 1299638 (use after free).

9 years agonspawn: fix memleak
Tom Gundersen [Mon, 25 May 2015 21:01:45 +0000 (23:01 +0200)]
nspawn: fix memleak

This was a typo, swapping prefix_root() in place of prefix_roota().

Fixes CID 1299640.

9 years agonspawn: avoid memleak
Tom Gundersen [Mon, 25 May 2015 20:55:52 +0000 (22:55 +0200)]
nspawn: avoid memleak

Simplify the code a bit, at the cost of potentially duplicating some
memory unneccessarily.

Fixes CID 1299641.

9 years agonspawn: drop some debugging code
Tom Gundersen [Mon, 25 May 2015 20:49:14 +0000 (22:49 +0200)]
nspawn: drop some debugging code

These have no effect.

Fixes CID 1299643.

9 years agoimport: dkr - avoid NULL-pointer dereference
Tom Gundersen [Mon, 25 May 2015 20:47:42 +0000 (22:47 +0200)]
import: dkr - avoid NULL-pointer dereference

A malformed manifest could in principle cause a NULL pointer dereference of. Check
for this and fail early.

Fixes CID 1299642.

9 years agonspawn: make coverity happy
Tom Gundersen [Mon, 25 May 2015 20:27:14 +0000 (22:27 +0200)]
nspawn: make coverity happy

Rather than checking the return of asprintf() we are checking if buf gets allocated,
make it clear that it is ok to ignore the return value.

Fixes CID 1299644.

9 years agonetworkd: fix IFF_UP when ipv6 support is disabled
Tom Gundersen [Mon, 25 May 2015 15:34:47 +0000 (17:34 +0200)]
networkd: fix IFF_UP when ipv6 support is disabled

Passing ipv6 options (even when they should be noops) caused IFF_UP to fail when
ipv6 was supported.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=90103

9 years agoswap: use swapon -o
Karel Zak [Mon, 25 May 2015 10:11:23 +0000 (12:11 +0200)]
swap: use swapon -o

This patch simplify swapon usage in systemd. The command swapon(8)
since util-linux v2.26 supports "-o <list>". The idea is exactly the
same like for mount(8). The -o specifies options in fstab-compatible
way. For systemd it means that it does not have to care about things
like "discard" or another swapon specific options.

        swapon -o <options-from-fstab>

For backward compatibility the code cares about "Priority:" swap unit
field (for a case when Priority: is set, but pri= in the Options: is
missing).

References: http://lists.freedesktop.org/archives/systemd-devel/2014-October/023576.html

9 years agobuild-sys: fix headers installation
Marc-Antoine Perennou [Mon, 25 May 2015 11:35:14 +0000 (13:35 +0200)]
build-sys: fix headers installation

9 years agobuild-sys: don't dist generated files
Marc-Antoine Perennou [Mon, 25 May 2015 09:18:18 +0000 (11:18 +0200)]
build-sys: don't dist generated files

[tomegun: fix
   Makefile.am:5675: warning: nodist_systemd_resolved_SOURCES multiply defined in condition ENABLE_RESOLVED]

9 years agobuild-sys: always include src/boot/efi in tarballs
Marc-Antoine Perennou [Mon, 25 May 2015 09:18:17 +0000 (11:18 +0200)]
build-sys: always include src/boot/efi in tarballs

currently it would only be included if configure was ran with --enable-gnuefi

9 years agoshared: generator - correct path to systemd-fsck
Mike Gilbert [Sun, 24 May 2015 20:33:35 +0000 (16:33 -0400)]
shared: generator - correct path to systemd-fsck

In generated systemd-fsck-root.service. This would break if rootprefix
is not /usr/lib/systemd.

[tomegun: flesh out commit message]

9 years agonspawn: be verbose about interface names
Umut Tezduyar Lindskog [Fri, 22 May 2015 14:02:09 +0000 (16:02 +0200)]
nspawn: be verbose about interface names

Allowed interface name is relatively small. Lets not make
users go in to the source code to figure out what happened.

--machine=debian-tree conflicts with
--machine=debian-tree2

ex: Failed to add new veth \
         interfaces (host0, vb-debian-tree): File exists

9 years agoudevd: event - fix event queue in daemenozied mode
Tom Gundersen [Sun, 24 May 2015 13:20:36 +0000 (15:20 +0200)]
udevd: event - fix event queue in daemenozied mode

We would enforce that events could only be added to the queue from the
main process, but that brake in daemonized mode. Relax the restriction
to only allow one process to add events to the queue.

Reported by Mantas Mikulėnas.

9 years agoudevd: worker - modernize a bit
Tom Gundersen [Sun, 24 May 2015 13:14:43 +0000 (15:14 +0200)]
udevd: worker - modernize a bit

Initialize structs when declaring rather than using memzero().

9 years agoudevd: worker - fully clean up unnecessary fds
Tom Gundersen [Sun, 24 May 2015 13:10:04 +0000 (15:10 +0200)]
udevd: worker - fully clean up unnecessary fds

These are only ever used in the parent process, so close them early in the worker.

9 years agobootctl: fix an error check
Thomas Hindoe Paaboel Andersen [Sat, 23 May 2015 11:02:56 +0000 (13:02 +0200)]
bootctl: fix an error check

9 years agofix typos in systemd-nspawn man page
Jonathan Boulle [Sat, 23 May 2015 03:11:01 +0000 (20:11 -0700)]
fix typos in systemd-nspawn man page

9 years agobootctl: ferror must be called before FILE is closed
Thomas Hindoe Paaboel Andersen [Fri, 22 May 2015 21:40:19 +0000 (23:40 +0200)]
bootctl: ferror must be called before FILE is closed

Otherwise it will not show any error stored

9 years agoudev/net_id: Only read the first 64 bytes of PCI config space
Jason S. McMullan [Fri, 22 May 2015 18:30:01 +0000 (20:30 +0200)]
udev/net_id: Only read the first 64 bytes of PCI config space

The original code used fread(), which on some libc implementions
(ie glibc 2.17) would pre-read a full 4K (PAGE_SIZE) of the
PCI config space, when only 64 bytes were requested.

I have recently come across PCIe hardware which responds with
Completion Timeouts when accesses above 256 bytes are attempted.

This can cause server systems with GHES/AEPI support to cause
and immediate kernel panic due to the failed PCI transaction.

This change replaces the buffered fread() with an explict
unbuffered read() of 64 bytes, which corrects this issue by
only reading the guaranteed first 64 bytes of PCIe config space.

9 years agosd-bus,sd-event: make public APIs
Lennart Poettering [Fri, 22 May 2015 12:32:51 +0000 (14:32 +0200)]
sd-bus,sd-event: make public APIs

With the v221 release these APIs should be public, stable APIs, hence
let's install their headers by default now, and add their symbols to the
.sym file.

9 years agoNEWS: fix date
Lennart Poettering [Thu, 21 May 2015 23:37:16 +0000 (01:37 +0200)]
NEWS: fix date

Ah, bummer, it's tagged an now I realize I didn't fix the date. Let's do
so now, post-commit.

9 years agojson: minor style fixes v220
Lennart Poettering [Thu, 21 May 2015 21:30:37 +0000 (23:30 +0200)]
json: minor style fixes

9 years agotest.json: fix build on x86-32 where int and intmax_t differ
Lennart Poettering [Thu, 21 May 2015 21:25:57 +0000 (23:25 +0200)]
test.json: fix build on x86-32 where int and intmax_t differ

9 years agoupdate hardware databases
Lennart Poettering [Thu, 21 May 2015 20:04:30 +0000 (22:04 +0200)]
update hardware databases

9 years agobuild-sys: fix build with seperate builddir
Lennart Poettering [Thu, 21 May 2015 19:54:53 +0000 (21:54 +0200)]
build-sys: fix build with seperate builddir

Let's make sure we can build rpms with this

9 years agomanager: fix finish_timestamp calculation
Lennart Poettering [Thu, 21 May 2015 19:34:36 +0000 (21:34 +0200)]
manager: fix finish_timestamp calculation

http://lists.freedesktop.org/archives/systemd-devel/2015-May/032100.html

9 years agoupdate TODO
Lennart Poettering [Thu, 21 May 2015 19:31:23 +0000 (21:31 +0200)]
update TODO

9 years agobus-proxy: fix GetConnectionSELinuxSecurityContext() return value
Lennart Poettering [Thu, 21 May 2015 19:24:55 +0000 (21:24 +0200)]
bus-proxy: fix GetConnectionSELinuxSecurityContext() return value

9 years agonspawn: prohibit access to the kernel log buffer by default
Lennart Poettering [Thu, 21 May 2015 18:48:39 +0000 (20:48 +0200)]
nspawn: prohibit access to the kernel log buffer by default

Unless CAP_SYSLOG is explicitly passed block all access to kmg