Commit Graph
12863 Commits
Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 941652e920 logind: fail user creation is slice creation fails
If the slice wasn't set, logind would core dump later in the process:
systemd-logind[2672]: Assertion 's->user->slice' failed at ../src/login/logind-session.c:531, function session_start_scope().

https://bugzilla.redhat.com/show_bug.cgi?id=1182781
2015-01-27 16:36:17 -05:00
Zbigniew Jędrzejewski-Szmek 75a17dd008 udev: bump event timeout in two more places
https://bugzilla.redhat.com/show_bug.cgi?id=1091513
2014-11-06 17:34:47 -05:00
Zbigniew Jędrzejewski-Szmek 136e59d275 zsh-completion: update start/restart completions
Now zsh should behave the same for those two subcommands as bash.

(cherry picked from commit 81333ecf9d)
2014-10-30 00:18:44 -04:00
Zbigniew Jędrzejewski-Szmek ad894f24df bash-completion: use improved filtering to make things faster
(cherry picked from commit 372b221166)
2014-10-30 00:18:35 -04:00
Zbigniew Jędrzejewski-Szmek f971bf69e3 systemctl: obey --state in list-unit-files
(cherry picked from commit fec1530e6b)

Conflicts:
	src/systemctl/systemctl.c
2014-10-30 00:18:24 -04:00
Zbigniew Jędrzejewski-Szmek 281593c1e9 systemctl: let list-{units,unit-files } honour --type
The docs don't clarify what is expected, but I don't see any reason
why --type should be ignored.

Also restucture the compund conditions into separate clauses for
easier reading.

(cherry picked from commit 6c71341aee)

Conflicts:
	src/systemctl/systemctl.c
2014-10-30 00:13:42 -04:00
Zbigniew Jędrzejewski-Szmek b5d7c81b89 bash-completion: rework startable/restartable units once more
I tried to use 'systemctl --all list-units' to filter unit files, but
this always filters out unit files which are not loaded. We want to complete
systemctl start with those units too, so this approach is not going to work.

New version is rather slow, but hopefully correct.

(cherry picked from commit 9ff8af5460)
2014-10-30 00:03:38 -04:00
Zbigniew Jędrzejewski-Szmek 2a7401c74e shell-completion: systemctl set-default,get-default,is-system-running
(cherry picked from commit 1cf3c30c07)

Conflicts:
	TODO
	shell-completion/bash/systemctl.in

[stable: removed changes for is-system-running]
2014-10-30 00:01:56 -04:00
Tom Gundersen e02f23eef7 units: tmpfiles-setup-dev - allow unsafe file creation to happen in /dev at boot
This will allow us to mark static device nodes with '!' to indicate that they should only be created at early boot.

(cherry picked from commit 8c94052ee5)
2014-10-29 23:56:56 -04:00
Zbigniew Jędrzejewski-Szmek bb69bfce89 Update hwdb/60-keyboard.hwdb to version from master
Synchronized to v216-759-gcaa2f4c0c9.
2014-10-26 18:23:47 -04:00
Tom Gundersen 7013bbe99f udev: timeout - increase timeout
Some kernel modules still take more than one minute to insmod, we no longer rely on the timeout
killing insmod within a given period of time, so just bump this to a much higher value. Its only
purpose is to make sure that nothing stays aronud forever.

(cherry picked from commit b5338a1986)

Conflicts:
	src/udev/udevd.c

[zj: This commit is not really similar to b533... at all, but hopefuly the result is alike.]
2014-10-26 18:23:47 -04:00
Zbigniew Jędrzejewski-Szmek d61ca0aa19 core: do not add dependencies to self
Adds a pair of files which cause a segfault (also with
systemd-analyze verify).

https://bugzilla.redhat.com/show_bug.cgi?id=1124843
(cherry picked from commit e66047ff62)
2014-10-26 18:23:47 -04:00
Zbigniew Jędrzejewski-Szmek daf3702ded core: some more _cleanup_free_
(cherry picked from commit e48614c4b2)
2014-10-26 18:23:47 -04:00
Zbigniew Jędrzejewski-Szmek 36f1284c3f journalctl,man: allow + only between terms
https://bugzilla.redhat.com/show_bug.cgi?id=1110712
(cherry picked from commit 4e60294351)

Conflicts:
	man/journalctl.xml
2014-10-26 18:23:47 -04:00
Zbigniew Jędrzejewski-Szmek 8382dfb6c2 systemctl: do not ignore errors in symlink removal
On an ro fs, systemctl disable ... would fail silently.

