Commit graph

25602 commits

Author SHA1 Message Date
Evgeny Vereshchagin 4f4d6ee4be tests: add test for coredump handler hanging at shutdown (#3101)
Test for #2691.
2016-04-24 20:24:41 -04:00
Sylvain Plantefève 3b2df79b66 po: Update French translation (#3108) 2016-04-24 19:56:42 -04:00
Piotr Drąg 530d4b7064 catalog,po: update Polish translation (#3100) 2016-04-24 12:31:10 +02:00
Lennart Poettering 368d264387 machinectl: don't parse command line switches after "shell" verb (#3095)
Fixes: #2420
2016-04-22 21:01:55 -04:00
Evgeny Vereshchagin 07bd0e02ef man: document the default for systemd.timer's Persistent flag (#3099)
Closes #3096
2016-04-22 20:49:47 -04:00
Thomas H. P. Andersen 0f5e13822d tree-wide: remove unused variables (#3098) 2016-04-22 20:49:07 -04:00
Zbigniew Jędrzejewski-Szmek 86ec5e5e29 Merge pull request #3094 from poettering/run-slice
systemd-run: fix --slice= in conjunction with --scope
2016-04-22 14:04:38 -04:00
Klearchos Chaloulos 9ba37525d0 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.
2016-04-22 14:04:17 -04:00
Zbigniew Jędrzejewski-Szmek 47cb7f723a Merge pull request #3078 from poettering/get-processes
A variety of fixes and additions
2016-04-22 14:03:33 -04:00
Lennart Poettering 37e605f934 run: make --slice= work in conjunction with --scope
Fixes: #2991
2016-04-22 17:31:40 +02:00
Lennart Poettering aea529e5b2 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.
2016-04-22 17:30:08 +02:00
Lennart Poettering 5bda1f47b3 machinectl: fix misplaced newline in --help output 2016-04-22 17:14:30 +02:00
Lennart Poettering b8c7afdf4b update TODO 2016-04-22 16:18:32 +02:00
Lennart Poettering b9a049b1fb man: don't claim systemd would connect stdout/stderr of daemons with /dev/null 2016-04-22 16:17:00 +02:00
Lennart Poettering 8c85680478 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
2016-04-22 16:17:00 +02:00
Lennart Poettering 991e274b61 journalctl: add --no-hostname switch
This suppresses output of the hostname for messages from the local system.

Fixes: #2342
2016-04-22 16:16:59 +02:00
Lennart Poettering bb321ed9a3 journalctl: add output mode where time is shown in seconds since 1st Jan 1970 UTC
aka "UNIX time".

Fixes: #2120
2016-04-22 16:16:59 +02:00
Lennart Poettering 766cd08152 shared: move output_mode_to_string() into output-mode.c
After all, the enum definition is in output-mode.h
2016-04-22 16:16:59 +02:00
Lennart Poettering 03532f0ae0 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
2016-04-22 16:16:53 +02:00
Lennart Poettering f8591ee1b6 systemctl: add two minor assert()s 2016-04-22 16:06:20 +02:00
Lennart Poettering 8f1e0ad415 path-lookup: optimize a common strv copy operation away
Follow-up for:

https://github.com/systemd/systemd/pull/3033#discussion_r59689398
2016-04-22 16:06:20 +02:00
Lennart Poettering 3411372e35 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
2016-04-22 16:06:20 +02:00
Lennart Poettering f53d86c929 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.
2016-04-22 16:06:20 +02:00
Lennart Poettering 20b1644140 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.
2016-04-22 16:06:20 +02:00
Lennart Poettering 0ff308c8de shared: drop kernel_thread bool from cgroups show code
Make this an output flag instead, so that our function prototypes can lose one
parameter
2016-04-22 16:06:20 +02:00
Lennart Poettering a0e270198a 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.
2016-04-22 16:06:20 +02:00
Lennart Poettering fa7099927c networkd: consider various IPv6 features as disabled if IPv6 is not available in the kernel 2016-04-22 16:06:20 +02:00
Lennart Poettering 291d565a04 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
2016-04-22 16:06:20 +02:00
Lennart Poettering 2b45d88163 shared: fix minor memory leak in log display code 2016-04-22 16:06:20 +02:00
frankheckenbach a11fe93e04 tmp.mount.hm4: After swap.target (#3087)
fix issue #2930
2016-04-22 14:21:30 +02:00
Torstein Husebø 4f25723c14 treewide: fix typos (#3092) 2016-04-22 14:18:05 +02:00
Lennart Poettering fcf008f866 Merge pull request #3084 from keszybz/preset-fixes
Nicer error message is symlinking chokes on an existing file
2016-04-22 10:56:43 +02:00
Lennart Poettering c54f168f14 Merge pull request #3088 from keszybz/man
One man fix and unicodification of dashes
2016-04-22 10:50:07 +02:00
Zbigniew Jędrzejewski-Szmek ccddd104fc tree-wide: use mdash instead of a two minuses 2016-04-21 23:00:13 -04:00
Zbigniew Jędrzejewski-Szmek fb0c7174e3 man: document size param of sd_journal_add_match
Fixes #1724.
2016-04-21 22:56:44 -04:00
Zbigniew Jędrzejewski-Szmek 29380daff5 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.
2016-04-21 22:12:07 -04:00
Zbigniew Jędrzejewski-Szmek 39207373dd 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.)
2016-04-21 20:04:21 -04:00
Federico 5f390fc01c hwdb: add trust illuminated mouse gxt 152 (#3085) 2016-04-21 16:27:56 -04:00
Zbigniew Jędrzejewski-Szmek 12bf0ae4c6 shared/install: rewrite unit_file_changes_add()
path_kill_slashes was applied to the wrong arg...
2016-04-21 13:55:40 -04:00
Zbigniew Jędrzejewski-Szmek 9a7c402b2a core/dbus-manager: drop unused param from installation functions 2016-04-21 13:41:59 -04:00
Zbigniew Jędrzejewski-Szmek 7d782f265d 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.
2016-04-21 13:41:59 -04:00
Calvin Owens 7797fd2470 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.
2016-04-21 19:16:28 +02:00
Susant Sahani 0c241a378d 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.
2016-04-21 16:08:07 +02:00
Lennart Poettering 52b9b66b7d Merge pull request #3005 from keszybz/kill-user-proceses
Kill user session scope by default
2016-04-21 12:29:36 +02:00
Martin Pitt 48062f072c 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).
2016-04-21 12:13:08 +02:00
Zbigniew Jędrzejewski-Szmek 42fbdf4586 shared/logs-show: fix memleak in add_matches_for_unit 2016-04-21 00:21:33 -04:00
Zbigniew Jędrzejewski-Szmek 26e00f0e6a 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
2016-04-21 00:21:33 -04:00
Zbigniew Jędrzejewski-Szmek 152199f2d7 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.
2016-04-21 00:21:33 -04:00
Zbigniew Jędrzejewski-Szmek 921f831d3e 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.
2016-04-21 00:21:33 -04:00
Zbigniew Jędrzejewski-Szmek 95365a576f build-sys: add --without-kill-user-processes configure option 2016-04-21 00:21:32 -04:00