Commit graph

669 commits

Author SHA1 Message Date
Kay Sievers 0138a2dcc5 debug-shell: add condition for tty device to run on 2014-06-12 22:26:43 +02:00
Lennart Poettering 58e027023b units: order network-online.target after network.target
There might be implementations around where the network-online logic
might not talk to any network configuration service (and thus not have
to wait for it), hence let's explicitly order network-online.target
after network.target to avoid any ambiguities.
2014-06-11 15:00:45 +02:00
Lennart Poettering 96bf4ee252 units: time-sync.target probably makes sense, is not just sysv compat 2014-06-11 12:14:55 +02:00
Lennart Poettering a4a878d040 units: introduce network-pre.target as place to hook in firewalls
network-pre.target is a passive target that should be pulled in by
services that want to be executed before any network is configured (for
example: firewall scrips).

network-pre.target should be ordered before all network managemet
services (but not be pulled in by them).

network-pre.target should be order after all services that want to be
executed before any network is configured (and be pulled in by them).
2014-06-11 12:14:55 +02:00
Mantas Mikulėnas 62be1c9aab bus-proxy: fix misplaced s/system/session/ 2014-06-10 19:34:34 +02:00
Lennart Poettering 2e2b36084a bus-proxy: read the right policy when running in user mode 2014-06-10 17:56:51 +02:00
Lennart Poettering 55152b6ede units: pull in time-sync.target from systemd-timedated.service
After all, that's what we document for time-sync.target in
systemd.special(5), hence let's follow our own suggestion.
2014-06-06 16:20:33 +02:00
Lennart Poettering 3c52ad9237 units: fix minor typo 2014-06-06 14:38:04 +02:00
Lennart Poettering 1b8689f949 core: rename ReadOnlySystem= to ProtectSystem= and add a third value for also mounting /etc read-only
Also, rename ProtectedHome= to ProtectHome=, to simplify things a bit.

With this in place we now have two neat options ProtectSystem= and
ProtectHome= for protecting the OS itself (and optionally its
configuration), and for protecting the user's data.
2014-06-04 18:12:55 +02:00
Lennart Poettering 7e9f159ca7 initctl: move /dev/initctl fifo into /run, replace it by symlink
With this change we have no fifos/sockets remaining in /dev.
2014-06-04 16:53:58 +02:00
Lennart Poettering 03ee5c38cb journald: move /dev/log socket to /run
This way we can make the socket also available for sandboxed apps that
have their own private /dev. They can now simply symlink the socket from
/dev.
2014-06-04 16:53:58 +02:00
Lennart Poettering 6a010ac9e5 bus-proxy: drop priviliges if we can
Either become uid/gid of the client we have been forked for, or become
the "systemd-bus-proxy" user if the client was root. We retain
CAP_IPC_OWNER so that we can tell kdbus we are actually our own client.
2014-06-04 11:13:08 +02:00
Kay Sievers 72543b361d remove ReadOnlySystem and ProtectedHome from udevd and logind
logind needs access to /run/user/, udevd fails during early boot
with these settings
2014-06-04 01:41:15 +02:00
Lennart Poettering 417116f234 core: add new ReadOnlySystem= and ProtectedHome= settings for service units
ReadOnlySystem= uses fs namespaces to mount /usr and /boot read-only for
a service.

ProtectedHome= uses fs namespaces to mount /home and /run/user
inaccessible or read-only for a service.

This patch also enables these settings for all our long-running services.

Together they should be good building block for a minimal service
sandbox, removing the ability for services to modify the operating
system or access the user's private data.
2014-06-03 23:57:51 +02:00
Tom Gundersen 682265d5e2 resolved: run as unpriviliged "systemd-resolve" user
This service is not yet network facing, but let's prepare nonetheless.
Currently all caps are dropped, but some may need to be kept in the
future.
2014-06-03 10:40:28 +02:00
Tom Gundersen bddfc8afd3 networkd: drop CAP_SYS_MODULE
Rely on modules being built-in or autoloaded on-demand.

As networkd is a network facing service, we want to limits its capabilities,
as much as possible. Also, we may not have CAP_SYS_MODULE in a container,
and we want networkd to work the same there.

Module autoloading does not always work, but should be fixed by the kernel
patch f98f89a0104454f35a: 'net: tunnels - enable module autoloading', which
is currently in net-next and which people may consider backporting if they
want tunneling support without compiling in the modules.

Early adopters may also use a module-load.d snippet and order
systemd-modules-load.service before networkd to force the module
loading of tunneling modules.