(cherry picked from commit e95c98378a)
2014-10-26 18:23:47 -04:00
Zbigniew Jędrzejewski-Szmek d616ea839b calendarspec: fix typo in "annually"
https://bugs.freedesktop.org/show_bug.cgi?id=85447
(cherry picked from commit e90efc7090)
2014-10-26 18:23:47 -04:00
Santiago Vila 41d0281745 journalctl: correct help text for --until
http://bugs.debian.org/766598
(cherry picked from commit 7558251eef)
2014-10-26 18:23:47 -04:00
Jan Synacek e565759b07 man: fix localectl set-x11-keymap syntax description
(cherry picked from commit cd4c6fb125)
2014-10-26 18:23:47 -04:00
Lukas Nykryn 9033ca38ce man: we don't have 'Wanted' dependency
(cherry picked from commit 3e883473a0)
2014-10-26 18:23:47 -04:00
Zbigniew Jędrzejewski-Szmek 54a21e301c shell-completion: propose templates for disable/[re]enable/[re]start
Templates can be [re]enabled, on their own if the have DefaultInstance set,
and with an instance suffix in all cases. Propose just the template name
ending in @, to underline the instance suffix may have to be appended.

Likewise for start/restart.

This means that sometimes superflous units that one will not really
want to operate on will be proposed, but this seems better than
proposing a very incomplete set of names.

https://bugs.freedesktop.org/show_bug.cgi?id=66912
(cherry picked from commit e9a19bd882)
2014-10-26 18:23:47 -04:00
Zbigniew Jędrzejewski-Szmek 26df33449f shell-completion: fix completion of inactive units
Units which not loaded were not proposed properly. OTOH, we should
filter units from get-unit-files by their state if they are currently
loaded. Bring zsh completions in line with bash completion, the same
logic should be used in both implementations.

https://bugzilla.redhat.com/show_bug.cgi?id=1024379
https://bugzilla.redhat.com/show_bug.cgi?id=790768
https://bugs.freedesktop.org/show_bug.cgi?id=84720
(cherry picked from commit f29c77bc01)
2014-10-26 18:23:47 -04:00
Dave Reisner 1016e13e6a completion: filter templates from restartable units
Since c6a373a263, we might encounter unit templates via the
'list-units' verb. These aren't restartable (and we throw errors), so
make sure they're filtered out of the completion options.

fixes downstream bug: https://bugs.archlinux.org/task/41719

