Josh Triplett [Sat, 29 Nov 2014 09:06:28 +0000 (01:06 -0800)]
systemd-sleep: Support sleep.conf.d directories in the usual search paths
Josh Triplett [Sat, 29 Nov 2014 09:06:20 +0000 (01:06 -0800)]
journald: Support journald.conf.d directories in the usual search paths
Josh Triplett [Sat, 29 Nov 2014 09:06:04 +0000 (01:06 -0800)]
core: Support system.conf.d and user.conf.d directories in the usual search paths
Josh Triplett [Sat, 29 Nov 2014 09:05:43 +0000 (01:05 -0800)]
man: Factor out a common snippet for .d directories and precedence
Several manpages contain duplicate text describing a standard set of .d
configuration directories, with the usual sorting, precedence,
overrides, and so on. Factor this common text out using XInclude before
proliferating it even further.
Josh Triplett [Sat, 29 Nov 2014 09:05:20 +0000 (01:05 -0800)]
man/logind.conf.xml: Make "man logind.conf.d" work too
Ronny Chevalier [Wed, 29 Oct 2014 15:22:02 +0000 (16:22 +0100)]
systemctl: add edit verb
It helps editing units by either creating a drop-in file, like
/etc/systemd/system/my.service.d/override.conf, or by copying the
original unit from /usr/lib/systemd/ to /etc/systemd/ if the --full
option is specified.
It invokes an editor on temporary files related to the unit files and
if the editor exited successfully, then it renames the temporary files
to their original names (e.g. my.service or override.conf) and
daemon-reload is invoked.
If the temporary file is empty the modification is canceled.
See https://bugzilla.redhat.com/show_bug.cgi?id=906824
Chris Atkinson [Fri, 28 Nov 2014 20:27:56 +0000 (15:27 -0500)]
man: update description of default extension for isolate
Zbigniew Jędrzejewski-Szmek [Sat, 29 Nov 2014 16:06:05 +0000 (11:06 -0500)]
nspawn: fix unused variable warning
Zbigniew Jędrzejewski-Szmek [Sat, 29 Nov 2014 15:28:01 +0000 (10:28 -0500)]
delta: diff returns 1 when files differ, ignore this
https://bugs.debian/org/771397
Tom Gundersen [Sat, 29 Nov 2014 10:14:48 +0000 (11:14 +0100)]
shared: install - report error if mask symlink can not be marked for removal
Tom Gundersen [Sat, 29 Nov 2014 09:40:21 +0000 (10:40 +0100)]
shared: time-dst - ensure nulstr is null terminated
Fixes CID #1237772.
WaLyong Cho [Tue, 18 Nov 2014 15:13:43 +0000 (00:13 +0900)]
README: notice kernel config for CPUQuota
Zbigniew Jędrzejewski-Szmek [Fri, 28 Nov 2014 22:04:24 +0000 (17:04 -0500)]
mount: use DEFINE_TRIVIAL_CLEANUP_FUNC
Tom Gundersen [Fri, 28 Nov 2014 20:51:45 +0000 (21:51 +0100)]
udev: rules - ignore the lack of trailing newline
Also accept '\r' as newline character.
This dropps warnings of the type:
invalid key/value pair in file /usr/lib/udev/rules.d/40-usb-media-players.rules
on line 26, starting at character 25 ('')
Tom Gundersen [Fri, 28 Nov 2014 20:46:34 +0000 (21:46 +0100)]
udev: rules - print the first invalid character
The current code would print the character following the first invalid
character.
Given an udev rules-file without a trailing newline we would otherwise print
garbage:
invalid key/value pair in file /usr/lib/udev/rules.d/40-usb-media-players.rules
on line 26, starting at character 25 ('m')
This is now changed to print
invalid key/value pair in file /usr/lib/udev/rules.d/40-usb-media-players.rules
on line 26, starting at character 25 ('')
(still not very good as printing \0 just gives the empty string)
Tom Gundersen [Fri, 28 Nov 2014 20:44:31 +0000 (21:44 +0100)]
udev: rules - modernise add_rule a bit
Lennart Poettering [Fri, 28 Nov 2014 20:12:03 +0000 (21:12 +0100)]
sd-bus: move packet header definition to bus-protocol.h
Lennart Poettering [Fri, 28 Nov 2014 19:52:55 +0000 (20:52 +0100)]
treewide: convert some left-over (usec_t) -1 to USEC_INFINITY
Lennart Poettering [Fri, 28 Nov 2014 19:51:01 +0000 (20:51 +0100)]
treewide: introduce UID_INVALID (and friends) as macro for (uid_t) -1
Peter Hutterer [Thu, 27 Nov 2014 05:19:44 +0000 (15:19 +1000)]
udevadm hwdb: discard extra leading whitespaces in hwdb
Currently a property in the form of
FOO=bar
is stored as " FOO=bar", i.e. the property name contains a leading space.
That's quite hard to spot.
This patch discards all extra whitespaces but the first one which is required
by libudev's hwdb_add_property.
[zj: modify the check a bit]
https://bugs.freedesktop.org/show_bug.cgi?id=82311
Zbigniew Jędrzejewski-Szmek [Fri, 28 Nov 2014 19:22:47 +0000 (14:22 -0500)]
mount: constify MountParameters
Zbigniew Jędrzejewski-Szmek [Fri, 28 Nov 2014 19:19:03 +0000 (14:19 -0500)]
mount: deal with inotify queue overflow
Overflow is very unlikely, since we are watching a privileged directory,
but could be triggered if thousands of mounts are suddently executed.
Zbigniew Jędrzejewski-Szmek [Fri, 28 Nov 2014 18:43:09 +0000 (13:43 -0500)]
mount: create directory before adding watches on it
Zbigniew Jędrzejewski-Szmek [Fri, 28 Nov 2014 18:02:15 +0000 (13:02 -0500)]
mount: be more careful about errors when parsing mtab
Fixup for
4a3a9ef610.
Zbigniew Jędrzejewski-Szmek [Fri, 28 Nov 2014 06:50:05 +0000 (01:50 -0500)]
mount: simplify mount_needs_network check
Chris Leech [Mon, 24 Nov 2014 04:33:38 +0000 (20:33 -0800)]
mount: check options as well as fstype for network mounts
When creating a new mount unit after an event on /proc/self/mountinfo,
check the mount options as well as the fstype to determine if this is a
remote mount that requires network access.
Chris Leech [Mon, 24 Nov 2014 04:33:40 +0000 (20:33 -0800)]
mount: add remote-fs dependencies if needed after change
This is an attempt to add it the remote-fs dependencies to a mount unit
if the options change, like when the utab options are picked up after
mountinfo has already been processed. It just adds the remote-fs
dependencies, leaving the local-fs ones in place.
With this change I always get mount units with proper remote-fs
dependencies when mounted with the _netdev option.
Chris Leech [Mon, 24 Nov 2014 04:33:39 +0000 (20:33 -0800)]
mount: monitor for utab changes with inotify
Parsing the mount table with libmount races against the mount command,
which will handle the actual mounting before updating utab. This means
the poll event on /proc/self/mountinfo can kick of a reparse in systemd
before the utab information is available.
This change adds in an additional event source using inotify to watch
for changes to utab. It only watches for IN_MOVED_TO events, matching
libmount behavior of always overwriting this file using rename(2).
This does add a second pass through the mount table parsing when utab is
updated.
Chris Leech [Mon, 24 Nov 2014 04:33:37 +0000 (20:33 -0800)]
mount: use libmount to enumerate /proc/self/mountinfo
This lets libmount add in user options from /run/mount/utab, like
_netdev which is needed to get proper ordering against remote-fs.target
Lennart Poettering [Fri, 28 Nov 2014 19:29:24 +0000 (20:29 +0100)]
coredump: simplify a few things by allocating small fields on the stack rather than heap
Lennart Poettering [Fri, 28 Nov 2014 19:15:18 +0000 (20:15 +0100)]
coredump: rework compose_open_fds()
Use FOREACH_DIRENT() and FOREACH_LINE() macros instead of manual loops.
Don't clobber return parameters on failure.
Simplify some other things.
Lennart Poettering [Fri, 28 Nov 2014 18:17:27 +0000 (19:17 +0100)]
update TODO
Lennart Poettering [Fri, 28 Nov 2014 18:16:37 +0000 (19:16 +0100)]
sd-bus: add support for matches against arrays of strings in messages
Lennart Poettering [Fri, 28 Nov 2014 18:16:25 +0000 (19:16 +0100)]
sd-bus: if a NULL signatures is passed to sd_bus_message_skip(), make it skip a single element of any type
Lennart Poettering [Fri, 28 Nov 2014 16:44:05 +0000 (17:44 +0100)]
sd-bus: add arrays of strings in the bloom filter
Let's do this right from the beginning, to prepare ground for udev
messages that most likely want to store list of strings (for device
tags) in messages, and filter on them.
Lennart Poettering [Fri, 28 Nov 2014 16:03:48 +0000 (17:03 +0100)]
update TODO
Lennart Poettering [Fri, 28 Nov 2014 16:03:35 +0000 (17:03 +0100)]
sd-bus: make more connection properties readable
Lennart Poettering [Fri, 28 Nov 2014 15:51:45 +0000 (16:51 +0100)]
sd-bus: add new sd_bus_get_address() for querying the current bus address
Also, update "busctl" to show this in its output.
Lennart Poettering [Fri, 28 Nov 2014 15:38:47 +0000 (16:38 +0100)]
sd-bus: rename sd_bus_get_owner_id() → sd_bus_get_bus_id()
The ID returned really doesn't identify the owner, but the bus instance,
hence fix this misnaming.
Also, update "busctl status" to show the ID in its output.
Michal Schmidt [Fri, 28 Nov 2014 18:57:32 +0000 (19:57 +0100)]
treewide: another round of simplifications
Using the same scripts as in
f647962d64e "treewide: yet more log_*_errno
+ return simplifications".
Michal Schmidt [Fri, 28 Nov 2014 18:29:59 +0000 (19:29 +0100)]
treewide: use log_*_errno whenever %m is in the format string
If the format string contains %m, clearly errno must have a meaningful
value, so we might as well use log_*_errno to have ERRNO= logged.
Using:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/'
Plus some whitespace, linewrap, and indent adjustments.
Michal Schmidt [Fri, 28 Nov 2014 18:20:59 +0000 (19:20 +0100)]
core: fix return value in error path after sd_event_add_io() failure
sd_event_add_io() does not set errno, it returns negative errno.
Noticed during log_*_errno conversions.
Michal Schmidt [Fri, 28 Nov 2014 18:13:53 +0000 (19:13 +0100)]
treewide: a few more log_*_errno + return simplifications
The one in tmpfiles.c:create_item() even looks like it fixes a bug.
Michal Schmidt [Fri, 28 Nov 2014 17:50:43 +0000 (18:50 +0100)]
treewide: yet more log_*_errno + return simplifications
Using:
find . -name '*.[ch]' | while read f; do perl -i.mmm -e \
'local $/;
local $_=<>;
s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg;
print;'
$f
done
And a couple of manual whitespace fixups.
Zbigniew Jędrzejewski-Szmek [Fri, 28 Nov 2014 17:25:09 +0000 (12:25 -0500)]
Revert "systemctl: append default suffix only if none present"
This reverts a chunk out of commit
5e03c6e3b517286bbd65b48d88f60e5b83721894
which was trying to pass NULL to the the '.service' default. Anyway,
it seems better to be explicit.
Michal Schmidt [Fri, 28 Nov 2014 17:23:20 +0000 (18:23 +0100)]
treewide: more log_*_errno + return simplifications
Zbigniew Jędrzejewski-Szmek [Fri, 28 Nov 2014 16:28:10 +0000 (11:28 -0500)]
systemctl: append default suffix only if none present
Simplify unit_name_mangle() and unit_name_mangle_with_suffix() to
always behave the same, and only append a suffix if there is no
type suffix. If a user says 'isolate blah.device' it is better to
return an error that the type cannot be isolated, than to try to
isolate blah.device.target.
Tom Gundersen [Fri, 28 Nov 2014 15:58:32 +0000 (16:58 +0100)]
udevd: don't set receive buffer size when socket activated
The socket unit does this, so no need to redo it in udevd.
Michal Schmidt [Fri, 28 Nov 2014 16:34:26 +0000 (17:34 +0100)]
treewide: simplify log_*_errno(r,...) immediately followed by "return r"
Michal Schmidt [Fri, 28 Nov 2014 16:09:20 +0000 (17:09 +0100)]
treewide: more log_*_errno() conversions, multiline calls
Basically:
find . -name '*.[ch]' | while read f; do perl -i.mmm -e \
'local $/;
local $_=<>;
s/log_(debug|info|notice|warning|error|emergency)\("([^"]*)%s"([^;]*),\s*strerror\(-?([->a-zA-Z_]+)\)\);/log_\1_errno(\4, "\2%m"\3);/gms;print;' \
$f; done
Plus manual indentation fixups.
Martin Pitt [Fri, 28 Nov 2014 14:38:05 +0000 (15:38 +0100)]
hostnamectl: Exit with zero on success
In show_all_names(), bus_map_all_properties() returns 1 on success which is
then used as the return code of show_all_names() and eventually main(). Exit
with zero in main() on all nonnegative results to guard against similar errors.
Lennart Poettering [Fri, 28 Nov 2014 15:32:26 +0000 (16:32 +0100)]
udev,update-done: more log_xyz_errno() conversions
Lennart Poettering [Fri, 28 Nov 2014 15:30:53 +0000 (16:30 +0100)]
sd-bus: make sure %m resolves to the specified error in bus_error_set_errnofv()
Lennart Poettering [Fri, 28 Nov 2014 15:16:18 +0000 (16:16 +0100)]
update TODO
Lennart Poettering [Fri, 28 Nov 2014 15:14:39 +0000 (16:14 +0100)]
bus-proxy: automatically detect scope of bus and derive which XML snippets to load from that
Lennart Poettering [Fri, 28 Nov 2014 15:05:43 +0000 (16:05 +0100)]
sd-bus: rename default bus address constants, they aren't "paths" but "addresses"
Lennart Poettering [Fri, 28 Nov 2014 14:59:05 +0000 (15:59 +0100)]
sd-bus: add new call sd_bus_get_scope() for querying whether one is connected to a system or a user bus
Lennart Poettering [Fri, 28 Nov 2014 14:58:03 +0000 (15:58 +0100)]
sd-bus: rework credential query logic
Also, make the call to free kdbus slices generic and use it everywhere
Michal Schmidt [Fri, 28 Nov 2014 13:45:55 +0000 (14:45 +0100)]
treewide: more log_*_errno() conversions
Michal Schmidt [Fri, 28 Nov 2014 13:26:31 +0000 (14:26 +0100)]
treewide: drop unnecessary trailing \n in log_*() calls
Michal Schmidt [Fri, 28 Nov 2014 12:54:40 +0000 (13:54 +0100)]
core: two more log_unit_*_errno() conversions
Michal Schmidt [Fri, 28 Nov 2014 12:17:02 +0000 (13:17 +0100)]
core: convert log_unit_*() to log_unit_*_errno()
Using:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_unit_(debug|info|notice|warning|error|emergency)\(([^"]+), "(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_unit_\1_errno(\2, \5, "\3%m"\4);/'
Michal Schmidt [Fri, 28 Nov 2014 11:15:34 +0000 (12:15 +0100)]
core: add log_unit_*_errno() macros
Michal Schmidt [Fri, 28 Nov 2014 12:19:16 +0000 (13:19 +0100)]
treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values.
Michal Schmidt [Fri, 28 Nov 2014 10:58:34 +0000 (11:58 +0100)]
treewide: auto-convert the simple cases to log_*_errno()
As a followup to
086891e5c1 "log: add an "error" parameter to all
low-level logging calls and intrdouce log_error_errno() as log calls
that take error numbers", use sed to convert the simple cases to use
the new macros:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/'
Multi-line log_*() invocations are not covered.
And we also should add log_unit_*_errno().
Michal Schmidt [Fri, 28 Nov 2014 10:54:25 +0000 (11:54 +0100)]
shared: fix log_emergency_errno macro
It was not passing the error argument.
Lennart Poettering [Fri, 28 Nov 2014 02:29:52 +0000 (03:29 +0100)]
update TODO
Lennart Poettering [Fri, 28 Nov 2014 01:30:43 +0000 (02:30 +0100)]
kdbus: when running in a container, don't complain that we cannot write to /sys
Lennart Poettering [Fri, 28 Nov 2014 02:10:55 +0000 (03:10 +0100)]
log: change log_xyz_errno() calls to always return the negative error
This enables us to write things like this:
int open_some_file(void) {
fd = open("/dev/foobar", O_RDWR|O_CLOEXEC);
if (fd < 0)
return log_error_errno(errno, "Failed to reboot: %m");
return fd;
}
Which is function that returns -errno on failure, as well as printing an
error message, all in one line.
Lennart Poettering [Fri, 28 Nov 2014 01:56:39 +0000 (02:56 +0100)]
log: make socket address structs static const
Lennart Poettering [Fri, 28 Nov 2014 01:30:49 +0000 (02:30 +0100)]
log: also set errno to the passed error code before processing format string in log_struct()
That way the caller may use %m to print the specified error.
Lennart Poettering [Fri, 28 Nov 2014 01:26:05 +0000 (02:26 +0100)]
core: only override kdbus attach mask when running as PID 1
Lennart Poettering [Fri, 28 Nov 2014 01:23:29 +0000 (02:23 +0100)]
sd-bus: the attach_mask kernel module parameter is 64bit now, hence initialize it as such
Lennart Poettering [Fri, 28 Nov 2014 01:12:30 +0000 (02:12 +0100)]
log: allow negative errno values
sd_bus_error_set_errno() allows negative errors too, hence, be equally
nice.
Lennart Poettering [Fri, 28 Nov 2014 01:05:14 +0000 (02:05 +0100)]
log: fix order of log_unit_struct() to match other logging calls
Also, while we are at it, introduce some syntactic sugar for creating
ERRNO= and MESSAGE= structured logging fields.
Lennart Poettering [Thu, 27 Nov 2014 23:42:35 +0000 (00:42 +0100)]
networkd: update logging macros for parameter order, and errno, to match rest of the code
Lennart Poettering [Thu, 27 Nov 2014 23:41:49 +0000 (00:41 +0100)]
update TODO
Lennart Poettering [Thu, 27 Nov 2014 23:41:38 +0000 (00:41 +0100)]
networkd: remove duplicate macro definitions
David Herrmann [Fri, 28 Nov 2014 00:03:54 +0000 (01:03 +0100)]
Update TODO
kdbus eavesdropping was fixed!
Zbigniew Jędrzejewski-Szmek [Thu, 27 Nov 2014 22:17:09 +0000 (17:17 -0500)]
sysv-generator: advertise the man page
Zbigniew Jędrzejewski-Szmek [Thu, 27 Nov 2014 22:13:12 +0000 (17:13 -0500)]
man: add systemd-sysv-generator(8)
In principle SysV stuff is only for compatibility, but we are stuck
with it for the forseeable future, so documentation might as well
be provided.
https://bugs.debian.org/771172
Thomas Hindoe Paaboel Andersen [Thu, 27 Nov 2014 22:15:54 +0000 (23:15 +0100)]
fix build with --enable-terminal
Broke with
086891e5c119abb9854237fc32e736fe2d67234c
Lennart Poettering [Thu, 27 Nov 2014 20:56:39 +0000 (21:56 +0100)]
kmod-setup: simplify kernel command line parsing
Lennart Poettering [Thu, 27 Nov 2014 20:28:13 +0000 (21:28 +0100)]
kdbus: set kernel attach mask before creating the first bus
Lennart Poettering [Thu, 27 Nov 2014 19:28:51 +0000 (20:28 +0100)]
selinux: log selinux log messages with LOG_AUTH facility
Lennart Poettering [Thu, 27 Nov 2014 19:20:23 +0000 (20:20 +0100)]
log: rearrange log function naming
- Rename log_meta() → log_internal(), to follow naming scheme of most
other log functions that are usually invoked through macros, but never
directly.
- Rename log_info_object() to log_object_info(), simply because the
object should be before any other parameters, to follow OO-style
programming style.
Lennart Poettering [Thu, 27 Nov 2014 18:52:27 +0000 (19:52 +0100)]
log: be a bit less wasteful when allocating buffers
Lennart Poettering [Thu, 27 Nov 2014 18:48:02 +0000 (19:48 +0100)]
log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers
This change has two benefits:
- The format string %m will now resolve to the specified error (or to
errno if the specified error is 0. This allows getting rid of a ton of
strerror() invocations, a function that is not thread-safe.
- The specified error can be passed to the journal in the ERRNO= field.
Now of course, we just need somebody to convert all cases of this:
log_error("Something happened: %s", strerror(-r));
into thus:
log_error_errno(-r, "Something happened: %m");
Lennart Poettering [Thu, 27 Nov 2014 11:52:13 +0000 (12:52 +0100)]
sd-bus: set creds info for "org.freedesktop.DBus.Local" generated messages, too
Lennart Poettering [Thu, 27 Nov 2014 11:51:22 +0000 (12:51 +0100)]
sd-bus: when we get the list of well-known names back from kdbus we shouldn't confuse the empty list with unknown information
Lennart Poettering [Thu, 27 Nov 2014 02:20:51 +0000 (03:20 +0100)]
sd-bus: deal with whitespace in matches
Lennart Poettering [Thu, 27 Nov 2014 01:57:22 +0000 (02:57 +0100)]
sd-bus: unify logic how we patch the message source of driver messages
Lennart Poettering [Thu, 27 Nov 2014 01:37:05 +0000 (02:37 +0100)]
sd-bus: fake valid well-known-names metadata for faked bus messages
Lennart Poettering [Thu, 27 Nov 2014 01:28:23 +0000 (02:28 +0100)]
sd-bus: optimize how we generate the well-known-names lists in messages from kdbus
Lennart Poettering [Thu, 27 Nov 2014 00:19:50 +0000 (01:19 +0100)]
sd-bus: be stricter with mismatches between dbus1 and kdbus message headers
Lennart Poettering [Wed, 26 Nov 2014 22:14:13 +0000 (23:14 +0100)]
bus-proxy: beef up policy enforcement
- actually return permission errors to clients
- use the right ucreds field
- fix error paths when we cannot keep track of locally acquired names
due to OOM
- avoid unnecessary global variables
- log when the policy denies access
- enforce correct policy rule order
- always request all the metadata its we need to make decisions
Lennart Poettering [Wed, 26 Nov 2014 22:13:52 +0000 (23:13 +0100)]
update TODO
Lennart Poettering [Wed, 26 Nov 2014 21:52:10 +0000 (22:52 +0100)]
bus-proxy: check passed parameter signature of all driver method calls
Alin Rauta [Thu, 27 Nov 2014 17:50:48 +0000 (18:50 +0100)]
networkd: fix kernel rtnl receive buffer overrun error
We got the following error when running systemd on a device with many ports:
"rtnl: kernel receive buffer overrun
Event source 'rtnl-receive-message' returned error, disabling: No buffer space
available"
I think the kernel socket receive buffer queue should be increased. The default
value is taken from:
"/proc/sys/net/core/rmem_default", but we can overwrite it using SO_RCVBUF
socket option.
This is already done in networkd for other sockets.
For example, the bus socket (sd-bus/bus-socket.c) has a receive queue of 8MB.
In our case, the default is 208KB.
Increasing the buffer receive queue for manager socket to 512KB should be enough
to get rid of the above error.
[tomegun: bump the limit even higher to 8M]
Stanisław Pitucha [Tue, 18 Nov 2014 03:52:13 +0000 (14:52 +1100)]
resolve: reject empty TXT records
TXT records should have at least one character, so enforce this.
Before 0f84a72 parser SIGSEGV'd on ->txt.strings being NULL, but
even if this is fixed we should reject invalid TXT records.