Commit graph

15391 commits

Author SHA1 Message Date
Kay Sievers d2edfae0f9 build-sys: use glibc's xattr support instead of requiring libattr 2014-05-28 17:36:40 +08:00
Lennart Poettering c9679c652b NEWS: mention that we need a new user systemd-timesync 2014-05-28 09:43:43 +08:00
Lennart Poettering 8e7acf67b2 NEWS: update NEWS file according to most recent changes in git 2014-05-28 09:39:55 +08:00
Stef Walter c779a44222 hostnamed: Fix the way that static and transient host names interact
It is almost always incorrect to allow DHCP or other sources of
transient host names to override an explicitly configured static host
name.

This commit changes things so that if a static host name is set, this
will override the transient host name (eg: provided via DHCP). Transient
host names can still be used to provide host names for machines that have
not been explicitly configured with a static host name.

The exception to this rule is if the static host name is set to
"localhost". In those cases we act as if no
static host name has been explicitly set.

As discussed elsewhere, systemd may want to have an fd based ownership
of the transient name. That part is not included in this commit.
2014-05-28 09:34:37 +08:00
Lennart Poettering 76d4bef384 build-sys: bump package and library version 2014-05-27 19:02:22 +08:00
Tom Gundersen 4eb20caa4d test-dhcp-option: fix memleak 2014-05-26 21:31:57 +02:00
Thomas Bächler 1f89214e6e analyze/run: use bus_open_transport_systemd instead of bus_open_transport
Both systemd-analyze and systemd-run only access org.freedesktop.systemd1
on the bus. This patch allows using systemd-run --user and systemd-analyze
--user even if the user session's bus is not properly integrated with the
systemd user unit.

https://bugs.freedesktop.org/show_bug.cgi?id=79252 and other reports...
2014-05-26 14:21:53 -04:00
Michal Sekletar 000f6e5667 Do not unescape unit names in [Install] section
https://bugs.freedesktop.org/show_bug.cgi?id=49316
2014-05-26 20:12:19 +02:00
Kay Sievers 49804365ea udev: keyboard - also hook into "change" events
Re-apply the keymaps when "udevadm trigger" is called. Hooking into
"add" only would just remove all keymap content from the udev database
instead of applying the new config.
2014-05-26 09:30:21 +08:00
Martin Pitt e55edb22a7 keymap: Asus EeePC touchpad toggle key
Originally is KEY_TOUCHPAD_TOGGLE, but X.org can't handle the big key events,
so use the F21 convention.

https://bugs.freedesktop.org/show_bug.cgi?id=72807
2014-05-25 12:16:35 +02:00
Martin Pitt d258d4967e keymap: Add Lenovo Enhanced USB Keyboard
https://bugs.freedesktop.org/show_bug.cgi?id=77234
2014-05-25 11:58:40 +02:00
Kay Sievers 4d40d39cdf timesysnc: reword network watching messages, and move resolver errors to debug 2014-05-25 13:46:43 +08:00
Djalal Harouni e866af3acc nspawn: make nspawn robust to container failure
nspawn and the container child use eventfd to wait and notify each other
that they are ready so the container setup can be completed.

However in its current form the wait/notify event ignore errors that
may especially affect the child (container).

On errors the child will jump to the "child_fail" label and terminate
with _exit(EXIT_FAILURE) without notifying the parent. Since the eventfd
is created without the "EFD_NONBLOCK" flag, this leaves the parent
blocking on the eventfd_read() call. The container can also be killed
at any moment before execv() and the parent will not receive
notifications.

We can fix this by using cheap mechanisms, the new high level eventfd
API and handle SIGCHLD signals:

* Keep the cheap eventfd and EFD_NONBLOCK flag.

* Introduce eventfd states for parent and child to sync.
Child notifies parent with EVENTFD_CHILD_SUCCEEDED on success or
EVENTFD_CHILD_FAILED on failure and before _exit(). This prevents the
parent from waiting on an event that will never come.

* If the child is killed before execv() or before notifying the parent,
we install a NOP handler for SIGCHLD which will interrupt blocking calls
with EINTR. This gives a chance to the parent to call wait() and
terminate in main().

* If there are no errors, parent will block SIGCHLD, restore default
handler and notify child which will do execv(), then parent will pass
control to process_pty() to do its magic.

