Commit Graph
17787 Commits
Author SHA1 Message Date
Umut Tezduyar Lindskog 171335eb58 sysctl: consider --prefix while parsing the files
not while applying the parsed sysctl values. Otherwise
info "Overwriting earlier assignment of %s in file %s" is
visible many times even though the given --prefix doesn't
try to set the overridden value.

This also optimizes the startup tiny bit since we have udev
rules running on network devices and setting sysctl through
the rules.

(cherry picked from commit b99802f769)
2015-03-23 01:58:16 -04:00
Zbigniew Jędrzejewski-Szmek 2586e65f45 build-sys: remove reference to long gone file
Interesting that automake doesn't complain about this at all.
That file was removed in 3fb97a58fa.

(cherry picked from commit a08d90d6b3)
2015-03-23 01:57:57 -04:00
Zbigniew Jędrzejewski-Szmek 4d97551673 shared/log: read /proc/cmdline only in daemons
http://lists.freedesktop.org/archives/systemd-devel/2015-February/027960.html
(cherry picked from commit ee46e55570)

Conflicts:
	src/shared/log.c
2015-03-23 01:54:10 -04:00
Ivan Shapovalov b4b97da010 systemctl: cat: fix error handling
- correctly check for local vs. remote transport
- return after receiving error from expand_names()

(cherry picked from commit 3e7eed8497)

Conflicts:
	src/systemctl/systemctl.c
2015-02-05 14:23:46 -05:00
Zbigniew Jędrzejewski-Szmek 795fcf13d2 systemctl: refuse --host with cat
This might be fixed one day, but for now it's better to fail.

https://bugzilla.redhat.com/show_bug.cgi?id=1186952
(cherry picked from commit 3e495a6651)

Conflicts:
	src/systemctl/systemctl.c
2015-02-05 14:18:51 -05:00
Zbigniew Jędrzejewski-Szmek 76b8ed8042 notify,firstboot,analyze,run: trim --help output to 80 lines
(cherry picked from commit b57b06258e)

Conflicts:
	src/notify/notify.c
	src/run/run.c
2015-02-05 14:16:08 -05:00
Zbigniew Jędrzejewski-Szmek f7b7a2c937 journalctl: trim --help to fit in 80 columns
Terminals tend to be 80 columns wide by default, and the help
text is only supposed to be a terse reminder anyway.

https://bugzilla.redhat.com/show_bug.cgi?id=1183771
(cherry picked from commit 40f0b71b06)

Conflicts:
	src/journal/journalctl.c
2015-02-05 14:14:03 -05:00
Zbigniew Jędrzejewski-Szmek 097e69a5fa sleep: do not use strappenda in var declaration
Based on e2cc6eca73.

https://bugzilla.redhat.com/show_bug.cgi?id=1147610
2015-02-05 14:09:34 -05:00
Lennart Poettering 838ec2a9a6 units: so far we defaulted to 90s as default timeout for most things, let's do so for our oneshot services too
Fewer surprises, and stuff...

(cherry picked from commit 75f709fbf2)
2015-02-05 09:05:55 -05:00
Martin Pitt 66eb624c22 cryptsetup: only warn on real key files
Simplify the check from commit 05f73ad to only apply the warning to regular
files instead of enumerating device nodes.

