Commit Graph

19084 Commits

Author SHA1 Message Date
Lennart Poettering 477e75ef9e update TODO 2015-01-28 17:48:01 +01:00
Lennart Poettering f50f01f4b7 sd-dhcp: chop of trailing dot of DHCP supplied host and domain nams 2015-01-28 17:47:37 +01:00
Martin Pitt 3b48ce4ec4 rules: clean up stale CD drive mounts after ejection
Ejecting a CD with the hardware drive button only causes a change uevent, but
the device node stays around (just without a medium). Pick up these uevents and
mark the device as SYSTEMD_READY=0 on ejection, so that systemd stops the
device unit and consequently all mount units on it.

On media insertion, mark the device as SYSTEMD_READY=1 again.

https://bugs.freedesktop.org/show_bug.cgi?id=72206
https://bugzilla.opensuse.org/show_bug.cgi?id=909418
https://bugs.archlinux.org/task/42071
https://bugs.launchpad.net/bugs/1168742
2015-01-28 17:04:06 +01:00
Martin Pitt 06e9788888 core/mount: add dependencies to dynamically mounted mounts too
Add unit dependencies for dynamic (i. e. not from fstab) mounts. With that,
mount units properly bind to their underlying device, and thus get
automatically stopped/unmounted when the underlying device goes away.

This cleans up stale mounts from unplugged devices.

Thanks to Lennart Poettering for pointing out the fix!
2015-01-28 17:02:28 +01:00
Lennart Poettering 3315f08517 sysv-generator: no need to check for identical symlinks source and target twice
http://lists.freedesktop.org/archives/systemd-devel/2015-January/027594.html
2015-01-28 15:11:49 +01:00
Lennart Poettering 82a2b6bb5e core: output unit status output strings to console, only if we actually are changing unit state
Unit _start() and _stop() implementations can fail with -EAGAIN to delay
execution temporarily. Thus, we should not output status messages before
invoking these calls, but after, and only when we know that the
invocation actually made a change.
2015-01-28 15:07:13 +01:00
Lennart Poettering 3ad85e3775 test: duplicate LIST_FOREACH_OTHERS test to check for corner cases of end and start of list 2015-01-28 14:22:13 +01:00
Lennart Poettering cdda4aa8d2 list: properly skip over first item in LIST_FOREACH_OTHERS 2015-01-28 14:04:23 +01:00
Lennart Poettering d1f6b1b455 manager: fix minor typo 2015-01-28 14:04:23 +01:00
Martin Pitt 40780877c1 sysv-generator: Re-fix .sh suffix handling
Commit 4e48855534 caused the .sh suffix to be stripped from the original
"filename", which caused the generated units to call the wrong init.d script.
Only use the .sh stripped file name for comparing with Provides:, not for
generating the Exec*= lines.

Spotted by sysv-generator-test.
2015-01-28 08:00:28 +01:00
Zbigniew Jędrzejewski-Szmek 78eb158a20 build-sys: add check for --help width 2015-01-27 21:48:12 -05:00
Zbigniew Jędrzejewski-Szmek b57b06258e notify,firstboot,analyze,run: trim --help output to 80 lines 2015-01-27 21:48:12 -05:00
Zbigniew Jędrzejewski-Szmek 79ca888f5a tmpfiles: fix help text
The help text, apart from being too long, did not describe what the options
really do.
2015-01-27 21:48:12 -05:00
Lennart Poettering 6bf12f55af build-sys: make xz and zlib build-time optional again 2015-01-28 03:21:56 +01:00
Lennart Poettering 5eeac515bf man: document the new Ctrl-Alt-Del magic 2015-01-28 02:33:22 +01:00
Lennart Poettering a626df3efd manager: when we immediately reboot due to 7x C-A-D within 2s, mention this on the console too 2015-01-28 02:28:45 +01:00
Lennart Poettering 4b42934665 update TODO 2015-01-28 02:22:19 +01:00
Lennart Poettering 2e5c94b9aa core: when the user hits Ctrl-Alt-Del more than 7x per 2s, reboot immediately
This should be useful for cases where clean rebooting doesn't work, and
the user wants to hurry up the reboot.
2015-01-28 02:18:59 +01:00
Lennart Poettering a986501b90 sysv-generator: there's really no need to invoke fstatat() multiple times on the same sysv script
It's sufficient to check once if something is a regular file, hence,
let's do that.
2015-01-28 01:36:40 +01:00
Lennart Poettering 7dfb0404b3 update TODO 2015-01-28 01:02:36 +01:00
Lennart Poettering 37cf8fee46 core: if two start jobs for the same swap device node are queued, only dispatch one of them at a time
If two start jobs for two seperate .swap device nodes are queued, which
then turns out to be referring to the same device node, refuse
dispatching more than one of them at the same time.