This was exposed in part by:
https://bugs.freedesktop.org/show_bug.cgi?id=76193

Reported-by: Tobias Hunger tobias.hunger@gmail.com
2014-05-25 11:23:35 +08:00
Djalal Harouni 113cea802d nspawn: move container wait logic into wait_for_container()
Move the container wait logic into its own wait_for_container() function
and add two status codes: CONTAINER_TERMINATED or CONTAINER_REBOOTED.
The status will be stored in its argument, this way we handle:
a) Return negative on failures.
b) Return zero on success and set the status to either
   CONTAINER_REBOOTED or CONTAINER_TERMINATED.

These status codes are used to terminate nspawn or loop again in case of
CONTAINER_REBOOTED.
2014-05-25 11:23:30 +08:00
Tanu Kaskinen 6b56a65123 test-path-util: add tests for path_make_relative() 2014-05-25 11:21:24 +08:00
Tanu Kaskinen 5216f599ff path-util: fix missing terminating zero
There was this code:

        if (to_path_len > 0)
                memcpy(p, to_path, to_path_len);

That didn't add the terminating zero, so the resulting string was
corrupt if this code path was taken.

Using strcpy() instead of memcpy() solves this issue, and also
simplifies the code.

Previously there was special handling for shortening "../../" to
"../..", but that has now been replaced by a path_kill_slashes() call,
which also makes the result prettier in case the input contains
redundant slashes that would otherwise be copied to the result.
2014-05-25 11:21:19 +08:00
Cristian Rodríguez 590b6b9188 Use %m instead of strerror(errno) where appropiate 2014-05-25 11:18:28 +08:00
Cristian Rodríguez 552c693eea test-unit-file: skip if unit_file_get_list returns permission denied 2014-05-25 11:17:01 +08:00
Jonathan Boulle 865cc19a34 Fix several small typos 2014-05-24 19:01:03 -04:00
Zbigniew Jędrzejewski-Szmek 623538c312 man: describe sd_uid_get_display 2014-05-24 18:50:21 -04:00
Zbigniew Jędrzejewski-Szmek 499b604b21 NEWS: mention that systemd-analyze uses new kernel release info
Also some small grammar updates.
2014-05-24 18:50:21 -04:00
Zbigniew Jędrzejewski-Szmek 49e5c2b26a build-sys: fix typo in variable name 2014-05-24 18:50:21 -04:00
Zbigniew Jędrzejewski-Szmek b9acccb3c9 man: reword StartupCPUShares= description
Now that we have two options described in the same paragraph, we cannot
use singular anymore.
2014-05-24 18:50:21 -04:00
Tom Gundersen 68dd0956ef NEWS 2014-05-24 12:28:47 +02:00
Kay Sievers 69beda1f75 NEWS: update 2014-05-24 14:50:58 +08:00
Reyad Attiyat f31faa119f detect-virt: Remove string for Microsoft virtualization detection in DMI vendor string array.
The string "Microsoft Corporation" is used in the Surface Tablet's DMI vendor ID.

https://bugs.freedesktop.org/show_bug.cgi?id=78312
2014-05-24 14:39:34 +08:00
Lennart Poettering 6936cd8926 NEWS: prepare NEWS update for 213 2014-05-24 14:26:59 +08:00
Kay Sievers 359efc59fd core: timer - switch to touch_file() 2014-05-24 11:39:47 +08:00
Kay Sievers 82d115d9ab timedated: refuse manual system time updates when automatic timesync is enabled 2014-05-24 10:45:44 +08:00
Kay Sievers 609896125c clock-util: clock_[sg]et_time() -> clock_[sg]et_hwclock() 2014-05-24 10:26:33 +08:00
Kay Sievers d636d37679 timesyncd: only update stamp file when we are synchronized
Create initial stamp file with compiled-in time to prevent bootups
with clocks in the future from storing invalid timestamps.

At shutdown, only update the timestamp if we got an authoritative
time to store.
2014-05-24 08:04:56 +08:00
Kay Sievers c38dfac9ed shared: add touch_file() and let touch() always update timestamp 2014-05-24 07:21:11 +08:00
Kay Sievers 24efb11245 shared: rename hwclock.[ch] to clock-util.[ch] 2014-05-24 07:56:20 +09:00
Tom Gundersen 68baa8faf3 sd-network: avoid false positive compiler warning caused by LTO
Djalal Harouni <tixxdz@opendz.org>:
There is also this one genrated by LTO, IMO it's a false positive since
we do *check* for "lease" but the code is not consistent since in that
code path, "lease" is initialized to NULL in other places, except for
this one:

src/resolve/resolved-manager.c: In function 'manager_update_resolv_conf':
src/libsystemd-network/sd-dhcp-lease.c:67:18: warning: 'lease' may be used uninitialized in this function [-Wmaybe-uninitialized]
        if (lease->dns_size) {
                 ^
src/network/sd-network.c:146:24: note: 'lease' was declared here
        sd_dhcp_lease *lease;
                       ^
2014-05-24 00:46:30 +02:00
Lennart Poettering 640ace4a8d socket: properly handle if our service vanished during runtime 2014-05-22 16:56:21 +09:00
Lennart Poettering f74df7baa2 core: remove unused vars 2014-05-22 16:52:53 +09:00
Lennart Poettering bcd816bd34 core: never consider failure when reading drop-ins fatal
drop-ins don't carry the main configuration of a unit, hence read them
if we can't, complain if we cannot, but don't fail.
2014-05-22 16:49:12 +09:00
Lennart Poettering 9f43a07f10 conf-parser: never consider it an error if we cannot load a drop-in file because it is missing
After all, we want to be able to boot with /etc empty one day...
2014-05-22 16:48:14 +09:00
Lennart Poettering 0afedd300c man: update URL refernce in daemon(7)
http://lists.freedesktop.org/archives/systemd-devel/2014-May/019410.html
2014-05-22 16:22:48 +09:00
Lennart Poettering c4b834a4ad man: drop reference to file locking for PID file creation from daemon(7)
File locking is usually a bad idea, don't suggest using it.
2014-05-22 16:15:56 +09:00
Lennart Poettering 3de03738fc update TODO 2014-05-22 16:14:50 +09:00
Lennart Poettering cdb2b9d05a nspawn: restore journal directory is empty check
This undoes part of commit e6a4a517be.

Instead of removing the error message about non-empty journal bind mount
directories, simply downgrade the message to a warning and proceed.
2014-05-22 15:21:01 +09:00
Lennart Poettering 97c52b838b update TODO 2014-05-22 12:16:25 +09:00
Lennart Poettering 9a05490933 cgroups: simplify CPUQuota= logic
Only accept cpu quota values in percentages, get rid of period
definition.

It's not clear whether the CFS period controllable per-cgroup even has a
future in the kernel, hence let's simplify all this, hardcode the period
to 100ms and only accept percentage based quota values.
2014-05-22 11:53:12 +09:00
Lennart Poettering 609e002e78 time-util: make sure USEC_PER_SEC and friends are actually of type usec_t 2014-05-22 11:44:03 +09:00
Lennart Poettering 558c6490b1 logind: also escape external data when saving to /run
Better be safe than sorry...
2014-05-22 10:36:16 +09:00
Lennart Poettering eaa3b74dfd update TODO 2014-05-22 10:36:16 +09:00
Lennart Poettering ca5405bb4f machine: escape fields we store in /run, so that they can be properly unescaped by parse_env_file() 2014-05-22 10:36:16 +09:00
Kay Sievers 5052e3996d build-sys: let libsystemd_network pull in libudev-internal.la
On Thu, May 22, 2014 at 9:53 AM, Jan Engelhardt <jengelh@inai.de> wrote:
>
> If libsystemd-network.la is relying on that udev function, it ought
> to specify libudev(-internal).la in libsystemd_network_la_LIBADD.
2014-05-22 10:19:07 +09:00
Djalal Harouni e6a4a517be nspawn: allow to bind mount journal on top of a non empty container journal dentry
Currently if nspawn was called with --link-journal=host or
--link-journal=auto and the right /var/log/journal/machine-id/ exists
then the bind mount the subdirectory into the container might fail due
to the ~/mycontainer/var/log/journal/machine-id/ of the container not
being empty.

There is no reason to check if the container journal subdir is empty
since there will be a bind mount on top of it. The user asked for a bind
mount so give it.

Note: a next call with --link-journal=guest may fail due to the
/var/log/journal/machine-id/ on the host not being empty.

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

Reported-by: Tobias Hunger <tobias.hunger@gmail.com>
2014-05-22 09:55:23 +09:00