This sholud fix the various build issues people have reported.
2014-06-03 00:40:23 +02:00
Lennart Poettering d3cf48f4bd networkd: run as unpriviliged "systemd-network" user
This allows us to run networkd mostly unpriviliged with the exception of
CAP_NET_* and CAP_SYS_MODULE. I'd really like to get rid of the latter
though...
2014-06-01 09:12:00 +02:00
Lennart Poettering 40393d5247 units: remove CAP_SYS_PTRACE capability from hostnamed/networkd
The ptrace capability was only necessary to detect virtualizations
environments. Since we changed the logic to determine this to not
require priviliges, there's no need to carry the CAP_SYS_PTRACE
capability anymore.
2014-06-01 08:54:09 +02:00
Jonathan Liu d8e40d62ab units: use KillMode=mixed for systemd-nspawn@.service
This causes the container to shut down cleanly when the service is
stopped.
2014-05-30 09:36:29 -04:00
Kay Sievers d636d37679 timesyncd: only update stamp file when we are synchronized
Create initial stamp file with compiled-in time to prevent bootups
with clocks in the future from storing invalid timestamps.

At shutdown, only update the timestamp if we got an authoritative
time to store.
2014-05-24 08:04:56 +08:00
Kay Sievers 52ffb444cb timesyncd: order after tmpfiles to get a working network monitor 2014-05-22 07:57:33 +09:00
Lennart Poettering ece6e766cf timesyncd: save clock to disk everytime we get an NTP fix, and bump clock at boot using this
This is useful to make sure the system clock stays monotonic even on
systems that lack an RTC.

Also, why we are at it, also use the systemd release time for bumping
the clock, since it's a slightly less bad than starting with jan 1st,
1970.

This also moves timesyncd into the early bootphase, in order to make
sure this initial bump is guaranteed to have finished by the time we
start real daemons which might write to the file systemd and thus
shouldn't leave 1970's timestamps all over the place...
2014-05-21 00:23:39 +09:00
Tom Gundersen 091a364c80 resolved: add daemon to manage resolv.conf
Also remove the equivalent functionality from networkd.
2014-05-19 18:14:56 +02:00
Lennart Poettering 9f7115498b timesyncd: enable watchdog support 2014-05-18 20:52:49 +09:00
Lennart Poettering a349eb10d3 timesyncd: run timesyncd as unpriviliged user "systemd-timesync" (but still with CAP_SYS_TIME) 2014-05-18 20:52:49 +09:00
Tom Gundersen 7da489e630 Revert "networkd: order after udev kernel socket"
This reverts commit a555350d47.

This did not fix the problem, just made it harder to hit.
2014-05-16 14:52:02 +02:00
Lennart Poettering e3ad07d21c timesyncd: limit capabilities to CAP_SYS_TIME 2014-05-15 18:55:19 +02:00
Tom Gundersen 0968137439 timesyncd: start after networkd
This is needed for the network monitor to work (as it requires networkd to set up the correct directories first).
2014-05-13 12:44:22 +02:00
Tom Gundersen 7c8ec321e7 networkd: unit - add cap to load modules
Remember to drop this when the kernel gains autoloading for all netdev kinds.
2014-05-12 17:37:52 +02:00
Kay Sievers a91df40e69 timesyncd: add unit and man page 2014-04-29 09:51:53 +02:00
Tom Gundersen 3a67e927e3 networkd-wait-online: improve interoptability and enable by default
To make sure we don't delay boot on systems where (some) network links are managed by someone else
we don't block if something else has successfully brought up a link.

We will still block until all links we are aware of that are  managed by networkd have been
configured, but if no such links exist, and someone else have configured a link sufficiently
that it has a carrier, it may be that the link is ready so we should no longer block.

Note that in all likelyhood the link is not ready (no addresses/routes configured),
so whatever network managment daemon configured it should provide a similar wait-online
service to block network-online.target until it is ready.

The aim is to block as long as we know networking is not fully configured, but no longer. This
will allow systemd-networkd-wait-online.service to be enabled on any system, even if we don't
know whether networkd is the main/only network manager.

Even in the case networking is fully configured by networkd, the default behavior may not be
sufficient: if two links need to be configured, but the first is fully configured before the
second one appears we will assume the network is up. To work around that, we allow specifying
specific devices to wait for before considering the network up.