(cherry picked from commit ec15977a3c)
2014-10-26 18:23:46 -04:00
Eric Cook ab5543f5af shell-completion: prevent mangling unit names (bash)
This fixes the issue noted by Zbigniew in most cases.
if a unit's name is enclosed in single quotes completion still
will not happen after the first `\'.

https://bugs.freedesktop.org/show_bug.cgi?id=78388
(cherry picked from commit c317a1a19c)
2014-10-26 18:23:46 -04:00
Zbigniew Jędrzejewski-Szmek 8c2e21cf4a bash-completion: use list-unit-files to get "all" units
I think that it is better to return good results slightly more slowly,
than partial quickly. Also reading from disk seems fast enough. Even
the delay on first try with completely cold cache is acceptable.

This is just for bash, 'cause zsh was already doing this.

https://bugzilla.redhat.com/show_bug.cgi?id=790768
(cherry picked from commit c6a373a263)
2014-10-26 18:23:46 -04:00
Eric Cook 9d657ea294 shell-completion: prevent mangling unit names
Units with literal hex '\xFF' in their names has to be read
and printed properly.
dev-disk-byx2dlabel-root.device != dev-disk-by\x2dlabel-root.device

(cherry picked from commit 6d314eca15)
2014-10-26 18:23:46 -04:00
Zbigniew Jędrzejewski-Szmek b76c90d451 shell-completion: systemd-analyze verify, systemctl link
Some zsh completion helpers were not installed, so completion
was broken.

Add systemd-analyze verify. Make systemctl link complete only
unit names.

(cherry picked from commit 2c12a402cb)

Conflicts:
	TODO

[backport: undo verify and busname changes]
2014-10-26 18:23:46 -04:00
William Giokas 7919b87d1f zsh-completion: Move output modes to autoload
(cherry picked from commit a02c5fe7cb)
2014-10-26 18:23:46 -04:00
Zbigniew Jędrzejewski-Szmek c2e540291d shell-completion: restore completion for -p
It was broken since systemd was moved out of /bin.

For zsh it was never there.

(cherry picked from commit c0a67aef31)

Conflicts:
	Makefile.am
2014-10-26 18:23:46 -04:00
Dave Reisner fd764e8bee python-systemd: avoid hitting assert in __exit__
Reader_close() asserts that 'args' is always NULL, but the __exit__
function forwards a non-NULL args.

(cherry picked from commit 9ff5ff320e)

Conflicts:
	src/python-systemd/_reader.c
2014-10-26 18:23:46 -04:00
Zbigniew Jędrzejewski-Szmek 18c4d58b79 journalctl: use pager for --list-boots
(cherry picked from commit cab9b000f2)
2014-10-26 18:23:46 -04:00
Jan Janssen 2f3668cecb sd-journal: fix sd_journal_enumerate_unique skipping values
sd_journal_enumerate_unique will lock its mmap window to prevent it
from being released by calling mmap_cache_get with keep_always=true.
This call may return windows that are wider, but compatible with the
parameters provided to it.

This can result in a mismatch where the window to be released cannot
properly be selected, because we have more than one window matching the
parameters of mmap_cache_release. Therefore, introduce a release_cookie
to be used when releasing the window.

https://bugs.freedesktop.org/show_bug.cgi?id=79380
(cherry picked from commit 06cc69d44c)
2014-10-26 18:23:46 -04:00
Zbigniew Jędrzejewski-Szmek 2bbdcbc828 sd-journal: change check to assert
As of 0f99f74a14 'sd-journal: verify that object start with the field
name' this condition should never happen.

(cherry picked from commit 853bd5cc72)
2014-10-26 18:23:46 -04:00
Zbigniew Jędrzejewski-Szmek 078634bd4d sd-journal: do not reset sd_j_enumerate_unique position on error
systemctl would call sd_j_enumerate_unique() interleaved with
sd_j_next(). But the latter can remove a file if it detects an
error in it. In those circumstances sd_j_enumerate_unique would
restart with the first file in hashmap. With many corrupted files
sd_j_enumerate_unique might iterate over the list multiple times.

Avoid this by jumping to the next file in unique list if possible,
or setting a flag that tells sd_j_enumerate_unique that it is done
otherwise.

(cherry picked from commit 360af4cf6f)
2014-10-26 18:23:46 -04:00
Lennart Poettering 28592f75d4 man: document the new "rescue" kernel command line option
(cherry picked from commit f280bcfb21)
2014-10-26 18:23:46 -04:00
Jan Synacek 8b2e770d7d man/systemctl: document enable on masked units
(cherry picked from commit 751ea8deaf)

Conflicts:
	man/systemctl.xml
2014-10-26 18:23:45 -04:00
Mantas Mikulėnas 7403f4d6d7 core: map the 'rescue' argument to rescue.target
Even though the 'emergency' and 'single' aliases come from sysvinit, the
lack of 'rescue' is still quite confusing (caught me by surprise for the
9th time yet) and inconsistent with `systemctl rescue` as well.

(cherry picked from commit 5329ab10ff)
2014-10-26 18:23:45 -04:00
Jan Synacek 75f86204f4 core: don't allow enabling if unit is masked
(cherry picked from commit f7101b7368)
2014-10-26 18:23:45 -04:00
Zbigniew Jędrzejewski-Szmek ba0b742a83 fileio-label: return error when writing fails
The status of actually writing the file was totally ignored.

(cherry picked from commit 754fc0c720)
2014-10-26 18:23:45 -04:00
Thomas Hindoe Paaboel Andersen 48fe5cdcf1 bootchart: use 'n/a' if PRETTY_NAME is not found
Spotted with coverity. If parsing both /etc/os-release and
/usr/lib/os-release fails then null would be passed on. The calls
to parse the two files are allowed to fail. A empty /etc may not
have had the /etc/os-release symlink restored yet and we just
try again in the loop. If for whatever reason that does not happen
then we now pass on 'n/a' instead of null.

(cherry picked from commit 1c92ff85b7)
2014-10-26 18:23:45 -04:00
Marcel Holtmann 8597690cf9 hwdb: Update database of Bluetooth company identifiers
(cherry picked from commit 2e3390ea46)
2014-10-26 18:23:45 -04:00
Zbigniew Jędrzejewski-Szmek 50a1e52b12 journalctl: do not output --reboot-- markers when running non-interactively
They are not legal in the export format.

(cherry picked from commit 4bed248505)
2014-10-26 18:23:45 -04:00
Koen Kooi 644af8bba1 logind: add support for TPS65217 Power Button
This PMIC is found on TI AM335x based boards like the beaglebone and
beaglebone black.

root@beaglebone-white:~# udevadm info -a /dev/input/event0

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device
'/devices/ocp.3/44e0b000.i2c/i2c-0/0-0024/input/input0/event0':
    KERNEL=="event0"
    SUBSYSTEM=="input"
    DRIVER==""

  looking at parent device
'/devices/ocp.3/44e0b000.i2c/i2c-0/0-0024/input/input0':
    KERNELS=="input0"
    SUBSYSTEMS=="input"
    DRIVERS==""
    ATTRS{name}=="tps65217_pwr_but"
    ATTRS{phys}==""
    ATTRS{uniq}==""
    ATTRS{properties}=="0"

  looking at parent device '/devices/ocp.3/44e0b000.i2c/i2c-0/0-0024':
    KERNELS=="0-0024"
    SUBSYSTEMS=="i2c"
    DRIVERS=="tps65217"
    ATTRS{name}=="tps65217"

  looking at parent device '/devices/ocp.3/44e0b000.i2c/i2c-0':
    KERNELS=="i2c-0"
    SUBSYSTEMS=="i2c"
    DRIVERS==""
    ATTRS{name}=="OMAP I2C adapter"

  looking at parent device '/devices/ocp.3/44e0b000.i2c':
    KERNELS=="44e0b000.i2c"
    SUBSYSTEMS=="platform"
    DRIVERS=="omap_i2c"

  looking at parent device '/devices/ocp.3':
    KERNELS=="ocp.3"
    SUBSYSTEMS=="platform"
    DRIVERS==""

(cherry picked from commit 492d7a3038)
2014-10-26 18:23:45 -04:00
Eric Cook b97a348e31 shell-completion(zsh): journalctl's -b changes
removed pointless index sort of bootids.
use `compadd -a' to add each array, instead of expanding possibly hundreds of words needlessly.
optional completion of -b

