1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 02:21:44 +03:00
Commit Graph

869 Commits

Author SHA1 Message Date
Lennart Poettering
4e069746fe units: tighten system call filters a bit
Take away kernel keyring access, CPU emulation system calls and various debug
system calls from the various daemons we have.
2016-06-13 16:25:54 +02:00
Topi Miettinen
40093ce5dd units: add a basic SystemCallFilter (#3471)
Add a line
SystemCallFilter=~@clock @module @mount @obsolete @raw-io ptrace
for daemons shipped by systemd. As an exception, systemd-timesyncd
needs @clock system calls and systemd-localed is not privileged.
ptrace(2) is blocked to prevent seccomp escapes.
2016-06-09 09:32:04 +02:00
Topi Miettinen
40652ca479 units: enable MemoryDenyWriteExecute (#3459)
Secure daemons shipped by systemd by enabling MemoryDenyWriteExecute.

Closes: #3459
2016-06-08 14:23:37 +02:00
Franck Bui
ce3eb7790c units: wait for plymouth to shut down in rescue.sevice (#3367)
In the same vein as commit ac59f0c12c which added
the --wait option to the emergency service, this patch makes sure that plymouth
has exited before entering into the rescue mode.
2016-06-01 11:52:35 +02:00
Lennart Poettering
0525107594 units: restore ConditionNeesUpdate=/etc in ldconfig.service (#3311)
In order to support stateless systems that support offline /usr updates
properly, let's restore the ConditionNeesUpdate=/etc line that makes sure we
are run when /usr is updated and this update needs to be propagated to the
/etc/ld.so.conf file stored in /etc.

This reverts part of #2859, which snuck this change in, but really shouldn't
have.
2016-05-21 17:09:18 -04:00
Daniel Drake
7163e1ca11 Create initrd-root-device.target synchronization point (#3239)
Add a synchronization point so that custom initramfs units can run
after the root device becomes available, before it is fsck'd and
mounted.

This is useful for custom initramfs units that may modify the
root disk partition table, where the root device is not known in
advance (it's dynamically selected by the generators).
2016-05-12 18:42:39 +02:00
tblume
2a44df950f units: make sure that fsck is executed before quotacheck
fsck determines wheter an automatic quotacheck should be executed.
Hence fsck service needs to run before quotacheck service.
2016-05-10 14:10:17 +02:00
Martin Pitt
3136ec90ad Stop syslog.socket when entering emergency mode (#3130)
When enabling ForwardToSyslog=yes, the syslog.socket is active when entering
emergency mode. Any log message then triggers the start of rsyslog.service (or
other implementation) along with its dependencies such as local-fs.target and
sysinit.target. As these might fail themselves (e. g. faulty /etc/fstab), this
breaks the emergency mode.

This causes syslog.socket to fail with "Failed to queue service startup job:
Transition is destructive".

Add Conflicts=syslog.socket to emergency.service to make sure the socket is
stopped when emergency.service is started.

Fixes #266
2016-04-27 10:34:24 +02:00
Lennart Poettering
d7fe83bbc2 Merge pull request #3093 from poettering/nspawn-userns-magic
nspawn automatic user namespaces
2016-04-26 14:57:04 +02:00
Lennart Poettering
c34b73d050 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
2016-04-25 15:38:56 -04:00
Lennart Poettering
af88764ff8 units: turn on user namespace by default in systemd-nspawn@.service
Now that user namespacing is supported in a pretty automatic way, actually turn
it on by default if the systemd-nspawn@.service template is used.
2016-04-25 12:16:03 +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
frankheckenbach
a11fe93e04 tmp.mount.hm4: After swap.target (#3087)
fix issue #2930
2016-04-22 14:21:30 +02: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
Michal Sekletar
f66a1c48cf units: run ldconfig.service after we have mounted all local file systems
Also drop ConditionNeedsUpdate=|/etc. Regardless if system is updated
online or offline, updating dynamic loader cache should always be
responsibility of packaging tools/scripts.
2016-03-17 14:41:26 +01:00
Elias Probst
7a8c9e4457
Don't escape the name of the container in instances of
When using `%I` for instances of `systemd-nspawn@.service`, the result
will be `systemd-nspawn` trying to launch a container named e.g.
`fedora/23` instead of `fedora-23`.
Using `%i` instead prevents escaping `-` in a container name and uses
the unmodified container name from the machine store.
2016-02-26 20:39:10 +01:00
Lennart Poettering
c550f7a9b8 Merge pull request #2664 from zonque/bootchart-removal
Remove systemd-bootchart
2016-02-23 20:27:59 +01:00
Lennart Poettering
45bd485454 man: link some unit files to their online bus API documentation 2016-02-23 16:24:01 +01:00
Daniel Mack
232c84b2d2 Remove systemd-bootchart
This commit rips out systemd-bootchart. It will be given a new home, outside
of the systemd repository. The code itself isn't actually specific to
systemd and can be used without systemd even, so let's put it somewhere
else.
2016-02-23 13:30:09 +01:00
Daniel Mack
798c486fbc remove bus-proxyd
As kdbus won't land in the anticipated way, the bus-proxy is not needed in
its current form. It can be resurrected at any time thanks to the history,
but for now, let's remove it from the sources. If we'll have a similar tool
in the future, it will look quite differently anyway.

Note that stdio-bridge is still available. It was restored from a version
prior to f252ff17, and refactored to make use of the current APIs.
2016-02-12 19:10:01 +01:00
Lennart Poettering
b8eefa012d Merge pull request #2581 from evverx/dev-mqueue-cond
units: don't try to mount the mqueue fs if we lack the privileges for it
2016-02-11 13:55:59 +01:00
Evgeny Vereshchagin
6cfc79632f units: don't try to mount the mqueue fs if we lack the privileges for it
See https://github.com/systemd/systemd/pull/2576#discussion-diff-52592680
2016-02-11 02:45:11 +00:00
Lennart Poettering
03a7868805 units: don't try to mount the FUSE fs if we lack the privileges for it
See:

https://lists.freedesktop.org/archives/systemd-devel/2016-February/035740.html
2016-02-10 23:42:39 +01:00
Lennart Poettering
3c171f0b1e coredump: rework coredumping logic
This reworks the coredumping logic so that the coredump handler invoked from the kernel only collects runtime data
about the crashed process, and then submits it for processing to a socket-activate coredump service, which extracts a
stacktrace and writes the coredump to disk.

This has a number of benefits: the disk IO and stack trace generation may take a substantial amount of resources, and
hence should better be managed by PID 1, so that resource management applies. This patch uses RuntimeMaxSec=, Nice=, OOMScoreAdjust=
and various sandboxing settings to ensure that the coredump handler doesn't take away unbounded resources from normally
priorized processes.

This logic is also nice since this makes sure the coredump processing and storage is delayed correctly until
/var/systemd/coredump is mounted and writable.

Fixes: #2286
2016-02-10 16:08:32 +01:00
Zbigniew Jędrzejewski-Szmek
9c6d5a179e Merge pull request #2565 from poettering/fix-2315 2016-02-09 19:13:15 -05:00
Lennart Poettering
8222cf9145 units: downgrade dependency on /tmp in basic.target to Wants=
Now that requiring of a masked unit results in failure again, downgrade the dependency on /tmp to Wants= again, so that
our suggested way to disable /tmp-on-tmpfs by masking doesn't result in a failing boot.

References: #2315
2016-02-09 20:34:27 +01:00
Indrajit Raychaudhuri
5e41590b70 Fix typo in rescue shell 2016-02-05 11:28:53 +05:30
Daniel Mack
efda7e594e Merge pull request #2331 from yuwata/journal-remote-unit-v2
journal-remote: add SupplementaryGroups to systemd-journal-upload.service
2016-01-22 09:56:54 +01:00
Lennart Poettering
cde3d68750 units: don't fail if /root doesn't exist for shell units
As discussed on the ML:

http://lists.freedesktop.org/archives/systemd-devel/2016-January/035594.html
2016-01-17 20:47:46 +01:00
Yu Watanabe
d70698b7e6 journal-remote: add SupplementaryGroups to systemd-journal-upload.service 2016-01-15 15:25:36 +09:00
Martin Pitt
6233c794b2 kmod-static-nodes: don't run if module list is empty
With this kmod commit, modules.devname will be empty by default instead of
containing just a comment:

  https://git.kernel.org/cgit/utils/kernel/kmod/kmod.git/commit/?id=4c30a11d5f

Refine the startup condition of kmod-static-nodes.service to not run needlessly
if the list is empty.
2016-01-11 16:26:17 +01:00
Yu Watanabe
c9d493281d journal-remote: add documents in the unit files 2015-12-15 10:51:12 +09:00
Jan Alexander Steffens (heftig)
8c277ddd27 Set user@.service TasksMax=infinity
The user manager is still limited by its parent slice user-UID.slice,
which defaults to 4096 tasks. However, it no longer has an additional
limit of 512 tasks.

Fixes #1955.
2015-11-22 23:05:23 +01:00
Lennart Poettering
541ec33075 nspawn: set TasksMax= for containers to 8192 by default 2015-11-16 11:58:04 +01:00
Lennart Poettering
2a2e1b36a0 core: remove SmackFileSystemRootLabel= again
Apparently, util-linux' mount command implicitly drops the smack-related
options anyway before passing them to the kernel, if the kernel doesn't
know SMACK, hence there's no point in duplicating this in systemd.

Fixes #1696
2015-11-12 12:50:59 +01:00
Lennart Poettering
85ae4be4f1 units: fix system.slice to require -.slice, instead of just want it 2015-11-11 16:04:16 +01:00
Lennart Poettering
119e9655dc journal: restore watchdog support 2015-11-03 17:45:12 +01:00
Daniel Mack
4084052911 Merge pull request #1726 from teg/networkd-2
networkd: (de)serialize more state and support expiring routes
2015-11-03 15:03:50 +01:00
Lennart Poettering
e22aa3d328 journald: never block when sending messages on NOTIFY_SOCKET socket
Otherwise we might run into deadlocks, when journald blocks on the
notify socket on PID 1, and PID 1 blocks on IPC to dbus-daemon and
dbus-daemon blocks on logging to journald. Break this cycle by making
sure that journald never ever blocks on PID 1.

Note that this change disables support for event loop watchdog support,
as these messages are sent in blocking style by sd-event. That should
not be a big loss though, as people reported frequent problems with the
watchdog hitting journald on excessively slow IO.

Fixes: #1505.
2015-11-01 22:12:29 +01:00
Tom Gundersen
1c8e710c2b networkd: route - track routes 2015-10-30 12:32:48 +01:00
Lennart Poettering
7cb48925dc core: rename SmackFileSystemRoot= to SmackFileSystemRootLabel=
That way it's in sync with the other SMACK label settings.

https://github.com/systemd/systemd/pull/1664#issuecomment-150891270
2015-10-26 01:24:39 +01:00
Sangjung Woo
5dfcb8d200 units: add 'SmackFileSystemRoot=*' option into tmp.mount
If SMACK is enabled, 'smackfsroot=*' option should be specified when
/tmp is mounted since many non-root processes use /tmp for temporary
usage. If not, /tmp is labeled as '_' and smack denial occurs when
writing.

In order to do that, 'SmackFileSystemRoot=*' is newly added into
tmp.mount.
2015-10-24 20:54:21 +09:00
Lennart Poettering
a2c90f05f1 units: also whitelist "blkext" block devices for nspawn service
/dev/loop*p* block devices are of the "blkext" subsystem, not of loop,
hence whitelist this too.

Fixes #1446
2015-10-22 01:59:25 +02:00
Kay Sievers
29a3f0d4c5 Revert "units: add 'smackfsroot=*' option into tmp.mount when SMACK is enabled"
This reverts commit 409c2a13fd.

It breaks the bootup of systems which enable smack at compile time, but have no
smack enabled in the kernel. This needs a different solution.
2015-10-18 12:21:21 +02:00
Tom Gundersen
8ee07361d0 units: .gitignore: units - ignore tmp.mount
This is a follow-up to 409c2a13fd.
2015-10-15 19:28:07 +02:00
Lennart Poettering
2ac3f19a51 Merge pull request #1572 from again4you/devel/tmp-smack
units: add 'smackfsroot=*' option into tmp.mount when SMACK is enabled
2015-10-15 13:09:57 +02:00
Sangjung Woo
409c2a13fd units: add 'smackfsroot=*' option into tmp.mount when SMACK is enabled
If SMACK is enabled, 'smackfsroot=*' option should be specified in
tmp.mount file since many non-root processes use /tmp for temporary
usage. If not, /tmp is labeled as '_' and smack denial occurs when
writing.
2015-10-15 14:02:44 +09:00
Lennart Poettering
be3270ebd3 unit: remove [Install] section from the user exit.target unit
There's no concept of ctrl-alt-del for user systemd instances, hence
don't suggest it woud make sense to symlink the unit to it.

Fixes #1525.
2015-10-14 16:25:23 +02:00
Tom Gundersen
e1719ef19d Merge pull request #1468 from poettering/fdnames
Add support for naming fds for socket activation and more
2015-10-06 12:06:56 +02:00
Lennart Poettering
df9d6993b6 unit: give systemd-networkd.socket a better description
Usually we try to properly uppercase first characters in the
description, do so here, too. Also, keep it close to the string used in
systemd-networkd.service.
2015-10-06 11:52:48 +02:00