Commit graph

592 commits

Author SHA1 Message Date
Lennart Poettering b3de50cb07 units: don't run readahead done timers in containers
We don't run the collector in the container either, hence we don't need
to stop it either.
2013-12-11 23:31:34 +01:00
Lennart Poettering f9a810beda journald: port to sd-event and enable watchdog support 2013-12-11 20:55:09 +01:00
Lennart Poettering cde93897cd event: hook up sd-event with the service watchdog logic
Adds a new call sd_event_set_watchdog() that can be used to hook up the
event loop with the watchdog supervision logic of systemd. If enabled
and $WATCHDOG_USEC is set the event loop will ping the invoking systemd
daemon right after coming back from epoll_wait() but not more often than
$WATCHDOG_USEC/4. The epoll_wait() will sleep no longer than
$WATCHDOG_USEC/4*3, to make sure the service manager is called in time.

This means that setting WatchdogSec= in a .service file and calling
sd_event_set_watchdog() in your daemon is enough to hook it up with the
watchdog logic.
2013-12-11 18:20:09 +01:00
Lennart Poettering cde360cd5d units: ship busname units for the bus activated services we ship 2013-12-03 04:28:02 +01:00
Lennart Poettering 1b16c75cd2 units: install busnames.target by default 2013-12-03 01:18:26 +01:00
Lennart Poettering d420282b28 core: replace OnFailureIsolate= setting by a more generic OnFailureJobMode= setting and make use of it where applicable 2013-11-26 02:26:31 +01:00
Tom Gundersen 4b6141c424 networkd: use Type=notify
Also start earlier during boot.
2013-11-23 02:07:08 +01:00
Lennart Poettering 9f5eb56a13 timer: make timer accuracy configurable
And make it default to 1min
2013-11-21 22:08:20 +01:00
Zbigniew Jędrzejewski-Szmek 9cb74bcb23 man,units: fix installation of systemd-nspawn@.service and add example 2013-11-09 19:02:53 -05:00
Tom Gundersen f579559b3a networkd: add a basic network daemon
This daemon listens for and configures network devices tagged with
'systemd-networkd'. By default, no devices are tagged so this daemon
can safely run in parallel with existing network daemons/scripts.