This unit is enabled by default, just like systemd-networkd, but will only be pulled in if
anyone pulls in network-online.target.
2014-04-24 00:23:07 +02:00
Kay Sievers 0fbedd1fdc remove bus-driverd, the interface is now handled natively by bus-proxyd 2014-04-22 19:31:26 +02:00
Tom Gundersen a555350d47 networkd: order after udev kernel socket
Otherwise we will not be able to queuery whether devices are initialized on kdbus enabled systems.
2014-04-19 22:13:49 +02:00
Kay Sievers 4851ac4526 bus: provide org.freedesktop.systemd1.busname for systemd --user 2014-03-26 03:38:48 +01:00
Tom Gundersen 6c7c89dfc6 networkd: add CapabilityBoundingSet 2014-03-24 17:13:24 +01:00
Lennart Poettering 48791a98be units: networkd shouldn't have PrivateTmp= set, since it runs in early-boot
/tmp is only available in later boot, and we shouldn't create private
subdirs in it hence, while we are still in early boot.
2014-03-24 16:48:39 +01:00
Lennart Poettering c2c13f2df4 unit: turn off mount propagation for udevd
Keep mounts done by udev rules private to udevd. Also, document how
MountFlags= may be used for this.
2014-03-20 04:16:39 +01:00
Lennart Poettering f21a71a907 core: enable PrivateNetwork= for a number of our long running services where this is useful 2014-03-19 23:25:28 +01:00
Lennart Poettering d99a705296 units: make use of PrivateTmp=yes and PrivateDevices=yes for all our long-running daemons 2014-03-19 19:09:00 +01:00
Daniel Mack 5892a914d1 busname: introduce Activating directive
Add a new config 'Activating' directive which denotes whether a busname
is actually registered on the bus. It defaults to 'yes'.

If set to 'no', the .busname unit only uploads policy, which will remain
active as long as the unit is running.
2014-03-19 02:25:36 +01:00
Hendrik Brueckner fc6c7fe9be getty: Start getty on 3270 terminals available on Linux on System z
Add the first 3270 terminal device that is associated with the Linux preferred
console to the list of virtualization consoles.  This is required to
automatically start a getty if the conmode=3270 kernel parameter is specified
for Linux on z/VM instances.  Note that a queued upstream patch also enable
the 3270 terminal device if it is associated with the Linux preferred console.
How

To successfully start agetty on a 3270 terminal, a change in the agetty
parameter order is required.  Previously, agetty would started like this:

    /sbin/agetty --keep-baud 3270/tty1 115200,38400,9600 TERM

The agetty program interprets the "3270/tty1" as baud rate and fails to start
with the "bad speed: 3270/tty1" error message.  Fixing this in agetty is more
complex rather than reordering the command line parameters like this:

    /sbin/agetty --keep-baud 115200,38400,9600 3270/tty1 TERM

According to agetty sources and "agetty --help", agetty accepts the "tty",
"baudrate tty", and "tty baudrate" specifications.

P.S. The "tty: Set correct tty name in 'active' sysfs attribute" introduces
     a change to display the terminal device which is associated with the
     Linux preferred console.  This change helps to let systemd handle this
     particular case only.  Without the changes of this commit, no additional
     3270 terminal device can be managed by systemd.

     https://git.kernel.org/cgit/linux/kernel/git/gregkh/tty.git/commit/?id=723abd87f6e536f1353c8f64f621520bc29523a3
2014-03-13 10:42:26 +01:00
Kay Sievers d5ce683c07 units: remove "AllowUser=root own", the bus owner can always own names 2014-03-08 19:38:06 +01:00
Daniel Mack fe8d029277 units: set 'AllowUser=root own' and 'AllowWorld=talk' own for all .busname files 2014-03-07 19:19:02 +01:00
Thomas Bächler 6c49212741 units: Do not unescape instance name in systemd-backlight@.service
The instance name is never escaped in the udev rule, but unescaped in the unit.
This results in the following error message on Asus boards:

  Failed to get backlight or LED device 'backlight:eeepc/wmi': No such file or directory
2014-03-07 00:30:56 -05:00
Lennart Poettering 9533ad1f42 units: don't use the word 'Reboot' for Startup, but simply 'Boot' 2014-03-06 05:04:51 +01:00
Lennart Poettering d1a6f44125 units: properly capitalize the unit description 2014-03-06 05:04:51 +01:00
Zbigniew Jędrzejewski-Szmek 1ae383a8a3 Use /var/run/dbus/system_bus_socket for the D-Bus socket 2014-02-25 21:26:42 -05:00
Zbigniew Jędrzejewski-Szmek 7143555ce8 units/serial-getty@.service: add [Install] section
This makes it easier to manually enable and disable
specific gettys, and also mirrors getty@.service.

http://lists.freedesktop.org/archives/systemd-devel/2014-February/017329.html
2014-02-24 08:07:34 -05:00
Jason A. Donenfeld c4a0b20c7a install: do not statically enable systemd-networkd
[tomegun: pruned the commit message as not to contradict the follow-up commit]
2014-02-21 14:37:53 +01:00
Zbigniew Jędrzejewski-Szmek 8f9c6fe5ff units: systemd-logind fails hard without dbus
That is, without --enable-kdbus and kdbus running.

With --enable-kdbus things are more complicated, because dbus might be
necessary, if kdbus is missing at runtime. If it is not necessary,
the socket will be started, which is not imporant, but not the service.
2014-02-14 19:00:32 -05:00