Commit Graph

13058 Commits

Author SHA1 Message Date
Evgeny Vereshchagin
08596068d7 run: can launch units with ReadWriteDirectories, ReadOnlyDirectories, InaccessibleDirectories 2015-10-20 22:03:43 +00:00
Lennart Poettering
f73e8b9caf Merge pull request #1616 from evverx/run-fix-environment-parsing
run: fix Environment parsing
2015-10-20 15:26:19 +02:00
Tom Gundersen
14a081a0ff Merge pull request #1538 from ssahani/ipv62
networkd: add support to configure IPv6 DAD
2015-10-20 14:59:27 +02:00
Evgeny Vereshchagin
e9876fc9c5 run: fix Environment parsing
* `Environment=` resets previous assignments
* `Environment='a=1 b=2'` sets `a` to `1` and `b` to `2`
* `Environment='"a=1 2" b=2"'` sets `a` to `1 2` and `b` to `2`
2015-10-20 12:55:07 +00:00
Lennart Poettering
c91960c5a0 Merge pull request #1619 from iaguis/nspawn-sysfs-netns-3
nspawn: skip /sys-as-tmpfs if we don't use private-network
2015-10-20 12:22:32 +02:00
Iago López Galeiras
d167824896 nspawn: skip /sys-as-tmpfs if we don't use private-network
Since v3.11/7dc5dbc ("sysfs: Restrict mounting sysfs"), the kernel
doesn't allow mounting sysfs if you don't have CAP_SYS_ADMIN rights over
the network namespace.

So the mounting /sys as a tmpfs code introduced in
d8fc6a000f doesn't work with user
namespaces if we don't use private-net. The reason is that we mount
sysfs inside the container and we're in the network namespace of the host
but we don't have CAP_SYS_ADMIN over that namespace.

To fix that, we mount /sys as a sysfs (instead of tmpfs) if we don't use
private network and ignore the /sys-as-a-tmpfs code if we find that /sys
is already mounted as sysfs.

Fixes #1555
2015-10-20 10:19:23 +02:00
Lennart Poettering
2229f65667 dbus-execute: some cleanups when parsing EnvironmentFiles= for transient units 2015-10-19 23:43:19 +02:00
Zbigniew Jędrzejewski-Szmek
ab84f5b95e strv: Add _cleanup_strv_free_erase_ and _cleanup_string_free_erase_ 2015-10-19 23:13:07 +02:00
Lennart Poettering
1602b00853 tree-wide: whenever we deal with passwords, erase them from memory after use
A bit snake-oilish, but can't hurt.
2015-10-19 23:13:07 +02:00
Lennart Poettering
0245cf8167 core: actually set pids_max field after parsing it
Fixes one of the issues pointed out in #1522.
2015-10-19 23:13:06 +02:00
Lennart Poettering
09eba4d46b journald: make sure r is always initialized 2015-10-19 23:07:18 +02:00
Lennart Poettering
3741b696f4 journal: fix bad memory freeing 2015-10-19 23:07:18 +02:00
Lennart Poettering
ac5b0c13d8 tree-wide: add more void casts for various syscall invocations 2015-10-19 23:07:18 +02:00
Lennart Poettering
4b4cb0a1ff core: fix type of NetClass dbus property
it's exposed as uint32_t and it is internally an uint32_t, hence no need
to treat it as an unsigned.
2015-10-19 23:07:18 +02:00
Lennart Poettering
d89093334b Merge pull request #1614 from alkino/master
Hook more properties for transient units
2015-10-19 22:09:10 +02:00
Nicolas Cornu
ceb728cf0f Hook more properties for transient units
systemd-run can now launch units with EnvironmentFile set.
2015-10-19 21:58:01 +02:00
Thomas Hindoe Paaboel Andersen
b250ea2fd6 tree-wide: remove unused functions 2015-10-19 21:46:01 +02:00
Lennart Poettering
aa486a72be Merge pull request #1598 from evverx/run-oomscoreadjust
systemd-run can launch units with OOMScoreAdjust
2015-10-19 19:02:47 +02:00
David Herrmann
606601ddca Merge pull request #1595 from poettering/proxy-fixes
bus proxy fixes, and more
2015-10-18 12:15:10 +02:00
Evgeny Vereshchagin
6b862936c7 run: can launch units with OOMScoreAdjust 2015-10-17 20:03:40 +00:00
Evgeny Vereshchagin
257b0719cb util: add func for checking OOMScoreAdjust 2015-10-17 20:03:40 +00:00
Lennart Poettering
9806e87da2 unit: allocate bus name match string on the stack
Let's use strjoina() rather than strjoin() for construct dbus match
strings.

Also, while we are at it, fix parameter ordering, so that our functions
always put the object first, like it is customary for OO-like
programming.
2015-10-17 16:48:21 +02:00
Lennart Poettering
50e0d56cf3 sd-bus: fix error handling of pthread API calls
pthread APIs (unlike the rest of libc) return their errors as positive
error codes directly from the functions, rather than using errno. Let's
make sure we always handle things that way.
2015-10-17 16:48:21 +02:00
Lennart Poettering
1a37c9756f bus-proxy: don't close local bus fds twice
Clear up how we pass fd owner ship to proxy and bus objects. Document
that ownership is passed of the fds in question even in case of failing
constructors, and that callers should forget about fds pass into the
proxy object.

The alternative would be to duplicate the fds, but given that fds are a
relatively scarce and heavy resource let's better avoid that.