This should solve an issue when the same swap partition is found via GPT
auto-discovery and via /etc/fstab, where one uses a symlink path, and
the other the raw devce node. So far we might have ended up invoking
mkswap on the same node at the very same time with the two device node
names.

With this change only one mkswap should be executed at a time. THis
mkswap should have immediate effect on the other swap unit, due to the
state in /proc/swaps changing, and thus suppressing actual invocation of
the second mkswap.

http://lists.freedesktop.org/archives/systemd-devel/2015-January/027314.html
2015-01-28 00:38:38 +01:00
Lennart Poettering caac2704d5 swap: simplify a few things by making use of new LIST_FOREACH_OTHERS macro 2015-01-28 00:37:11 +01:00
Lennart Poettering 7663df3770 list: add macro for iterating through a list an item is in, skipping the item 2015-01-28 00:34:58 +01:00
Lennart Poettering 976dec6e7b swap: properly specify errno when logging 2015-01-28 00:04:47 +01:00
Lennart Poettering 9993ef2e98 sysv-generator: use is_symlink() utility call where appropriate 2015-01-27 23:13:28 +01:00
Lennart Poettering 4e48855534 sysv-generator: minor simplifications 2015-01-27 23:11:01 +01:00
Christian Seiler d44efb621a man: systemd.service(5): add some simple examples
Add a couple of exampels, at least one for each service type that
include some explanations and pointers to various relevant options.
2015-01-27 22:18:35 +01:00
Christian Seiler 92b1e2256a man: systemd.unit(5): add examples for common tasks
Add examples for (a) how to allow units to be enabled and (b)
overriding vendor settings to the man page.
2015-01-27 21:58:45 +01:00
Christian Seiler 11c6476a08 logind: chown+chmod /run/user/$UID if mount(tmpfs) fails with EPERM
In containers without CAP_SYS_ADMIN, it is not possible to mount tmpfs
(or any filesystem for that matter) on top of /run/user/$UID.
Previously, logind just failed in such a situation.