Networks are configured in /etc/systemd/network/*.network. The first .network
file that matches a given link is applied. The matching logic is similar to
the one for .link files, but additionally supports matching on interface name.

The mid-term aim is to provide an alternative to ad-hoc scripts currently used
in initrd's and for wired setups that don't change much (e.g., as seen on
servers/and some embedded systems).

Currently, static addresses and a gateway can be configured.

Example .network file:

[Match]
Name=wlp2s0

[Network]
Description=My Network
Gateway=192.168.1.1
Address=192.168.1.23/24
Address=fe80::9aee:94ff:fe3f:c618/64
2013-11-09 23:41:17 +01:00
Lennart Poettering 04d3927924 machinectl: add new command to spawn a getty inside a container 2013-10-31 01:43:38 +01:00
Thomas Bächler 4952a9beff Remove FsckPassNo from systemd-fsck-root.service 2013-10-19 12:23:17 +02:00
Thomas Bächler 64e70e4b86 fstab-generator: Generate explicit dependencies on systemd-fsck@.service instead of using FsckPassNo
[tomegun:
  * order all fsck instances after fsck-root
  * check for OOM
  * added notes in the manpages]
2013-10-19 12:23:17 +02:00
Tom Gundersen a18535d9e1 static-nodes: don't call mkdir
This is no longer necessary with kmod-15. Bump the requirement.
2013-10-17 19:53:44 +02:00
Lennart Poettering 3990f24765 rfkill: add new rfkill tool to save/restore rfkill state across reboots
This works analogous to the existing backlight and random seed services
2013-10-14 04:31:49 +02:00
Zbigniew Jędrzejewski-Szmek 59fccd8211 execute.c: always set $SHELL
In e6dca81 $SHELL was added to user@.service. Let's
instead provide it to all units which have a user.
2013-10-02 22:23:56 +02:00
Dave Reisner 6c8c92fef7 fix lingering references to /var/lib/{backlight,random-seed}
This should have been part of ef5bfcf668.
2013-10-02 07:51:06 -04:00
David Herrmann 11c2f7a813 logind: run with CAP_SYS_ADMIN
DRM Master access requires CAP_SYS_ADMIN, yay! Add it to the capability
bounding set for systemd-logind. As CAP_SYS_ADMIN actually allows a huge
set of actions, this mostly renders the restriction-set useless. Anyway,
patches are already pending to reduce the restriction on the kernel side.
But these won't really make it into any stable-release so for now we're
stuck with CAP_SYS_ADMIN.
2013-10-01 17:59:44 +02:00
Evan Callicoat e6dca81441 units: Add SHELL environment variable
With the advent of systemd --user sessions, it's become very interesting to spawn X as a user unit, as well as accompanying processes that may have previously been in a .xinitrc/.xsession, or even just to replace a collection of XDG/GDM/KDM/etc session files with independent systemd --user units. The simplest case here would be to login on a tty, with the traditional /usr/sbin/login "login manager".

However, systemd --user (spawned by user@.service) is at the top level of the slice for the user, and does not inherit any environment variables from the login process. Given the number of common applications which rely on SHELL being set in the environment, it seems like the cleanest way to provide this variable is to set it to %s in the user@.service.

Ideally in the long-term, applications which rely on SHELL being set should be fixed to just grab it from getpwnam() or similar, but until that becomes more common, I propose this simple change to make user sessions a little bit nicer out of the box.
2013-10-01 04:17:31 +02:00
Dave Reisner 8083d486d0 kmod-static-nodes: condition execution on modules.devname 2013-09-28 14:51:39 -04:00
Eelco Dolstra a0f708053b Fix obsolete references to systemd-random-seed-load.service
This service was merged with systemd-random-seed-save.service in
c35b956d34.
2013-09-23 11:41:30 +02:00
Lennart Poettering 3331234adc nspawn: update unit file
ControlGroup= is obsolete, so let's drop it from the default nspawn unit
file.
2013-09-17 11:59:47 -05:00
Zbigniew Jędrzejewski-Szmek 5c390a4ae0 Add pam configuration to allow user sessions to work out of the box
systemd-logind will start user@.service. user@.service unit uses
PAM with service name 'systemd-user' to perform account and session
managment tasks. Previously, the name was 'systemd-shared', it is
now changed to 'systemd-user'.

Most PAM installations use one common setup for different callers.
Based on a quick poll, distributions fall into two camps: those that
have system-auth (Redhat, Fedora, CentOS, Arch, Gentoo, Mageia,
Mandriva), and those that have common-auth (Debian, Ubuntu, OpenSUSE).
Distributions that have system-auth have just one configuration file
that contains auth, password, account, and session blocks, and
distributions that have common-auth also have common-session,
common-password, and common-account. It is thus impossible to use one
configuration file which would work for everybody. systemd-user now
refers to system-auth, because it seems that the approach with one
file is more popular and also easier, so let's follow that.
2013-09-11 15:35:06 -04:00
Tom Gundersen 40f862e3ae filesystem targets: disable default dependencies
This means we can use default dependencies on mount units without having to get them automatically
ordered before the filesystem targets.

Reported-by: Thomas Baechler <thomas@archlinux.org>
2013-09-11 14:40:58 +02:00
Khem Raj 67c15b9a7a use CAP_MKNOD ConditionCapability
Fixes errors seen when booting VMs on QEMU like

systemd[1]: kmod-static-nodes.service: main process exited, code=exited, status=203/EXEC
systemd[1]: Failed to start Create list of required static device nodes for the current kernel.
systemd[1]: Unit kmod-static-nodes.service entered failed state.

Make sure that mknod capability is available

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2013-08-22 00:52:14 -04:00
Zbigniew Jędrzejewski-Szmek 219061dc52 units: disable kmod-static-nodes.service in containers
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=998122.

Note: upstream kmod has a patch [1] to exit with a warning if
modules.devname is missing. We could use new %v specifier to make this
service conditional on the existence of this file, but this could
mask a kernel installation error, hence we should let kmod run
even if the file doesn't exist.

[1] http://git.kernel.org/cgit/utils/kernel/kmod/kmod.git/commit/?id=ae17710117
2013-08-20 21:18:00 -04:00
Kay Sievers 4bb3a126b7 udev: replace CAP_MKNOD by writable /sys condition 2013-08-17 19:07:42 +02:00
Zbigniew Jędrzejewski-Szmek d0a2d726f0 units: make fsck units remain after exit
Without this, fsck would be re-run if any other service which pulls
in a target requiring one of the mounts was started after fsck was done
but before the initial transaction was done.

https://bugs.freedesktop.org/show_bug.cgi?id=66784
2013-08-15 15:42:09 -04:00
Thomas Hindoe Paaboel Andersen 5eec7de6ad typo fixes in man and comments 2013-08-15 23:38:09 +02:00
Kay Sievers 04bf3c1a60 sysctl: allow overwriting of values specified in "later" files 2013-08-15 18:43:31 +02:00
Lennart Poettering 875c6e1b48 backlight: instead of syspath use sysname for identifying backlight devices
This makes the description string of the backlight service a bit nicer.
2013-08-14 02:55:57 +02:00
Lennart Poettering 3731acf1ac backlight: add minimal tool to save/restore screen brightness across reboots
As many laptops don't save/restore screen brightness across reboots,
let's do this in systemd with a minimal tool, that restores the
brightness as early as possible, and saves it as late as possible. This
will cover consoles and graphical logins, but graphical desktops should
do their own per-user stuff probably.

This only touches firmware brightness controls for now.
2013-08-14 01:57:02 +02:00
Lennart Poettering 82659fd757 core: optionally send SIGHUP in addition to the configured kill signal
This is useful to fake session ends for processes like shells.
2013-07-30 01:54:59 +02:00
Dave Reisner ec99834cb0 tmpfiles-setup: exclude /dev prefixes files
Fixes Arch Linux bug: https://bugs.archlinux.org/task/36259
2013-07-24 12:04:00 -04:00
Tom Gundersen 7e380bba1c kmod-static-nodes: remain after exit 2013-07-22 17:11:19 +02:00
Tom Gundersen ef7e6e0598 systemd-tmpfiles-setup-dev: remain after exit
Without this, tmpfiles-setpu-dev  would be re-run if any other service,
which pulls in basic.target, was started after setup-dev was finished
and before basic.target was active.
2013-07-22 17:01:46 +02:00
Lennart Poettering bc5cb1d525 machined: run machined at minimal capabilities 2013-07-19 03:49:24 +02:00
Lennart Poettering 085b90af43 units: add references to bus API documentation to logind+machined 2013-07-19 03:49:07 +02:00
Harald Hoyer 956eaf2b8d remove /run/initramfs/root-fsck logic
dracut uses systemd in the initramfs and does not write these files
anymore.

The state of the root fsck is serialized.
2013-07-17 11:33:07 +02:00
Zbigniew Jędrzejewski-Szmek 7aa4fa34f7 units: do not special-case getty@tty1.service installation
Since a long while we can use "systemctl enable getty@tty1.service"
which does the right thing, so there's no need to abuse Alias=
for installation.
2013-07-13 10:00:29 -04:00
Tom Gundersen 3d56f7df44 static-nodes: don't hardcode path to mkdir 2013-07-12 20:08:31 +02:00
Lennart Poettering 4c5420a0c1 units: since we auto-spawn user@.service instances now we don need an [Install] section in it 2013-07-11 01:57:09 +02:00
Tom Gundersen edeb68c53f static-nodes: move creation of static nodes from udevd to tmpfiles
As of kmod v14, it is possible to export the static node information from
/lib/modules/`uname -r`/modules.devname in tmpfiles.d(5) format.

Use this functionality to let systemd-tmpfilesd create the static device nodes
at boot, and drop the functionality from systemd-udevd.

As an effect of this we can move from systemd-udevd to systemd-tmpfiles-setup-dev:

 * the conditional CAP_MKNOD (replaced by checking if /sys is mounted rw)
 * ordering before local-fs-pre.target (see 89d09e1b5c)
2013-07-08 21:26:24 +02:00
Kay Sievers a0f9c810fa build-sys: work around automake issue with files with a leading '-'
We should probably work around it, until it is sorted out.

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14728
2013-07-02 23:15:49 -04:00
Lennart Poettering 1ee306e124 machined: split out machine registration stuff from logind
Embedded folks don't need the machine registration stuff, hence it's
nice to make this optional. Also, I'd expect that machinectl will grow
additional commands quickly, for example to join existing containers and
suchlike, hence it's better keeping that separate from loginctl.
2013-07-02 03:47:23 +02:00
Lennart Poettering fb6becb443 logind: port over to use scopes+slices for all cgroup stuff
In order to prepare things for the single-writer cgroup scheme, let's
make logind use systemd's own primitives for cgroup management.

Every login user now gets his own private slice unit, in which his sessions
live in a scope unit each. Also, add user@$UID.service to the same
slice, and implicitly start it on first login.
2013-07-02 01:48:55 +02:00
Lennart Poettering 4ad490007b core: general cgroup rework
Replace the very generic cgroup hookup with a much simpler one. With
this change only the high-level cgroup settings remain, the ability to
set arbitrary cgroup attributes is removed, so is support for adding
units to arbitrary cgroup controllers or setting arbitrary paths for
them (especially paths that are different for the various controllers).

This also introduces a new -.slice root slice, that is the parent of
system.slice and friends. This enables easy admin configuration of
root-level cgrouo properties.

This replaces DeviceDeny= by DevicePolicy=, and implicitly adds in
/dev/null, /dev/zero and friends if DeviceAllow= is used (unless this is
turned off by DevicePolicy=).
2013-06-27 04:17:34 +02:00
Lennart Poettering 9444b1f20e logind: add infrastructure to keep track of machines, and move to slices
- This changes all logind cgroup objects to use slice objects rather
  than fixed croup locations.

- logind can now collect minimal information about running
  VMs/containers. As fixed cgroup locations can no longer be used we
  need an entity that keeps track of machine cgroups in whatever slice
  they might be located. Since logind already keeps track of users,
  sessions and seats this is a trivial addition.

- nspawn will now register with logind and pass various bits of metadata
  along. A new option "--slice=" has been added to place the container
  in a specific slice.

- loginctl gained commands to list, introspect and terminate machines.

- user.slice and machine.slice will now be pulled in by logind.service,
  since only logind.service requires this slice.
2013-06-20 03:49:59 +02:00
Lennart Poettering f2561e8598 units: add default units for system.slice, user.slice, machine.slice 2013-06-18 00:59:54 +02:00
Karel Zak 7c1b8f043e units: cleanup agetty command line
* baud rate is optional and unnecessary for virtual terminals
 * term type is optional (default is 'linux' for virtual terminals
   and 'vt102' for serial lines)
 * long options are more user-friendly

... all this is supported since util-linux v2.20 (Aug 2011).
2013-06-04 15:34:44 +02:00