Fixes #1591.
2015-10-17 16:48:21 +02:00
Ronny Chevalier
6a0dacb7aa Merge pull request #1582 from evverx/dump-runtime-dir-mode
core: dump RuntimeDirectories and RuntimeDirectoryMode too
2015-10-16 21:33:17 +02:00
Evgeny Vereshchagin
c2bbd90b5a core: dump RuntimeDirectories and RuntimeDirectoryMode too 2015-10-16 18:44:47 +00:00
Susant Sahani
8749cbcd4f networkd: add support for configure IPv6 DAD
Configures Ipv6 Duplicate Address Detection.

10
2015-10-16 10:53:20 +05:30
Tom Gundersen
9c5a882b7f sd-netlink: refcount multicast groups
Track the number of matches installed for a given multicast group, and leave the
group once no matches depend on it.

In order to handle passed-in sockets that are already members of multicast groups
we initialize the refcount based on the membership once we take over the socket.
This way we will leave the socket in the state we found it once we finish with
it.

On kernels that do not fully support reading out the multicast group membership
we fall back to never leaving any groups (as before).
2015-10-15 18:59:08 +02:00
Lennart Poettering
3f952f92b9 btrfs: always remove the per-subvol qgroup when removing a subvol
btrfs doesn't do that automatically, hence let's do that explicitly each
time.
2015-10-15 18:37:03 +02:00
Lennart Poettering
f10dc5a725 Merge pull request #1575 from evverx/expose-manager-timerslacknsec
core: expose manager's TimerSlackNSec as propery on dbus
2015-10-15 14:11:36 +02:00
Evgeny Vereshchagin
eed67a3041 core: expose manager's TimerSlackNSec as propery on dbus 2015-10-15 12:02:43 +00:00
Lennart Poettering
cb181af9b6 Merge pull request #1527 from keszybz/lz4
Using lz4 frame api for coredump files
2015-10-15 13:37:11 +02:00
Lennart Poettering
590a23de52 Merge pull request #1569 from mustrumr/date-parse-additions
Date parse additions
2015-10-15 13:09:26 +02:00
Evgeny Vereshchagin
f1db332756 run: can launch units with TimerSlackNSec 2015-10-15 09:57:28 +00:00
Zbigniew Jędrzejewski-Szmek
5146f9f065 compress: return errors without logging, do not fake errno
Logging for compression and decompression is assymetrical on purpose:
if compiled without some type of compression, those compression code
paths should never be invoked. OTOH, it is possible to encounter
unsupported format on decompression, so leave those log_debug statements
in, to make it easier to diagnose stuff.
2015-10-14 21:24:36 -04:00
Hristo Venev
9d5bd70d9e test: add calendarspec UTC tests 2015-10-15 02:58:00 +03:00
Hristo Venev
51ffa239e8 basic: calendarspec UTC support
Just add " UTC" to the end of the event expression. Works for the
special expressions.
2015-10-15 02:57:59 +03:00
Hristo Venev
063bc36469 test: parse_timestamp UTC and fractional seconds tests 2015-10-15 02:57:57 +03:00
Hristo Venev
e4eaf99a31 basic: parse_timestamp UTC and fractional seconds support 2015-10-15 02:57:57 +03:00
Hristo Venev
7c67c79c9a basic: add mktime_or_timegm and localtime_or_gmtime_r
to time-util.h. They take an extra argument `bool utc`.
2015-10-15 02:34:45 +03:00
Tom Gundersen
af4efb515b login: suspend - be a bit more explicit when logging
When the Suspend method is called, the only log message we write
(unless debugging is enabled) is "Operation finished.". This is
not very helpful when trying to figure out what is going on, so
add what operation we are talking about to the message:
"Operation 'sleep' finished.".

Hat tip to Daniel Aleksandersen for pointing this out.
2015-10-14 22:25:58 +02:00
Lennart Poettering
64f283c39b Merge pull request #1528 from evverx/systemd-run-syslog-pri-fac
systemd-run can launch units with SyslogLevel and SyslogFacility
2015-10-14 19:39:28 +02:00
Evgeny Vereshchagin
e0d6e0fa55 core: execute: validate syslog level and facility 2015-10-14 16:35:30 +00:00
Evgeny Vereshchagin
adb8ec96f2 util: add functions for validating syslog level and facility 2015-10-14 16:35:24 +00:00
Evgeny Vereshchagin
460ed929cf systemd-run: can launch units with SyslogFacility 2015-10-14 15:05:04 +00:00
Evgeny Vereshchagin
a8a1357560 systemd-run: can launch units with SyslogLevel 2015-10-14 14:48:45 +00:00
Lennart Poettering
2ee4e222ff tty-ask-password-agent: don't warn if we cannot disable wall messages on the calling tty
For example, due to perm issues.

THis simply downgrades the message about it, since this is purely
cosmetical anyway.

Fixes #1543.
2015-10-14 16:24:25 +02:00
Lennart Poettering
995c5e96cd core: log if the service to activate vanished before we activate it
Normally this shouldn't happen unless the daemon is reloaded.

A similar check is already in place in socket.c for the socket
activation case.

This hopefully makes #1526 non-fatal, though it will not fix this, and
there's something else to fix.
2015-10-14 16:22:22 +02:00
Zbigniew Jędrzejewski-Szmek
e068517205 compress: fix mmap error handling 2015-10-14 10:15:27 -04:00
Lennart Poettering
9ea79b459e Merge pull request #1530 from teg/network-fixes-2
networkd/libsystemd-network: collection of trivial patches v2
2015-10-14 12:15:09 +02:00