Zbigniew Jędrzejewski-Szmek [Tue, 26 Apr 2016 09:19:10 +0000 (05:19 -0400)]
systemd --user: call pam_loginuid when creating user@.service (#3120)
This way the user service will have a loginuid, and it will be inherited by
child services. This shouldn't change anything as far as systemd itself is
concerned, but is nice for various services spawned from by systemd --user
that expect a loginuid.
pam_loginuid(8) says that it should be enabled for "..., crond and atd".
user@.service should behave similarly to those two as far as audit is
concerned.
https://bugzilla.redhat.com/show_bug.cgi?id=1328947#c28
Zbigniew Jędrzejewski-Szmek [Mon, 25 Apr 2016 19:57:36 +0000 (15:57 -0400)]
Merge pull request #3109 from poettering/journal-by-fd
rework "journalctl -M"
Zbigniew Jędrzejewski-Szmek [Mon, 25 Apr 2016 19:56:17 +0000 (15:56 -0400)]
Merge pull request #3114 from poettering/journalctl-b
Fix endless loops in journalctl --list-boots (closes #617).
EMOziko [Mon, 25 Apr 2016 19:42:35 +0000 (23:42 +0400)]
Hp Folio 1040g2 micmute and toggle touchpad fn keys fix (#3118)
Added HP Folio 1040g2 Fn+F8 MICMUTE FIx
Lennart Poettering [Mon, 25 Apr 2016 19:38:56 +0000 (21:38 +0200)]
machined: add CAP_MKNOD to capabilities to run with (#3116)
Container images from Debian or suchlike contain device nodes in /dev. Let's
make sure we can clone them properly, hence pass CAP_MKNOD to machined.
Fixes: #2867 #465
Lennart Poettering [Mon, 25 Apr 2016 19:37:51 +0000 (21:37 +0200)]
machined: generate a nicer error when the user tries "machinectl clone" on non-btrfs file systems (#3117)
Fixes: #2060
(Of course, in the long run, we should probably add a copy-based fall-back. But
given how slow that is, this probably requires some asynchronous forking logic
like the CopyFrom() and CopyTo() method calls already implement.)
Lennart Poettering [Mon, 25 Apr 2016 19:36:25 +0000 (21:36 +0200)]
core: fix description of "resources" service error (#3119)
The "resources" error is really just the generic error we return when
we hit some kind of error and we have no more appropriate error for the case to
return, for example because of some OS error.
Hence, reword the explanation and don't claim any relation to resource limits.
Admittedly, the "resources" service error is a bit of a misnomer, but I figure
it's kind of API now.
Fixes: #2716
Lennart Poettering [Mon, 25 Apr 2016 18:02:03 +0000 (20:02 +0200)]
Merge pull request #3113 from ssahani/route-fix
netwotkd: fix address and route conf
Vito Caputo [Mon, 25 Apr 2016 17:58:16 +0000 (10:58 -0700)]
journal: fix already offline check and thread leak (#2810)
Early in journal_file_set_offline() f->header->state is tested to see if
it's != STATE_ONLINE, and since there's no need to do anything if the
journal isn't online, the function simply returned here.
Since moving part of the offlining process to a separate thread, there
are two problems here:
1. We can't simply check f->header->state, because if there is an
offline thread active it may modify f->header->state.
2. Even if the journal is deemed offline, the thread responsible may
still need joining, so a bare return may leak the thread's resources
like its stack.
To address #1, the helper journal_file_is_offlining() is called prior to
accessing f->header->state.
If journal_file_is_offlining() returns true, f->header->state isn't even
checked, because an offlining journal is obviously online, and we'll
just continue with the normal set offline code path.
If journal_file_is_offlining() returns false, then it's safe to check
f->header->state, because the offline_state is beyond the point of
modifying f->header->state, and there's a memory barrier in the helper.
If we find f->header->state is != STATE_ONLINE, then we call the
idempotent journal_file_set_offline_thread_join() on the way out of the
function, to join a potential lingering offline thread.
Lennart Poettering [Mon, 25 Apr 2016 09:57:56 +0000 (11:57 +0200)]
journalctl: turn --unit= in combination with --user into --user-unit=
Let's be nice to users, and let's turn the nonsensical "--unit=… --user" into
"--user-unit=…" which the user more likely meant.
Fixes #1621
Lennart Poettering [Mon, 25 Apr 2016 09:39:38 +0000 (11:39 +0200)]
man: document the new by-fd journal calls
Also, remove documentation for sd_journal_open_container() as we consider it
deprecated now.
Lennart Poettering [Mon, 25 Apr 2016 09:36:37 +0000 (11:36 +0200)]
man: don't include history sections in man pages
I am pretty sure we shouldn't carry history sections in man pages, since it's
very hard to keep them correctly updated, the current ones are very
out-of-date, and they tend to make APIs appear unnecessarily complex.
Lennart Poettering [Mon, 25 Apr 2016 09:31:47 +0000 (11:31 +0200)]
sd-journal: "soft" deprecate sd_journal_open_container()
Let's document the call as deprecated, since it doesn't cover containers with
directories that aren#t visible to the host properly.
Lennart Poettering [Mon, 25 Apr 2016 09:21:46 +0000 (11:21 +0200)]
journalctl: port --machine= switch to use machined's OpenMachineRootDirectory()
This way, the switch becomes compatible with nspawn containers using --image=,
and those which only store journal data in /run (i.e. have persistant logs
off).
Fixes: #49
Lennart Poettering [Mon, 25 Apr 2016 16:08:42 +0000 (18:08 +0200)]
journalctl: don't trust the per-field entry tables when looking for boot IDs
When appending to a journal file, journald will:
a) first, append the actual entry to the end of the journal file
b) second, add an offset reference to it to the global entry array stored at
the beginning of the file
c) third, add offset references to it to the per-field entry array stored at
various places of the file
The global entry array, maintained by b) is used when iterating through the
journal without matches applied.
The per-field entry array maintained by c) is used when iterating through the
journal with a match for that specific field applied.
In the wild, there are journal files where a) and b) were completed, but c)
was not before the files were abandoned. This means, that in some cases log
entries are at the end of these files that appear in the global entry array,
but not in the per-field entry array of the _BOOT_ID= field. Now, the
"journalctl --list-boots" command alternatingly uses the global entry array
and the per-field entry array of the _BOOT_ID= field. It seeks to the last
entry of a specific _BOOT_ID=field by having the right match installed, and
then jumps to the next following entry with no match installed anymore, under
the assumption this would bring it to the next boot ID. However, if the
per-field entry wasn't written fully, it might actually turn out that the
global entry array might know one more entry with the same _BOOT_ID, thus
resulting in a indefinite loop around the same _BOOT_ID.
This patch fixes that, by updating the boot search logic to always continue
reading entries until the boot ID actually changed from the previous. Thus, the
per-field entry array is used as quick jump index (i.e. as an optimization),
but not trusted otherwise. Only the global entry array is trusted.
This replaces PR #1904, which is actually very similar to this one. However,
this one actually reads the boot ID directly from the entry header, and doesn't
try to read it at all until the read pointer is actually really located on the
first item to read.
Fixes: #617
Replaces: #1904
Lennart Poettering [Mon, 25 Apr 2016 16:06:47 +0000 (18:06 +0200)]
journalctl: improve output of --header a bit
Show the various timestamps in hexadecimal too. This is useful for matching the
timestamps included in cursor strings (which are encoded in hex, too), with the
references in the journal header.
Lennart Poettering [Mon, 25 Apr 2016 15:36:51 +0000 (17:36 +0200)]
nspawn: explicitly remove veth links after use (#3111)
* sd-netlink: permit RTM_DELLINK messages with no ifindex
This is useful for removing network interfaces by name.
* nspawn: explicitly remove veth links we created after use
Sometimes the kernel keeps veth links pinned after the namespace they have been
joined to died. Let's hence explicitly remove veth links after use.
Fixes: #2173
Lennart Poettering [Mon, 25 Apr 2016 14:37:09 +0000 (16:37 +0200)]
journalctl: simplify discover_next_boot() a bit
Drop the "read_realtime" parameter. Getting the realtime timestamp from an
entry is cheap, as it is a normal header field, hence let's just get this
unconditionally, and simplify our code a bit.
Lennart Poettering [Mon, 25 Apr 2016 14:24:05 +0000 (16:24 +0200)]
journalctl: simplify get_boots() a bit, by getting rid of one BootId object
Let's store the reference as simple sd_id128_t, since we don't actually need a
BootId for it.
Lennart Poettering [Mon, 25 Apr 2016 14:23:29 +0000 (16:23 +0200)]
journalctl: add some explanatory comments to get_boots()
Lennart Poettering [Mon, 25 Apr 2016 09:16:08 +0000 (11:16 +0200)]
sd-journal: add logic to open journal files of a specific OS tree
With this change a new flag SD_JOURNAL_OS_ROOT is introduced. If specified
while opening the journal with the per-directory calls (specifically:
sd_journal_open_directory() and sd_journal_open_directory_fd()) the passed
directory is assumed to be the root directory of an OS tree, and the journal
files are searched for in /var/log/journal, /run/log/journal relative to it.
This is useful to allow usage of sd-journal on file descriptors returned by the
OpenRootDirectory() call of machined.
Lennart Poettering [Mon, 25 Apr 2016 09:13:16 +0000 (11:13 +0200)]
machined: add new OpenRootDirectory() call to Machine objects
This new call returns a file descriptor for the root directory of a container.
This file descriptor may then be used to access the rest of the container's
file system, via openat() and similar calls. Since the file descriptor returned
is for the file system namespace inside of the container it may be used to
access all files of the container exactly the way the container itself would
see them. This is particularly useful for containers run directly from
loopback media, for example via systemd-nspawn's --image= switch. It also
provides access to directories such as /run of a container that are normally
not accessible to the outside of a container.
This replaces PR #2870.
Fixes: #2870
Lennart Poettering [Sun, 24 Apr 2016 22:31:24 +0000 (00:31 +0200)]
sd-journal: add API for opening journal files or directories by fd
Also, expose this via the "journalctl --file=-" syntax for STDIN. This feature
remains undocumented though, as it is probably not too useful in real-life as
this still requires fds that support mmaping and seeking, i.e. does not work
for pipes, for which reading from STDIN is most commonly used.
Lennart Poettering [Sun, 24 Apr 2016 22:26:41 +0000 (00:26 +0200)]
sd-journal: minor simplification
Lennart Poettering [Sun, 24 Apr 2016 22:25:04 +0000 (00:25 +0200)]
journalctl: improve error message when we have trouble reading journal files
Let's output the actual error code encountered, and let's not claim this was
purely triggered by files, because it can also be triggered by directories.
Lennart Poettering [Sun, 24 Apr 2016 22:23:45 +0000 (00:23 +0200)]
sd-journal: properly collect errors from readdir()
Let's also collect errors returned by readdir() into our set of errors, like we
do this for all other errors from journal files.
Lennart Poettering [Sun, 24 Apr 2016 22:18:27 +0000 (00:18 +0200)]
journal: add inotify watches by-fd instead of by-path
This is slightly nicer, since we actually watch the directories we opened and
enumerate. However, primarily this is preparation for adding support for
opening journal files by fd without specifying any path, to be added in a later
commit.
Susant Sahani [Mon, 25 Apr 2016 07:08:56 +0000 (12:38 +0530)]
networkd: Address- initialize the node before adding to list.
It make more sense to initalize the node first then
we add to the list.
Susant Sahani [Mon, 25 Apr 2016 07:07:10 +0000 (12:37 +0530)]
networkd: Fix route properties.
We are not able to add multiple properties.
wlp3s0.network:
[Match]
Name=wlp3s0
[Route]
Gateway=10.68.5.26
Metric=10
sudo ./systemd-networkd
Failed to parse file '/usr/lib/systemd/network/wlp3s0.network': File
exists
Could not load configuration files: File exists
This patch fixes it.
Evgeny Vereshchagin [Mon, 25 Apr 2016 00:24:41 +0000 (03:24 +0300)]
tests: add test for coredump handler hanging at shutdown (#3101)
Test for #2691.
Sylvain Plantefève [Sun, 24 Apr 2016 23:56:42 +0000 (01:56 +0200)]
po: Update French translation (#3108)
Piotr Drąg [Sun, 24 Apr 2016 10:31:10 +0000 (12:31 +0200)]
catalog,po: update Polish translation (#3100)
Lennart Poettering [Sat, 23 Apr 2016 01:01:55 +0000 (03:01 +0200)]
machinectl: don't parse command line switches after "shell" verb (#3095)
Fixes: #2420
Evgeny Vereshchagin [Sat, 23 Apr 2016 00:49:47 +0000 (03:49 +0300)]
man: document the default for systemd.timer's Persistent flag (#3099)
Closes #3096
Thomas H. P. Andersen [Sat, 23 Apr 2016 00:49:07 +0000 (02:49 +0200)]
tree-wide: remove unused variables (#3098)
Zbigniew Jędrzejewski-Szmek [Fri, 22 Apr 2016 18:04:38 +0000 (14:04 -0400)]
Merge pull request #3094 from poettering/run-slice
systemd-run: fix --slice= in conjunction with --scope
Klearchos Chaloulos [Fri, 22 Apr 2016 18:04:17 +0000 (21:04 +0300)]
journal-remote : Ensure reallocation of source->buf does not result in source->size < source->filled (#3086)
While the function journal-remote-parse.c:get_line() enforces an assertion that source->filled <= source->size, in function journal-remote-parse.c:process_source() there is a chance that source->size will be decreased to a lower value than source->filled, when source->buf is reallocated. Therefore a check is added that ensures that source->buf is reallocated only when source->filled is smaller than target / 2.
Zbigniew Jędrzejewski-Szmek [Fri, 22 Apr 2016 18:03:33 +0000 (14:03 -0400)]
Merge pull request #3078 from poettering/get-processes
A variety of fixes and additions
Lennart Poettering [Fri, 22 Apr 2016 15:31:40 +0000 (17:31 +0200)]
run: make --slice= work in conjunction with --scope
Fixes: #2991
Lennart Poettering [Fri, 22 Apr 2016 15:30:08 +0000 (17:30 +0200)]
core: don't dispatch load queue when setting Slice= for transient units
Let's be more careful when setting up the Slice= property of transient units:
let's use manager_load_unit_prepare() instead of manager_load_unit(), so that
the load queue isn't dispatched right away, because our own transient unit is
in it, and we don#t want to have it loaded until we finished initializing it.
Lennart Poettering [Fri, 22 Apr 2016 15:14:30 +0000 (17:14 +0200)]
machinectl: fix misplaced newline in --help output
Lennart Poettering [Wed, 20 Apr 2016 13:27:27 +0000 (15:27 +0200)]
update TODO
Lennart Poettering [Wed, 20 Apr 2016 18:52:28 +0000 (20:52 +0200)]
man: don't claim systemd would connect stdout/stderr of daemons with /dev/null
Lennart Poettering [Wed, 20 Apr 2016 18:12:14 +0000 (20:12 +0200)]
units: order systemd-user-sessions.service after network.target
That way we can be sure that local users are logged out before the network is
shut down when the system goes down, so that SSH session should be ending
cleanly before the system goes down.
Fixes: #2390
Lennart Poettering [Wed, 20 Apr 2016 18:09:57 +0000 (20:09 +0200)]
journalctl: add --no-hostname switch
This suppresses output of the hostname for messages from the local system.
Fixes: #2342
Lennart Poettering [Wed, 20 Apr 2016 17:46:37 +0000 (19:46 +0200)]
journalctl: add output mode where time is shown in seconds since 1st Jan 1970 UTC
aka "UNIX time".
Fixes: #2120
Lennart Poettering [Wed, 20 Apr 2016 17:37:46 +0000 (19:37 +0200)]
shared: move output_mode_to_string() into output-mode.c
After all, the enum definition is in output-mode.h
Lennart Poettering [Wed, 20 Apr 2016 17:27:32 +0000 (19:27 +0200)]
coredump,basic: generalize O_TMPFILE handling a bit
This moves the O_TMPFILE handling from the coredumping code into common library
code, and generalizes it as open_tmpfile_linkable() + link_tmpfile(). The
existing open_tmpfile() function (which creates an unlinked temporary file that
cannot be linked into the fs) is renamed to open_tmpfile_unlinkable(), to make
the distinction clear. Thus, code may now choose between:
a) open_tmpfile_linkable() + link_tmpfile()
b) open_tmpfile_unlinkable()
Depending on whether they want a file that may be linked back into the fs later
on or not.
In a later commit we should probably convert fopen_temporary() to make use of
open_tmpfile_linkable().
Followup for: #3065
Lennart Poettering [Wed, 20 Apr 2016 16:28:32 +0000 (18:28 +0200)]
systemctl: add two minor assert()s
Lennart Poettering [Wed, 20 Apr 2016 16:20:51 +0000 (18:20 +0200)]
path-lookup: optimize a common strv copy operation away
Follow-up for:
https://github.com/systemd/systemd/pull/3033#discussion_r59689398
Lennart Poettering [Wed, 20 Apr 2016 16:12:57 +0000 (18:12 +0200)]
tree-wide: don't assume CLOCK_BOOTIME is generally available
Before we invoke now(CLOCK_BOOTTIME), let's make sure we actually have that
clock, since now() will otherwise hit an assert.
Specifically, let's refuse CLOCK_BOOTTIME early in sd-event if the kernel
doesn't actually support it.
This is a follow-up for #3037, and specifically:
https://github.com/systemd/systemd/pull/3037#issuecomment-
210199167
Lennart Poettering [Wed, 20 Apr 2016 15:49:31 +0000 (17:49 +0200)]
machine-id-setup: explicitly fsync() the machine ID after writing
As discussed here:
https://github.com/systemd/systemd/issues/2619#issuecomment-
184670042
Explicitly syncing /etc/machine-id after writing it, is probably a good idea,
since it has a strong "commit" character and is generally a one-time thing.
Fixes #2619.
Lennart Poettering [Wed, 20 Apr 2016 15:43:13 +0000 (17:43 +0200)]
shared: move unit-specific code from bus-util.h to bus-unit-util.h
Previously we'd have generally useful sd-bus utilities in bust-util.h,
intermixed with code that is specifically for writing clients for PID 1,
wrapping job and unit handling. Let's split the latter out and move it into
bus-unit-util.c, to make the sources a bit short and easier to grok.
Lennart Poettering [Wed, 20 Apr 2016 14:06:58 +0000 (16:06 +0200)]
shared: drop kernel_thread bool from cgroups show code
Make this an output flag instead, so that our function prototypes can lose one
parameter
Lennart Poettering [Wed, 20 Apr 2016 13:51:33 +0000 (15:51 +0200)]
loginctl,machinectl: also make use of new GetProcesses() bus call
This ports over machinectl and loginctl to also use the new GetProcesses() bus
call to show the process tree of a container or login session. This is similar
to how systemctl already has been ported over in a previous commit.
Lennart Poettering [Wed, 20 Apr 2016 13:32:24 +0000 (15:32 +0200)]
networkd: consider various IPv6 features as disabled if IPv6 is not available in the kernel
Lennart Poettering [Wed, 20 Apr 2016 13:28:28 +0000 (15:28 +0200)]
core,systemctl: add bus API to retrieve processes of a unit
This adds a new GetProcesses() bus call to the Unit object which returns an
array consisting of all PIDs, their process names, as well as their full cgroup
paths. This is then used by "systemctl status" to show the per-unit process
tree.
This has the benefit that the client-side no longer needs to access the
cgroupfs directly to show the process tree of a unit. Instead, it now uses this
new API, which means it also works if -H or -M are used correctly, as the
information from the specific host is used, and not the one from the local
system.
Fixes: #2945
Lennart Poettering [Wed, 20 Apr 2016 13:22:46 +0000 (15:22 +0200)]
shared: fix minor memory leak in log display code
frankheckenbach [Fri, 22 Apr 2016 12:21:30 +0000 (14:21 +0200)]
tmp.mount.hm4: After swap.target (#3087)
fix issue #2930
Torstein Husebø [Fri, 22 Apr 2016 12:18:05 +0000 (14:18 +0200)]
treewide: fix typos (#3092)
Lennart Poettering [Fri, 22 Apr 2016 08:56:43 +0000 (10:56 +0200)]
Merge pull request #3084 from keszybz/preset-fixes
Nicer error message is symlinking chokes on an existing file
Lennart Poettering [Fri, 22 Apr 2016 08:50:07 +0000 (10:50 +0200)]
Merge pull request #3088 from keszybz/man
One man fix and unicodification of dashes
Zbigniew Jędrzejewski-Szmek [Fri, 22 Apr 2016 02:57:06 +0000 (22:57 -0400)]
tree-wide: use mdash instead of a two minuses
Zbigniew Jędrzejewski-Szmek [Fri, 22 Apr 2016 02:52:25 +0000 (22:52 -0400)]
man: document size param of sd_journal_add_match
Fixes #1724.
Zbigniew Jędrzejewski-Szmek [Fri, 22 Apr 2016 01:11:15 +0000 (21:11 -0400)]
shared/install: always overwrite symlinks in .wants and .requires
Before:
$ systemctl preset getty@.service
Failed to preset unit, file /etc/systemd/system/getty.target.wants/getty@tty1.service
already exists and is a symlink to ../../../../usr/lib/systemd/system/getty@.service.
After:
$ systemctl preset getty@.service
Created symlink /etc/systemd/system/getty.target.wants/getty@tty1.service,
pointing to /usr/lib/systemd/system/getty@.service.
We don't really care where the symlink points to. For example, it might point
to /usr/lib or /etc, and systemd will always load the unit from /etc in
preference to /usr/lib. In fact, if we make a symlink like
/etc/systemd/system/multi-user.target.wants/b.service -> ../a.service, pid1
will still start b.service. The name of the symlink is the only thing that
matters, as far as systemd is concerned. For humans it's confusing when the
symlinks points to anything else than the actual unit file. At the very least,
the symlink is supposed to point to a file with the same name in some other
directory. Since we don't care where the symlink points, we can always replace
an existing symlink.
Another option I considered would be to simply leave an existing symlink in
place. That would work too, but replacing the symlink with the expected value
seems more intuitive.
Of course those considerations only apply to .wants and .requires. Symlinks
created with "link" and "alias" are a separate matter.
Fixes #3056.
Zbigniew Jędrzejewski-Szmek [Fri, 22 Apr 2016 00:04:21 +0000 (20:04 -0400)]
systemctl,pid1: do not warn about missing install info with "preset"
When "preset" was executed for a unit without install info, we'd warn similarly
as for "enable" and "disable". But "preset" is usually called for all units,
because the preset files are provided by the distribution, and the units are under
control of individual programs, and it's reasonable to call "preset" for all units
rather then try to do it only for the ones that can be installed.
We also don't warn about missing info for "preset-all". Thus it seems reasonable
to silently ignore units w/o install info when presetting.
(In addition, when more than one unit was specified, we'd issue the warning
only if none of them had install info. But this is probably something to fix
for enable/disable too.)
Federico [Thu, 21 Apr 2016 20:27:56 +0000 (22:27 +0200)]
hwdb: add trust illuminated mouse gxt 152 (#3085)
Zbigniew Jędrzejewski-Szmek [Thu, 21 Apr 2016 13:53:48 +0000 (09:53 -0400)]
shared/install: rewrite unit_file_changes_add()
path_kill_slashes was applied to the wrong arg...
Zbigniew Jędrzejewski-Szmek [Thu, 21 Apr 2016 13:23:18 +0000 (09:23 -0400)]
core/dbus-manager: drop unused param from installation functions
Zbigniew Jędrzejewski-Szmek [Thu, 21 Apr 2016 04:57:50 +0000 (00:57 -0400)]
shared/install: nicer error message is symlinking chokes on an existing file
Fixes #1892.
Previously:
Failed to enable unit: Invalid argument
Now:
Failed to enable unit, file /etc/systemd/system/ssh.service already exists.
It would be nice to include the unit name in the message too. I looked into
this, but it would require major surgery on the whole installation logic,
because we first create a list of things to change, and then try to apply them
in a loop. To transfer the knowledge which unit was the source of each change,
the data structures would have to be extended to carry the unit name over into
the second loop. So I'm skipping this for now.
Calvin Owens [Thu, 21 Apr 2016 17:16:28 +0000 (10:16 -0700)]
units: Add "GuessMainPID=no" to compatibility unit for rc-local (#3018)
With the current "Type=forking", systemd tries to guess the PID it
should wait on at reboot (because we have no "PIDFile="). Depending on
how wrong the guess is, we can end up hanging forever at reboot.
Asking it not to do that eliminates the problem.
Susant Sahani [Thu, 21 Apr 2016 14:08:07 +0000 (19:38 +0530)]
networkd: When link gets dirty mark manager dirty too (#3080)
If we not marking manager dirty when link is dirty then
the state file is not updated. This is a side effect of
issue 2850
setting CriticalConnection=yes
timesyncd NTP servers given by DHCP server are ignored.
Lennart Poettering [Thu, 21 Apr 2016 10:29:36 +0000 (12:29 +0200)]
Merge pull request #3005 from keszybz/kill-user-proceses
Kill user session scope by default
Martin Pitt [Thu, 21 Apr 2016 10:13:08 +0000 (12:13 +0200)]
build: fix test-nss.c build failure with --disable-{resolved,myhostname} (#3081)
When building without resolved and/or myhostname, test-nss.c failed to build
with
src/test/test-nss.c: In function 'main':
src/test/test-nss.c:417:32: error: 'MODULE1' undeclared (first use in this function)
NULSTR_FOREACH(module, MODULE1 MODULE2 MODULE3 MODULE4) {
^
Ensure that all MODULEx are always defined, and empty if the module is not
available (so that it will be a no-op in the string concatenation).
Zbigniew Jędrzejewski-Szmek [Wed, 13 Apr 2016 03:36:37 +0000 (23:36 -0400)]
shared/logs-show: fix memleak in add_matches_for_unit
Zbigniew Jędrzejewski-Szmek [Wed, 13 Apr 2016 03:35:45 +0000 (23:35 -0400)]
loginctl: show linger status in user-status
zbyszek (1002)
Since: Tue 2016-04-12 23:11:46 EDT; 23min ago
State: active
Sessions: *3
Linger: yes
Unit: user-1002.slice
├─user@1002.service
│ └─init.scope
│ ├─38 /usr/lib/systemd/systemd --user
│ └─39 (sd-pam)
└─session-3.scope
├─ 31 login -- zbyszek
├─ 44 -bash
├─15076 loginctl user-status zbyszek
└─15077 less
Zbigniew Jędrzejewski-Szmek [Wed, 13 Apr 2016 02:52:28 +0000 (22:52 -0400)]
logind: allow any user to request lingering
We enable lingering for anyone who wants this. It is still disabled by
default to avoid keeping long-running processes accidentally.
Admins might want to customize this policy on multi-user sites.
Zbigniew Jędrzejewski-Szmek [Wed, 13 Apr 2016 03:52:41 +0000 (23:52 -0400)]
logind: make KillOnlyUsers override KillUserProcesses
Instead of KillOnlyUsers being a filter for KillUserProcesses, it can now be
used to specify users to kill, independently of the KillUserProcesses
setting. Having the settings orthogonal seems to make more sense. It also
makes KillOnlyUsers symmetrical to KillExcludeUsers.
Zbigniew Jędrzejewski-Szmek [Tue, 12 Apr 2016 02:51:31 +0000 (22:51 -0400)]
build-sys: add --without-kill-user-processes configure option
Zbigniew Jędrzejewski-Szmek [Sun, 10 Apr 2016 00:40:45 +0000 (20:40 -0400)]
logind: flip KillUserProcesses to on by default
This ensures that users sessions are properly cleaned up after.
The admin can still enable or disable linger for specific users to allow
them to run processes after they log out. Doing that through the user
session is much cleaner and provides better control.
dbus daemon can now be run in the user session (with --enable-user-session,
added in 1.10.2), and most distributions opted to pick this configuration.
In the normal case it makes a lot of sense to kill remaining processes.
The exception is stuff like screen and tmux. But it's easy enough to
work around, a simple example was added to the man page in previous
commit. In the long run those services should integrate with the systemd
users session on their own.
https://bugs.freedesktop.org/show_bug.cgi?id=94508
https://github.com/systemd/systemd/issues/2900
Zbigniew Jędrzejewski-Szmek [Sat, 9 Apr 2016 20:22:08 +0000 (16:22 -0400)]
man: expand description of lingering and KillUserProcesses setting
The description in the man page was wrong, KillUserProcesses does
not kill all processes of the user. Describe what the setting
does, and also add links between the relavant sections of the
manual.
Also, add an extensive example which shows how to launch screen
in the background.
Zbigniew Jędrzejewski-Szmek [Sat, 9 Apr 2016 19:41:04 +0000 (15:41 -0400)]
man: reformat examples using <example>
Zbigniew Jędrzejewski-Szmek [Sat, 9 Apr 2016 19:03:19 +0000 (15:03 -0400)]
logind: reload config on SIGHUP
v2:
- fix setting of kill_user_processes and
*_ignore_inhibited settings
Zbigniew Jędrzejewski-Szmek [Sat, 9 Apr 2016 15:13:26 +0000 (11:13 -0400)]
core: prefix selinux messages with "selinux: "
SELinux outputs semi-random messages like "Unknown permission start for class
system", and the user has to dig into message metadata to find out where
they are comming from. Add a prefix to give a hint.
Susant Sahani [Thu, 21 Apr 2016 00:36:33 +0000 (06:06 +0530)]
networkd: respect DHCP UseRoutes option (#3075)
This fixes #2282.
Susant Sahani [Thu, 21 Apr 2016 00:34:13 +0000 (06:04 +0530)]
networkd: bump MTU to 1280 for interfaces which have IPv6 enabled (#3077)
IPv6 protocol requires a minimum MTU of 1280 bytes on the interface.
This fixes #3046.
Introduce helper link_ipv6_enabled() to figure out whether IPV6 is enabled.
Introduce network_has_static_ipv6_addresses() to find out if any static
ipv6 address configured.
If IPv6 is not configured on any interface that is SLAAC, DHCPv6 and static
IPv6 addresses not configured, then IPv6 will be automatically disabled for that
interface, that is we write "1" to /proc/sys/net/ipv6/conf//disable_ipv6.
Lennart Poettering [Wed, 20 Apr 2016 18:26:34 +0000 (20:26 +0200)]
Merge pull request #3074 from keszybz/tmpfiles
systemd-tmpfiles improvements, nspawn -E, honouring $TERM in pid1
Zbigniew Jędrzejewski-Szmek [Wed, 20 Apr 2016 04:06:25 +0000 (00:06 -0400)]
tmpfiles: add new 'e' action which cleans up a dir without creating it
I wanted to add a config line that would empty a directory
without creating it if doesn't exist. Existing actions don't allow
this.
v2: properly add 'e' to needs_glob() and takes_ownership()
Zbigniew Jędrzejewski-Szmek [Wed, 20 Apr 2016 04:03:47 +0000 (00:03 -0400)]
man: try to explain different actions in tmpfiles a bit better
- do not suggest that vendor configuration files should be in
/etc, use /usr/lib/tmpfiles.d instead
- split the first example, because the text talked about "needing
two directories", but then a smack attribute was also set, and
on a different path, which looked like a typo. Replace that
with the example from original patch [1] which added 't'.
- fix the example for /var/tmp/abrt. The 'x' line was redundant,
because /var/tmp/abrt/* is already filtered because "d /var/tmp/abrt"
overrides "d /var/tmp".
[1] http://permalink.gmane.org/gmane.comp.sysutils.systemd.devel/25051
Zbigniew Jędrzejewski-Szmek [Wed, 20 Apr 2016 02:42:00 +0000 (22:42 -0400)]
tmpfiles: shorten some long error messages
Also don't print %m when the message already contains all the info.
Zbigniew Jędrzejewski-Szmek [Wed, 20 Apr 2016 02:34:04 +0000 (22:34 -0400)]
tmpfiles: interpret "-" as stdin
Zbigniew Jędrzejewski-Szmek [Wed, 20 Apr 2016 01:56:39 +0000 (21:56 -0400)]
pid1: disable color output when TERM=dumb
This changes the behaviour of pid1 in the following ways:
- obviously $TERM is now checked,
- $SYSTEMD_COLORS is now honoured too, before only SYSTEMD_LOG_COLORS was checked,
- isatty() is run on stdout not stderr.
As requested in #3025.
Zbigniew Jędrzejewski-Szmek [Wed, 20 Apr 2016 12:41:25 +0000 (08:41 -0400)]
machinectl: add -E as alias for --setenv
Zbigniew Jędrzejewski-Szmek [Wed, 20 Apr 2016 12:38:01 +0000 (08:38 -0400)]
run: add -E as alias for --setenv
Zbigniew Jędrzejewski-Szmek [Wed, 20 Apr 2016 01:54:55 +0000 (21:54 -0400)]
nspawn: add -E as alias for --setenv
v2:
- "=" is required, so remove the <optional> tags that v1 added
Zbigniew Jędrzejewski-Szmek [Wed, 20 Apr 2016 01:30:14 +0000 (21:30 -0400)]
basic/terminal-util: cache value for colors_enabled
After all it's something that we query over and over.
For example, systemctl calls colors_enabled() four times for each failing
service. The compiler is unable to optimize those calls away because they
(potentially) accesses external and global state through on_tty() and
getenv().
Michał Bartoszkiewicz [Wed, 20 Apr 2016 08:06:26 +0000 (10:06 +0200)]
logind: use type to determine graphical sessions (#3071)
Franck Bui [Wed, 20 Apr 2016 01:18:17 +0000 (03:18 +0200)]
systemctl: hide "following" units if '--all' is not passed (#2967)
No need to dump all the redundant device units on the user, just because he
specified that he wants to see units of a specific state.
This was broken by commit
ebc962656cee33e3e8395f456a8208c3ca41969c.
Lennart Poettering [Tue, 19 Apr 2016 15:21:18 +0000 (17:21 +0200)]
Merge pull request #3055 from keszybz/preset-fixes
Another bunch of improvements to the installation code
Evgeny Vereshchagin [Tue, 19 Apr 2016 14:59:47 +0000 (17:59 +0300)]
coredump: create unnamed temporary files if possible (O_TMPFILE) (#3065)
Don't leave temporary files if the coredump service is aborted during
the operation
Yeah, these are temporary files that systemd-coredump needs while
processing the coredumps. Of course, if the coredump service is aborted
during the operation we better shouldn't leave those files around. This
is hence a bug to fix in our coredumping code.
See https://github.com/systemd/systemd/issues/2804#issuecomment-
210578147
Another option is to simply use O_TMPFILE, and when it is not available
fall back to the current behaviour. After all, the files are cleaned up
eventually, through normal tmpfiles aging, and the offending file
systems are pretty exotic these days, or not in the upstream kernel.
See https://github.com/systemd/systemd/issues/2804#issuecomment-
211496707