Commit Graph

16052 Commits

Author SHA1 Message Date
Dan Dedrick 8775f6d81b switch-root: umount the old root correctly
The unmount occurs after the pivot_root, so the path used to unmount
should take into account the new root directory. This will allow the
umount to actually succeed.

(cherry picked from commit 23f25b1496)
2014-10-03 15:11:52 -04:00
Karel Zak 32798abbc8 bootchart: ask for --rel when failed to initialize graph start time
We always read system uptime before log start time. So the uptime
should be always smaller number, except it includes system suspend
time. It seems better to ask for --rel and exit() than try to be
smart and try to recovery from this situation or generate huge
messy graphs.

(cherry picked from commit 9a6f36c08f)
2014-10-03 15:02:32 -04:00
Karel Zak ee90d6ebe1 bootchart: don't parse /proc/uptime, use CLOCK_BOOTTIME
* systemd-bootchart always parses /proc/uptime, although the
  information is unnecessary when --rel specified

* use /proc/uptime is overkill, since Linux 2.6.39 we have
  clock_gettime(CLOCK_BOOTTIME, ...). The backend on kernel side is
  get_monotonic_boottime() in both cases.

* main() uses "if (graph_start <= 0.0)" to detect that /proc is
  available.

  This is fragile solution as graph_start is always smaller than zero
  on all systems after suspend/resume (e.g. laptops), because in this
  case the system uptime includes suspend time and uptime is always
  greater number than monotonic time. For example right now difference
  between uptime and monotonic time is 37 hours on my laptop.

  Note that main() calls log_uptime() (to parse /proc/uptime) for each
  sample when it believes that /proc is not available. So on my laptop
  systemd-boochars spends all live with /proc/uptime parsing +
  nanosleep(), try

    strace  /usr/lib/systemd/systemd-bootchart

  to see the never ending loop.

  This patch uses access("/proc/vmstat", F_OK) to detect procfs.

(cherry picked from commit c358d728e7)
2014-10-03 15:02:32 -04:00
Zbigniew Jędrzejewski-Szmek 9c5afa4568 build-sys: fix conftest.c to work on arm
All tests for compiler support were failing with:

/usr/bin/ld: /tmp/ccwnVc2A.o: relocation R_ARM_MOVW_ABS_NC against `a' can not be used when making a shared object; recompile with -fPIC

(cherry picked from commit 0943f4b7b2)
2014-10-02 14:49:12 -04:00
Michael Biebl 1b0413ff4f backlight: Avoid error when state restore is disabled
When the state restore is disabled, we would print:
"Unknown verb: load" instead of simply skipping loading the
state.

(cherry picked from commit b76388e123)
2014-09-11 00:57:55 +02:00
Michal Schmidt 4242ef948f timesyncd: don't reset polling interval when reselecting server
Upstream commit:
commit 80cd2606b9
Author: Kay Sievers <kay@vrfy.org>
Date:   Tue Sep 2 14:33:59 2014 +0200

    timesyncd: don't reset polling interval when reselecting server

    Original patch from: Miroslav Lichvar <mlichvar@redhat.com>
2014-09-10 20:35:15 +02:00
Michal Schmidt 8269ab5ca3 timesyncd: allow two missed replies before reselecting server
Upstream commit:
commit e8206972be
Author: Miroslav Lichvar <mlichvar@redhat.com>
Date:   Tue Sep 2 14:29:51 2014 +0200

    timesyncd: allow two missed replies before reselecting server

    After receiving a reply from the server, allow two missed replies before
    switching to another server to avoid unnecessary clock hopping when
    packets are getting lost in the network.

Conflicts:
	src/timesync/timesyncd-manager.c
2014-09-10 20:35:15 +02:00
Michal Schmidt 75d472e1a9 timesyncd: wait before reconnecting to first server
Upstream commit:
commit 63463bf091
Author: Miroslav Lichvar <mlichvar@redhat.com>
Date:   Wed Aug 27 16:47:24 2014 +0200

    timesyncd: wait before reconnecting to first server

    When all servers are exhausted, wait for one poll interval before trying
    to connect again to the first server in the list. Also, keep increasing
    the polling interval to make sure a client not getting any valid replies
    will not send requests to any server more frequently than is allowed by
    the maximum polling interval.

Conflicts:
	src/timesync/timesyncd-manager.c
2014-09-10 20:35:15 +02:00
Michal Schmidt c5b5c6b8cb timesyncd: check root distance
Upstream commit:
commit 3af0442c52
Author: Miroslav Lichvar <mlichvar@redhat.com>
Date:   Wed Aug 27 16:47:20 2014 +0200

    timesyncd: check root distance

    NTPv4 servers don't reply with unsynchronized status when they lost
    synchronization, they only keep increasing the root dispersion and it's
    up to the client to decide at which point they no longer consider it
    synchronized.

    Ignore replies with root distance over 5 seconds.
2014-09-10 20:35:15 +02:00
Michal Schmidt 1cdb867fa0 timesyncd: get kernel timestamp in nanoseconds
Upstream commit:
commit 487a36821e
Author: Miroslav Lichvar <mlichvar@redhat.com>
Date:   Wed Aug 27 16:47:19 2014 +0200

    timesyncd: get kernel timestamp in nanoseconds
2014-09-10 20:35:15 +02:00
Michal Schmidt 355043d3d3 timesyncd: fix calculation of transmit time
Upstream commit:
commit 73c76e6330
Author: Miroslav Lichvar <mlichvar@redhat.com>
Date:   Wed Aug 27 16:47:18 2014 +0200

    timesyncd: fix calculation of transmit time

    The kernel timestamp (recv_time) is made earlier than current time
    (now_ts), use the timestamp captured before sending packet directly.
2014-09-10 20:35:14 +02:00
Michal Schmidt e5ef9861f9 timesyncd: check if stratum is valid
Upstream commit:
commit 07610e108e
Author: Miroslav Lichvar <mlichvar@redhat.com>
Date:   Wed Aug 27 16:47:17 2014 +0200

    timesyncd: check if stratum is valid
2014-09-10 20:35:14 +02:00
Michal Schmidt 908c733f66 timesyncd: always use CLOCK_BOOTTIME if we can
Upstream commit:
commit 6a5c7b7e41
Author: Lennart Poettering <lennart@poettering.net>
Date:   Sun Aug 10 23:40:48 2014 +0200

    timesyncd: always use CLOCK_BOOTTIME if we can

    After all we want to compare a monotonically increasing clock with the
    remote clock, hence we shouldn't ignore system suspend periods.
2014-09-10 20:35:14 +02:00
Michal Schmidt 9ec9316b80 time-util: add clock_boottime_or_monotonic
Upstream commit:
commit 77ff2de999
Author: Tom Gundersen <teg@jklm.no>
Date:   Thu Jul 24 18:36:37 2014 +0200

    time-util: add clock_boottime_or_monotonic

    CLOCK_BOOTTIME is not supported by timerfd on older kernels, so for the time beeing,
    use this helper instead which will fallback to CLOCK_MONOTONIC if CLOCK_BOOTTIME is
    not supported.

Conflicts:
	src/shared/time-util.c
	src/shared/time-util.h
2014-09-10 20:35:14 +02:00
Michal Schmidt df1b5312d9 sd-event: add support for CLOCK_BOOTTIME
Upstream commit:
commit a854881616
Author: Tom Gundersen <teg@jklm.no>
Date:   Thu Jul 24 16:08:07 2014 +0200

    sd-event: add support for CLOCK_BOOTTIME

    This requires a very recent kernel (3.15), so care should be taken
    when using this functionality.
2014-09-10 20:35:14 +02:00
Harald Hoyer acdc59d98a initrd-parse-etc.service: ignore return code of daemon-reload
It seems the return code of systemctl daemon-reload can be !=0 in some
circumstances, which causes a failure of the unit and breaks booting in
the initrd.

(cherry picked from commit f3b8fbb1da)
2014-09-03 13:36:35 +02:00
Harald Hoyer d518b11f10 base_filesystem_create: do not try to create "/root" if it exists
The check, if the directory/file already exists is only executed, if
there is a symlink target specified. In case of "/root", there is none,
so it is unconditionally tried to create the directory.

In case of a readonly filesystem, errno != EEXIST, but errno == EROFS,
so base_filesystem_create() and switch_root does not succeed.

This patch checks for existance not only in the symlink case.

(cherry picked from commit 6f4f8056d3)
2014-09-03 13:36:32 +02:00
Harald Hoyer 9cd8ab8e26 Added arch tuple for PPC64LE
Thanks to Brent Baude <bbaude@redhat.com>, who checked with the debian
guys, that this is correct and provided the patch.
2014-08-09 15:11:10 +02:00
Zbigniew Jędrzejewski-Szmek 62ae78fdcc update-done: set proper selinux context for .updated
https://bugzilla.redhat.com/show_bug.cgi?id=1121806
(cherry picked from commit 7dbb1d08f6)
2014-07-21 22:52:36 -04:00
Zbigniew Jędrzejewski-Szmek ec300fdabb sysusers: fix selinux context of backup files
Also, fix fopen_temporary_label to set proper context. By chance,
all users so far used the same context, so the error didn't matter.

Also, check return value from label_init().

https://bugzilla.redhat.com/show_bug.cgi?id=1121806
(cherry picked from commit 9f1c19405a)
2014-07-21 22:52:36 -04:00
Zbigniew Jędrzejewski-Szmek de92879c4f bash-completion: -p option for journalctl
(cherry picked from commit be8f4a9fa7)
2014-07-21 22:52:35 -04:00
Michael Olbrich 766fa6bb14 install: systemd-timesyncd.service is enabled by sysinit.target
systemd-timesyncd.service has a "WantedBy=sysinit.target" so the
initially generated link should match that.

(cherry picked from commit e9b11a8457)
2014-07-21 22:52:35 -04:00
Jean-André Santoni 9f2dae12f4 Add IFLA_VTI defines to missing.h
(cherry picked from commit 6589d0dba2)
2014-07-21 22:52:35 -04:00
Zbigniew Jędrzejewski-Szmek e8aa845bcf escape: fix return code
(cherry picked from commit 91a81d93b5)
2014-07-19 15:46:47 -04:00
Zbigniew Jędrzejewski-Szmek 51a993c94f core: show timeouts when watchdog howls
(cherry picked from commit a7850c7d13)
2014-07-19 14:34:46 -04:00
Zbigniew Jędrzejewski-Szmek 1d9614d1e6 Be more verbose when bind or listen fails
Also be more verbose in devnode_acl_all().

(cherry picked from commit 6b9732b2bf)
2014-07-19 14:34:46 -04:00
Zbigniew Jędrzejewski-Szmek 634a6893ab man,journal: add note about sd_journal_get_cutoff_monotonic_usec return value
Also modify the function itself to be a bit simpler to read.

(cherry picked from commit 1651e2c61e)
2014-07-19 14:34:46 -04:00
Thomas Blume 4b41b0d24b systemd-detect-virt: detect s390 virtualization
A system that is running on a logical partition (LPAR) provided by
PR/SM has access to physical hardware (except CPU). It is true that
PR/SM abstracts the hardware, but only for sharing purposes.

Details are statet at:

http://publib.boulder.ibm.com/infocenter/eserver/v1r2/topic/eicaz/eicazzlpar.htm

-->--
In other words, PR/SM transforms physical resources into virtual resources so
that many logical partitions can share the same physical resources.
--<--

Still, from the OS point of view, the shared virtual resource is real
hardware. ConditionVirtualization must be set to false if the OS runs
directly on PR/SM (e.g. in an LPAR).

[zj: reorder code so that variables are not allocated when #if-def is
false. Add commit message.]

(cherry picked from commit f41925b4e4)
2014-07-19 14:34:46 -04:00
David Herrmann 918af53be9 journal: reduce test-journal-send timeout from 10s to 1s
The sleep(10) in test-journal-send is quite aggressive. We need it only
for the journal to get our cgroup information. But even that information
is not vital to the test, so a sleep(1) should be just fine.

(cherry picked from commit 037ee337f0)
2014-07-19 14:34:46 -04:00
Thomas Blume be8dbe82ba detect-virt: Fix Xen domU discovery
The conditional for detection xen virtualization contained a little mistake.
It is checking for i to be empty: 'if (!i)  {', but it must check for cap instead,
because: 'cap = strsep(&i, ",")' will set cap to the discovered value and i to
the next value after the separator.
Hence, i would be empty, if there is only control_d in domcap, leading to a wrong
domU detection.

https://bugs.freedesktop.org/show_bug.cgi?id=77271
(cherry picked from commit a71516dfd1)
2014-07-19 14:34:46 -04:00
Zbigniew Jędrzejewski-Szmek fe85271fb6 core: nicer message when inotify watches are exhausted
inotify_add_watch returns ENOSPC, which translates to
"No space left on device", which is misleading.

https://bugs.freedesktop.org/show_bug.cgi?id=73628
(cherry picked from commit 18abe7bd3e)
2014-07-19 14:34:46 -04:00
Zbigniew Jędrzejewski-Szmek 6941ea3fb0 man: document yearly and annually in systemd.time(7)
https://bugs.freedesktop.org/show_bug.cgi?id=81158
(cherry picked from commit 8c275eef38)
2014-07-19 14:34:46 -04:00
Zbigniew Jędrzejewski-Szmek 5a263a7343 missing.h: add IFLA_MACVLAN_FLAGS
Now we are getting into kernel < 3.4 territory...

https://bugs.freedesktop.org/show_bug.cgi?id=80095
(cherry picked from commit 75616a1332)
2014-07-19 14:28:48 -04:00
Sjoerd Simons a6874d3be0 shared: include stdbool.h in mkdir.h
(cherry picked from commit 4e4877d96c)
2014-07-19 14:28:48 -04:00
Michael Biebl c46cee9156 build-sys: don't move libgudev to /lib
It depends on libgobject and libgmodule which are installed in /usr/lib.

(cherry picked from commit 5c059d2ead)
2014-07-19 14:28:48 -04:00
Michael Olbrich 89b958ef6a units/serial-getty@.service: use the default RestartSec
For pluggable ttys such as USB serial devices, the getty is restarted
and exits in a loop until the remove event reaches systemd. Under
certain circumstances the restart loop can overload the system in a
way that prevents the remove event from reaching systemd for a long
time (e.g. at least several minutes on a small embedded system).

Use the default RestartSec to prevent the restart loop from
overloading the system. Serial gettys are interactive units, so
waiting an extra 100ms really doesn't make a difference anyways
compared to the time it takes the user to log in.

(cherry picked from commit 4bf04322b8)
2014-07-19 14:28:48 -04:00
Zbigniew Jędrzejewski-Szmek ae1d412f96 journal: allow files with no data whatsoever
If a file was opened for writing, and then closed immediately without
actually writing any entries, on subsequent opening, it would be
considered "corrupted". This should be totally fine, and even in
read mode, an empty file can become non-empty later on.

(cherry picked from commit b3306e9c3c)
2014-07-19 14:28:48 -04:00
Kay Sievers 4e0d085ff5 rules: uaccess - add ID_SOFTWARE_RADIO
On Tue, Jul 15, 2014 at 1:52 PM, Alick Zhao <alick9188@gmail.com> wrote:
>>>
>>> So maybe ID_SOFTWARE_RADIO ?
>>
>> Hmm, SDR is more a term for a generic technology than for a device
>> class. To me it does not really sound like an administrator would know
>> what this is.
>>
>> What exactly is the device or subsystem you want to make accessible to
>> locally logged-in users only?
>
> Initially it is bladeRF, but many more are of interest: USRP, rtl-sdr,
> HackRF, ... [1]
>
> I agree an administrator might not know what SDR is, since it is
> currently still not widely known, and makes sense only for amateurs
> and researchers. But as a SDR fan, I see many new SDR peripherals
> are created recently, and expect to see more. So a generic ID seems
> reasonable to me.
>
> [1] http://en.wikipedia.org/wiki/List_of_software-defined_radios

(cherry picked from commit 30632d97d9)
2014-07-19 14:28:48 -04:00
Umut Tezduyar Lindskog 5ad9650695 core: fix oneshot service resource control
Oneshot services's cgroup is removed when the service
exits. An assert is hit otherwise.

(cherry picked from commit 285cd771cb)
2014-07-19 14:28:48 -04:00
Zbigniew Jędrzejewski-Szmek 49323e421a shell-completion: restore completion for -p
It was broken since systemd was moved out of /bin.

For zsh it was never there.

(cherry picked from commit c0a67aef31)
2014-07-19 14:28:48 -04:00
Zbigniew Jędrzejewski-Szmek 1e673f08f3 timesyncd: only listen to clock changes when connected
This reverts previous commit and applies a different fix.

manager_clock_watch() callback calls manager_send_request() to kick
off a resync. We can only do that when we're actually connected to
something. It is not useful to setup the callback from manager_new().

Now the callback will be dropped in manager_connect() and requested
in manager_begin().

https://bugs.freedesktop.org/show_bug.cgi?id=80932
(cherry picked from commit c566ee3253)
2014-07-19 14:28:48 -04:00
Kay Sievers 5c34306656 timesyncd: suppress resync at system time change when not connected
Jul 04 17:46:03 orchid systemd[1]: Starting Network Time Synchronization...
Jul 04 17:46:03 orchid systemd[1]: Started Network Time Synchronization.
Jul 04 17:46:22 orchid systemd-timesyncd[301]: System time changed. Resyncing.
Jul 04 17:46:22 orchid systemd-timesyncd[301]: Assertion 'm->current_server_name'

https://bugs.freedesktop.org/show_bug.cgi?id=80932
(cherry picked from commit afc7b1b9c1)
2014-07-19 14:28:48 -04:00
Kay Sievers 9221fcfe48 rules: consistently use "?*" instead of "*?"
(cherry picked from commit 64dfe7b744)
2014-07-19 14:28:48 -04:00
Tom Gundersen f096a48e21 man: systemd.netdev - make it clear that we do not touch preexisting netdevs
We will happily use bridges/bonds as master devices, but we will not change their settings if they were created by
someone else.

(cherry picked from commit 7c1cff4ff7)
2014-07-19 14:28:48 -04:00
Mantas Mikulėnas b91985eca0 fileio: quote more shell characters in envfiles
Turns out, making strings shell-proof is harder than expected:

    # machinectl set-hostname "foo|poweroff" && . /etc/machine-info

(This could be simplified by quoting *and* escaping all characters,
which is harmless in shell but unnecessary.)

(cherry picked from commit 0ce5a80601)
2014-07-19 14:28:47 -04:00
Tanu Kaskinen d8f6518b91 path-lookup: don't make ~/.local/share/systemd/user a symlink
We already encourage upstreams to keep the default configuration
separate from user customizations for software that is installed in
the system location. Let's allow that separation also for software
that is installed in the home directory.

Some discussion:
http://thread.gmane.org/gmane.comp.sysutils.systemd.devel/19627

(cherry picked from commit 667a1cd645)
2014-07-19 14:28:47 -04:00
Tanu Kaskinen 7dd741b242 man: mention XDG_DATA_HOME in systemd.unit
(cherry picked from commit 91acdc17a5)
2014-07-19 14:28:47 -04:00
Sjoerd Simons 508627c15e man: sysusers.d correct default user shell
For the non-root user sysusers uses nologin as the default shell, not
login. Correct the documentation to match the code.

(cherry picked from commit eb34cba763)
2014-07-19 14:28:47 -04:00
Zbigniew Jędrzejewski-Szmek e6751d628b man: add systemd-coredump(8) and a bunch of links
(cherry picked from commit 5146e7e8ae)
2014-07-19 14:28:47 -04:00
Zbigniew Jędrzejewski-Szmek 8aa593f9b9 Add function to open temp files in selinux mode
(cherry picked from commit f7f628b5db)
2014-07-19 14:28:47 -04:00