Now, logind will resort to chown+chmod of the directory instead. This
allows logind still to work in those environments, although without the
guarantees it provides (i.e. users not being able to DOS /run or other
users' /run/user/$UID space) when CAP_SYS_ADMIN is available.
2015-01-27 18:58:40 +01:00
Christian Seiler 4d858e7d9f logind: remove per-user runtime dir again if setup fails
If setup of per-user runtime dir fails, clean up afterwards by removing
the directory before returning from the function, so we don't leave the
directory behind.

If this is not done, the second time the user logs in logind would
assume that the directory is already set up, even though it isn't.
2015-01-27 18:55:50 +01:00
Lennart Poettering e611755d98 man: mention that 99-default.link is shipped by default, and users hence need to install a lexically earlier .link file for it to be honoured 2015-01-27 18:29:33 +01:00
Lennart Poettering 2bc39683c0 update TODO 2015-01-27 17:58:57 +01:00
Lennart Poettering 831f18cbf3 build-sys: make bzip2 really optional 2015-01-27 17:58:57 +01:00
Lennart Poettering 0ef403877a units: turn on watchdog for resolved 2015-01-27 14:31:44 +01:00
Lennart Poettering e87bc3ef67 units: fix all TTY paths for container gettys
Spotted by Christian Seiler:

http://lists.freedesktop.org/archives/systemd-devel/2015-January/027441.html
2015-01-27 14:31:44 +01:00
Patrik Flykt c62c4628d9 networkd-dhcp6: Assign DHCPv6 addresses and prefix lengths
Once IPv6 addresses have been acquired, assign these to the interface
with the prefix lengths taken from the ICMPv6 Router Advertisement
handling code. The preferred and valid IPv6 address lifetimes are
handed to the kernel which will clean up them if not renewed in time.

When a prefix announced via Router Advertisements expires, find all
addresses that match that prefix and update the address to have a
prefix length of 128 causing the prefix to be off-link.
2015-01-27 09:35:24 +02:00
Patrik Flykt bd1957e906 sd-icmp6-nd: Add support for fetching the latest expired prefix
Keep the expired prefix for the duration of the prefix expiration event
and remove it afterwards.
2015-01-27 09:35:24 +02:00
Patrik Flykt 99af546d0e test-icmp6-nd: Add test cases for prefixes
Add test cases that feeds an Router Advertisement to the ICMPv6 code
and verify that the correct prefix lengths are returned given an IPv6
address.

Enhance the prefix verification test by adding a shorter prefix and
check that the intended prefix lengths are now updated.
2015-01-27 09:35:24 +02:00
Patrik Flykt d77bde34cf sd-icmp6-nd: Parse ICMPv6 prefix information
Save each new onlink IPv6 prefix and attach an expiry timer to it.
If the prefixes overlap, take the shorter prefix and write a debug
message about the event. Once the prefix is resent in a Router
Advertisement, update the timer. Add a new event for the expiring
prefix.

Add two helper functions, one for returning a prefix length given a
Router Advertisement and the other for generic prefix matching given
an IPv6 prefix and address.
2015-01-27 09:35:24 +02:00
Patrik Flykt 8d7f2c6a47 test-icmp6-rs: Add trivial test case for an MTU that is not present 2015-01-27 09:35:24 +02:00
Patrik Flykt d14b5bc621 sd-icmp6-nd: Add helper function to get the IPv6 link MTU
Update MTU according to the latest value received.
2015-01-27 09:35:24 +02:00
Patrik Flykt 5624c4801e sd-icmp6-nd: Add link and prefix structures for ICMPv6
Each ICMPv6 structure has an interface index and will therefore be
associated with an IPv6 link containing a list of of prefixes.
2015-01-27 09:35:24 +02:00
Patrik Flykt 09667885ba sd-icmp6-nd: Update Router Advertisement handling
As the IPv6 prefixes are needed, update the ICMPv6 Router Advertisement
code to dynamically allocate a suitably sized buffer. Iterate through
the ICMPv6 options one by one returning error if the option length is
too big to fit the buffer.
2015-01-27 09:35:24 +02:00
Patrik Flykt e7504d9547 sd-dhcp6-lease: Revise address iteration functions
Revise the address iteration functions so that one helper function
resets the iterator to the start of the address list while the
second one fetches addresses one by one.

The test case is also updated.
2015-01-27 09:35:24 +02:00
Zbigniew Jędrzejewski-Szmek 2a481c8456 compile-unifont: Python 2 compatibility
Under Python 2, sys.stdout.buffer is missing.
2015-01-26 23:56:34 -05:00
Zbigniew Jędrzejewski-Szmek 10bc4cd469 build-sys: unbundle unifont
We should prefer the unifont.hex file from the system, instead of our
own. Upstream has made a few releases since our version was included,
and we should follow upstream changes. But adding 2.6MB to our source
repo every time upstream releases is not nice.
2015-01-26 23:56:34 -05:00
Zbigniew Jędrzejewski-Szmek 4a84f3e614 TODO: remove laccess conversion
I looked over all access invocations, and I think are using access()
correctly. Accepting dangling symlinks makes sense only in special
circumstances.

So far we do not allow "flag" files like "/fastboot" to be dangling
symlinks. We could, but I don't see a reason to.
2015-01-26 23:56:26 -05:00
Lennart Poettering 687f6a0ba7 update TODO 2015-01-27 02:36:40 +01:00
Lennart Poettering 7e26029ff3 timesyncd: set RLIMIT_NPROC to 2
This way timesyncd cannot be used to fork().

Note that it generally is not safe to use RLIMIT_NPROC, since it breaks
running the same daemon in multiple containers if they do not use user
namespacing. However, timesyncd is excepted from running in a container
anyway, hence it is safe in this case.
2015-01-27 02:33:46 +01:00
Lennart Poettering c51cbfdcc7 man: document that ProtectSystem= also covers /boot 2015-01-27 02:19:33 +01:00