(cherry picked from commit 3f4d56a069)
2015-02-05 09:05:20 -05:00
Cristian Rodríguez 71e27642c3 cryptsetup: Do not warn If the key is /dev/*random
Using /dev/urandom as a key is valid for swap, do not
warn if this devices are world readable.

(cherry picked from commit 05f73ad22b)
2015-02-05 09:05:06 -05:00
Marcel Holtmann ef51af0c9e hwdb: Update database of Bluetooth company identifiers
(cherry picked from commit 3cc711193d)
2015-02-05 09:04:51 -05:00
Zbigniew Jędrzejewski-Szmek 7f7f58a080 units: set TimeoutSec on some oneshot services
Services which are not crucial to system bootup, and have Type=oneshot
can effectively "hang" the system if they fail to complete for whatever
reason. To allow the boot to continue, kill them after a timeout.

In case of systemd-journal-flush the flush will continue in the background,
and in the other two cases the job will be aborted, but this should not
result in any permanent problem.

(cherry picked from commit 0775b9b611)
2015-02-05 09:04:05 -05:00
Maxim Mikityanskiy de879b0c31 core: make setting the shutdown watchdog configuration via dbus work
https://bugs.freedesktop.org/show_bug.cgi?id=88284
(cherry picked from commit 81f5fc2d43)

Conflicts:
	src/core/main.c
2015-02-05 09:03:35 -05:00
Christian Seiler 8ce77d0b80 logind: remove per-user runtime dir again if setup fails
If setup of per-user runtime dir fails, clean up afterwards by removing
the directory before returning from the function, so we don't leave the
directory behind.

If this is not done, the second time the user logs in logind would
assume that the directory is already set up, even though it isn't.

(cherry picked from commit 4d858e7d9f)

Conflicts:
	src/login/logind-user.c
2015-02-05 08:56:54 -05:00
Zbigniew Jędrzejewski-Szmek f0e9c36257 system-update-generator: accept a dangling symlink
The offline update mechanism is explicitly designed to work with a
separate /var. systemd-update-generator is supposed to run early,
before filesystems are mounted, so it cannot check if the
/system-update symlink actually points to anything.

The update is run *after* filesystems are mounted, so it should be
able to access the target of the symlink without trouble.

https://bugzilla.redhat.com/show_bug.cgi?id=1178978
(cherry picked from commit 6b321a7901)
2015-02-05 08:56:11 -05:00
Sangjung Woo c0008e613b systemctl: bugfix for systemctl reboot command with argument
According to systemctl man page, 'systemctl reboot [arg]' should work
without any errors. However, it does not work because of 'Invalid number
of arguments' error, except for 'reboot [arg]'. This patch fixes the bug
so that both of commands work in exactly the same way.

(cherry picked from commit b986229efe)
2015-02-05 08:47:56 -05:00
Lennart Poettering 93d88c5b4d sd-bus: fix handling of double parameters in sd_bus_message_append()
We really need to use va_arg() with the right type here as uint64_t and
double might have the same size, but are passed differently as
arguments.

(cherry picked from commit 6cd37a5e59)
2015-02-05 08:46:12 -05:00
Zbigniew Jędrzejewski-Szmek a64a24640c core/cgroup: fix embarrassing typo
https://github.com/docker/docker/issues/10280
(cherry picked from commit a3bd89ea99)
2015-01-31 23:06:12 -05:00
Peter Hutterer 2b5a60aca8 logind: fix sd_eviocrevoke ioctl call
If the third argument is non-null, the kernel will always error out with
EINVAL and devices won't get revoked.

Reported-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 8dbce34b03)
2015-01-22 10:57:30 -05:00
Cristian Rodríguez 8874d83156 sysv-generator: only allow regular files in enumerate_sysv()
Otherwise, if the directory contains other directories we fail
at fopen in load_sysv() with EISDIR.

(cherry picked from commit 0814f65ec6)

Conflicts:
	src/sysv-generator/sysv-generator.c
2015-01-22 10:56:29 -05:00
Zbigniew Jędrzejewski-Szmek 02df848079 tmpfiles: make sure not to concatenate non-absolute path
If the path is absolute was only checked later.
Also do not check if path if absolute if we just
specified it starting with a slash.

(cherry picked from commit 222c47f476)
2015-01-22 10:54:51 -05:00
Martin Pitt 1fe7022917 util: Add some missing hidden_file() suffixes
dpkg itself also uses *.dpkg-dist, while .dpkg-{bak,backup,remove} are being
used by dpkg-maintscript-helper.

(cherry picked from commit c7088e4999)
2015-01-22 10:50:25 -05:00
Martin Pitt cd1694328b sysv-generator: Handle .sh suffixes when translating Provides:
When deciding whether the provided name equals the file name in
sysv_translate_facility(), also consider them equal if the file name has a
".sh" suffix.

This was uncovered by commit b7e7184 which then created a symlink
"<name>.service" to itself for ".sh" suffixed init.d scripts.

For additional robustness, refuse to create symlinks to itself in add_alias().

Add test case which reproduces the bug.

https://bugs.debian.org/775889
(cherry picked from commit 29e0e6d8c1)

Conflicts:
	test/sysv-generator-test.py
2015-01-22 10:50:12 -05:00
Christian Seiler 260a413d76 journal: Fix syslog forwarding without CAP_SYS_ADMIN
In case CAP_SYS_ADMIN is missing (like in containers), one cannot fake pid in
struct ucred (uid/gid are fine if CAP_SETUID/CAP_SETGID are present).

Ensure that journald will try again to forward the messages to syslog without
faking the SCM_CREDENTIALS pid (which isn't guaranteed to succeed anyway, since
it also does the same thing if the process has already exited).

With this patch, journald will no longer silently discard messages
that are supposed to be sent to syslog in these situations.

https://bugs.debian.org/775067
(cherry picked from commit ccf23ad5fa)
2015-01-22 10:49:36 -05:00
Wieland Hoffmann ca6494000f zsh-completion: Do not interpret escape sequences in _filter_units_by_property
This makes all functions that rely on _filter_units_by_property() (like
_systemctl_{stop,kill,try_restart}) work with unit names that contain backslash
escaped sequences (like automount units with spaces that are escaped to
"\x20").

(cherry picked from commit e37b56c735)
2015-01-22 10:49:20 -05:00
Topi Miettinen 26ba2d2143 timesyncd: consider too long packets as invalid
If the received NTP message from server didn't fit to our buffer, either
it is doing something nasty or we don't know the protocol. Consider the
packet as invalid.

(David: add parantheses around conditional)

(cherry picked from commit 43fcd650e5)
2015-01-22 10:45:40 -05:00
Maxim Mikityanskiy 413b578179 hwdb: restore comments about MSI devices
Some time ago 95-keymap.rules was replaced by
60-keyboard.hwdb. Original comments for MSI laptops (that were in
95-keymap.rules) were removed, but I think they are important for
understanding what's going on.

https://bugs.freedesktop.org/show_bug.cgi?id=88412
(cherry picked from commit 288026bda9)
2015-01-22 10:44:39 -05:00
Ray Strode 5b9f8f0a47 login: rerun vconsole-setup when switching from vgacon to fbcon
The initialization performed by systemd-vconsole-setup is reset
when changing console drivers (say from vgacon to fbcon), so we
need to run it in that case.

See
http://lists.freedesktop.org/archives/systemd-devel/2014-October/023919.html
http://lists.freedesktop.org/archives/systemd-devel/2014-October/024423.html
http://lists.freedesktop.org/archives/systemd-devel/2014-November/024881.html

This commit adds a udev rule to make systemd-vconsole-setup get run when
the fbcon device becomes available.

(david: moved into new file 90-vconsole.rules instead of 71-seats.rules;
        build-failures are on me, not on Ray)

(cherry picked from commit f6ba8671d8)
2015-01-16 09:40:08 -05:00
Zbigniew Jędrzejewski-Szmek f14dd032d0 manager: print fatal errors on the console too
When booting in quiet mode, fatal messages would not be shown at all to the user.

https://bugzilla.redhat.com/show_bug.cgi?id=1155468

(cherry-picked from cb6531bee6)
2015-01-16 09:40:08 -05:00
David Herrmann f3093590ab udev: fix NULL-ptr deref
Make sure we properly validate the return value of
udev_device_get_sysattr_value(). It might be NULL for several reasons.

(cherry picked from commit 975a900782)
2015-01-16 09:40:08 -05:00
Moez Bouhlel a5ef437435 fix zsh completion typo
json-see => json-sse

(cherry picked from commit d31f44e281)
2015-01-16 09:40:08 -05:00
Lennart Poettering 46c3a085f0 sysv-generator: always use fstatat() if we can
(cherry picked from commit 805e5dda0a)
2015-01-16 09:40:08 -05:00
Lennart Poettering 7bc3b3007e sysv-generator: fix memory leak on failure
This fixes a memory leak introduced by
1ed0c19f81

(cherry picked from commit b3fae863ef)
2015-01-16 09:40:08 -05:00
Zbigniew Jędrzejewski-Szmek 1b6db97fa2 man: remove "nofail" from systemd.swap(5)
As suggested by Marcos Felipe Rasia de Mello <marcosfrm@gmail.com>.

(cherry picked from commit b50191c23f)
2015-01-16 09:40:08 -05:00
Jan Engelhardt 9e69da8bdd doc: add cross-references between systemd.{link, netdev, network}
(cherry picked from commit bd763d350c)
2015-01-16 09:40:08 -05:00
Ronny Chevalier a4f21be76f zsh-completion: add missing completions for systemd-tmpfiles
(cherry picked from commit ee14023fd5)
2015-01-16 09:40:08 -05:00
Ronny Chevalier 65fd39f8a2 zsh-completion: add missing completions for systemd-analyze
(cherry picked from commit 26bd71f06c)
2015-01-16 09:40:08 -05:00
Ronny Chevalier fab6d4c7aa zsh-completion: add missing -M completion for timedatectl
(cherry picked from commit c285cb5c55)
2015-01-16 09:40:08 -05:00
Ronny Chevalier 60c149882c zsh-completion: add missing completions for coredumpctl
(cherry picked from commit 720e0be0f0)
2015-01-16 09:40:07 -05:00
Zbigniew Jędrzejewski-Szmek 63bc82c30c core/mount: remove "fail" again
deb6120920 'man: there's actually no "fail" fstab option, but only
"nofail" removed it from our documentation, which I missed.
fstab(5) only mentions "auto", "noauto", and "nofail". Stick to
those three.

(cherry picked from commit 76c37ab6d2)
2015-01-16 09:40:07 -05:00
Zbigniew Jędrzejewski-Szmek ca54232293 fstab-util: fix priority parsing and add test
(cherry picked from commit a75f4e2a02)

Conflicts:
	src/shared/fstab-util.c
	src/test/test-fstab-util.c
2015-01-16 09:40:07 -05:00
Zbigniew Jędrzejewski-Szmek ce4ad5de37 core/load-fragment: avoid allocating 0 bytes when given an invalid command
With a command line like "@/something" we would allocate an array with
0 elements. Avoid that, and add a test too.

(cherry picked from commit e01ff42899)

Conflicts:
	src/core/load-fragment.c
	src/test/test-unit-file.c
2015-01-16 09:40:07 -05:00
Zbigniew Jędrzejewski-Szmek e3880a3d57 core/mount: filter out noauto,auto,nofail,fail options
We passed the full option string from fstab to /bin/mount. It would in
turn pass the full option string to its helper, if it needed to invoke
one. Some helpers would ignore things like "nofail", but others would
be confused. We could try to get all helpers to ignore those
"meta-options", but it seems better to simply filter them out.

In our model, /bin/mount simply has no business in knowing whether the
mount was configured as fail or nofail, auto or noauto, in the
fstab. If systemd tells invokes a command to mount something, and it
fails, it should always return an error. It seems cleaner to filter
out the option, since then there's no doubt how the command should
behave.

https://bugzilla.redhat.com/show_bug.cgi?id=1177823
(cherry picked from commit 17a1c597c5)

Conflicts:
	src/core/mount.c
2015-01-16 09:40:07 -05:00
Zbigniew Jędrzejewski-Szmek 167deb40ad .gitignore: add new tests and sort tests alphabetically
(cherry picked from commit 266fd0eabc)

Conflicts:
	.gitignore
2015-01-16 00:57:00 -05:00
Zbigniew Jędrzejewski-Szmek 96bd16efac Add new function to filter fstab options
This fixes parsing of options in shared/generator.c. Existing code
had some issues:

- it would treate whitespace and semicolons as seperators. fstab(5)
  is pretty clear that only commas matter. And the syntax does
  not allow for spaces to be inserted in the field in fstab.
  Whitespace might be escaped, but then it should not seperate
  options. Treat whitespace and semicolons as any other character.
- it assumed that x-systemd.device-timeout would always be followed
  by "=". But this is not guaranteed, hasmntopt will return this
  option even if there's no value. Uninitialized memory could be read.
- some error paths would log, and inconsistently, some would just
  return an error code.

Filtering is split out to a separate function and tests are added.

Similar code paths in other places are adjusted to use the new function.

(cherry picked from commit d15d0333be)

Conflicts:
	src/core/mount.c
2015-01-16 00:57:00 -05:00
Lennart Poettering 4b7a19e5b2 man: document that 'loginctl activate' only takes a single argument
(cherry picked from commit 3909ba34ec)
2015-01-16 00:57:00 -05:00
Zbigniew Jędrzejewski-Szmek 4497e5b3a6 journal: do not check for number of files
Now that we bump rlimit, we do not really know how many files
we can open. Remove the check.

https://bugzilla.redhat.com/show_bug.cgi?id=1179980
(cherry picked from commit b914ea8d37)
2015-01-16 00:56:59 -05:00
Ronny Chevalier 2874ef89b6 systemctl: add missing output modes to help message
(cherry picked from commit 86d81e502b)
2015-01-16 00:56:59 -05:00
Ronny Chevalier 25ec79575b shell-completion: add missing output modes
https://bugs.freedesktop.org/show_bug.cgi?id=88216
(cherry picked from commit e4e5a85f34)
2015-01-16 00:56:59 -05:00