(cherry picked from commit c2026f28bd)
2014-10-26 18:23:45 -04:00
Richard Weinberger b66559b11f systemd-tmpfiles: Fix IGNORE_DIRECTORY_PATH age handling
If one has a config like:
d /tmp 1777 root root -
X /tmp/important_mount

All files below /tmp/important_mount will be deleted as the
/tmp/important_mount item will spuriously inherit a max age of 0
from /tmp.
/tmp has a max age of 0 but age_set is (of course) false.

This affects also the PrivateTmp feature of systemd.
All tmp files of such services will be deleted unconditionally
and can cause service failures and data loss.

Fix this by checking ->age_set in the IGNORE_DIRECTORY_PATH logic.

(cherry picked from commit 9ed2a35e93)
2014-10-26 18:23:45 -04:00
Zbigniew Jędrzejewski-Szmek 387a5a9345 logind: add support for Triton2 Power Button
https://bugs.freedesktop.org/show_bug.cgi?id=84201
(cherry picked from commit 58d4aabedd)
2014-10-26 18:23:45 -04:00
Michael Marineau c6ba31f718 man: use the escape for "-" in example instead of space.
This sentence can be misread to mean that "\x20" is the escape code for
"-" which is the only character explicitly mentioned. This lead to at
least one user loosing hair over why a mount unit for "/foo/bar-baz"
didn't work. The example escape is arbitrary so lets prevent hair loss.

(cherry picked from commit fb7661a602)
2014-10-26 18:23:45 -04:00
Tom Gundersen fb6d069db2 udev: rules - close empty file
If the file is found to be empty, we exit early without closing the file first.

Found by coverity. Fixes CID #1237759.

(cherry picked from commit 6c8aaf0c1b)

Conflicts:
	src/udev/udev-rules.c
2014-10-26 18:23:45 -04:00
Dave Reisner 08b4f3f8e3 core: use correct function to free CalendarSpec
(cherry picked from commit eed9386748)
2014-10-26 18:23:45 -04:00
Thomas Hindoe Paaboel Andersen f9a500bd5b core: fix a potential mem leak
Found with Coverity. Fixes: CID#996438

(cherry picked from commit 4d5e13a125)
2014-10-26 18:23:45 -04:00
Philippe De Swert a630a10d74 core: smack-setup: Actually allow for succesfully loading CIPSO policy
The line under the last switch statement  *loaded_policy = true;
would never be executed. As all switch cases return 0. Thus the
policy would never be marked as loaded.

Found with Coverity. Fixes: CID#1237785

(cherry picked from commit b9289d4c6e)
2014-10-26 18:23:44 -04:00