Commit graph

6685 commits

Author SHA1 Message Date
Lennart Poettering 2d2ebd6b8f util: modernize readlink_malloc() a bit 2014-02-11 17:16:08 +01:00
Lennart Poettering c50e4f95d8 util: drop parse_user_at_host() since its unused now 2014-02-11 17:16:07 +01:00
Lennart Poettering eb91eb187b nspawn: add --register=yes|no switch to optionally disable registration of the container with machined 2014-02-11 17:16:07 +01:00
Tom Gundersen cf597f650a sd-dhcp: split out packet handling from client 2014-02-11 16:24:23 +01:00
David Herrmann a020c2a013 sd-bus: export sd_bus_call{,_async,_async_cancel}
The .sym file somehow lacks these declarations, so add these. You have to
run "make clean" to make sure the sym-test runs fine afterwards.
2014-02-10 23:25:10 +01:00
Tom Gundersen 63ffa72022 networkd: link - correctly skip state ENSLAVING when no vlans configured
This fixes a regression introduced in 672682a6b
2014-02-10 23:01:47 +01:00
Tom Gundersen 672682a6b9 networkd: VLAN - allow multiple vlans to be created on a link
Also limit the range of vlan ids. Other implementations and
documentation use the ranges {0,1}-{4094,4095}, but we use
the one accepted by the kernel: 0-4094.

Reported-by: Oleksii Shevchuk <alxchk@gmail.com>
2014-02-10 19:00:17 +01:00
Michal Sekletar 3831838ae7 pam: use correct log level 2014-02-10 16:38:28 +01:00
Susant Sahani 108e131ece sd-rtnl: added support for a few more attributes 2014-02-10 14:53:19 +01:00
Tom Gundersen 11fc2e833e sd-rtnl: test - improve test of MTU a bit
We are more likely to catch errors if we don't use '0' as test value.
2014-02-10 14:53:19 +01:00
Susant Sahani eedee64522 sd-rtnl: add test cases for link 2014-02-10 14:53:19 +01:00
Lennart Poettering 8a96d94e4c nspawn: add new --share-system switch to run a container without PID/UTS/IPC namespacing 2014-02-10 13:18:16 +01:00
Lennart Poettering 82adf6af7c nspawn,man: use a common vocabulary when referring to selinux security contexts
Let's always call the security labels the same way:

  SMACK: "Smack Label"
  SELINUX: "SELinux Security Context"

And the low-level encapsulation is called "seclabel". Now let's hope we
stick to this vocabulary in future, too, and don't mix "label"s and
"security contexts" and so on wildly.
2014-02-10 13:18:16 +01:00
Michael Scherer 0d3f7bb3a5 exec: Add support for ignoring errors on SELinuxContext by prefixing it with -, like for others settings.
Also remove call to security_check_context, as this doesn't serve anything, since
setexeccon will fail anyway.
2014-02-10 13:18:16 +01:00
Michael Scherer 5c56a259e0 exec: Ignore the setting SELinuxContext if selinux is not enabled 2014-02-10 13:18:16 +01:00
Michael Scherer 7b52a628f8 exec: Add SELinuxContext configuration item
This permit to let system administrators decide of the domain of a service.
This can be used with templated units to have each service in a différent
domain ( for example, a per customer database, using MLS or anything ),
or can be used to force a non selinux enabled system (jvm, erlang, etc)
to start in a different domain for each service.
2014-02-10 13:18:16 +01:00
Tom Gundersen 36e0e6311b includes: remove duplicate includes
Found by the new check-includes make target.
2014-02-10 13:06:31 +01:00
Colin Guthrie 63a1b905d8 fstab-generator: Create fsck-root symlink with correct path
This was noticed in Brussels at the hackfest. The fstab-generator currently
creates a broken symlink pointing to itself in
/run/systemd/generator/local-fs.target.wants/ for systemd-fsck-root.service
2014-02-10 11:59:07 +01:00
Vincent Batts fcf90586a2 nspawn: require /etc/os-release only for init
/etc/os-release is expected for the case for booting a full system, and
need not be required for thin container execution.
2014-02-10 11:57:53 +01:00
Tom Gundersen d50cf59b94 networkd: fix setting dns from dhcp 2014-02-10 11:53:20 +01:00
Zbigniew Jędrzejewski-Szmek 49888ca9ef manager: fix initialization of plymouth socket
I'm not sure why this makes a difference...
2014-02-08 16:19:22 -05:00
Dave Reisner 66a5dbdf28 cryptsetup-generator: auto add deps for device as password
If the password is a device file, we can add Requires/After dependencies
on the device rather than requiring the user to do so.
2014-02-08 13:53:02 -05:00
Zbigniew Jędrzejewski-Szmek 2ba110900a core: use automatic cleanup in two functions 2014-02-08 13:07:39 -05:00
Zbigniew Jędrzejewski-Szmek 550a40eceb core: do not print invalid utf-8 in error messages 2014-02-08 13:07:39 -05:00
Zbigniew Jędrzejewski-Szmek cda7ecb0a3 pam-module: avoid (null) in debug message 2014-02-08 13:07:39 -05:00
Goffredo Baroncelli f27f0e2177 core: fix crashes if locale.conf contains invalid utf-8 string
In the parse_env_file_push() and load_env_file_push() functions, there
are two assert() call to check if the key or value parameters are utf8 valid.

If the strings aren't utf8 valid, assert does abort.

These function are used early by systemd to parse some files. For
example '/etc/locale.conf'. In my case this file contained a not utf8
sequence, which is bad, but systemd crashed during the boot, which
is even worse!

The enclosed patch removes the assert and return -EINVAL if the
sequence is invalid. This is possible because the caller of these
function [1] checks the errors.
So the check of an invalid utf8 sequence is still performed, but
systemd doesn't crash anymore and logs the error.

[1] parse_env_file_internal(), invoked by load_env_file() and
parse_env_file()
2014-02-08 13:07:39 -05:00
Thomas Hindoe Paaboel Andersen ecd2f2c594 remove unused variables 2014-02-07 23:09:40 +01:00
Lennart Poettering ba978d7b32 nspawn: rename --file-label to --apifs-label since it's really just about the API file systems, nothing else 2014-02-07 19:29:28 +01:00
Lennart Poettering 4e2f8d2778 core: when an already abandoned unit gets abandoned again generate a clean error 2014-02-07 19:26:49 +01:00
Lennart Poettering ba4c5d93b7 logind: order all scopes after both systemd-logind.service and
systemd-user-sessions.service

This way at shutdown we can be sure that the sessions go away before the
network.
2014-02-07 17:49:16 +01:00
Tom Gundersen 1a43680949 networkd: netdev - rename Netdev to NetDev
Both in the configuration file format and everywhere else in the code.
2014-02-07 17:07:11 +01:00
Djalal Harouni 99e7e3922e logind: add function session_jobs_reply() to unify the create reply
The session_send_create_reply() function which notifies clients about
session creation is used for both session and user units. Unify the
shared code in a new function session_jobs_reply().

The session_save() will be called unconditionally on sessions since it
does not make sense to only call it if '!session->started', this will
also allow to update the session state as soon as possible.
2014-02-07 16:34:18 +01:00
Lennart Poettering 743970d2ea core: one step back again, for nspawn we actually can't wait for cgroups running empty since systemd will get exactly zero notifications about it 2014-02-07 16:18:16 +01:00
Lennart Poettering 4e05c4951a machined: since we can now somewhat reliable get notifications for dying
scopes we don't need to lower the stop timeout anymore
2014-02-07 16:18:16 +01:00
Tom Gundersen a6cc569e33 sd-dhcp-client: split sd_dhcp_lease from sd_dhcp_client
This allows us users of the library to keep copies of old leases. This is
used by networkd to know what addresses to drop (if any) when the lease
expires.

In the future this may be used by DNAv4 and sd-dhcp-server.
2014-02-07 15:48:35 +01:00
Lennart Poettering a50df72b37 logind: given that we can now relatively safely shutdown sessions copes
without working cgroup empty notifications there's no need to set the
stop timeout of sessions scopes low
2014-02-07 15:14:36 +01:00
Lennart Poettering 5ba6985b6c core: allow PIDs to be watched by two units at the same time
In some cases it is interesting to map a PID to two units at the same
time. For example, when a user logs in via a getty, which is reexeced to
/sbin/login that binary will be explicitly referenced as main pid of the
getty service, as well as implicitly referenced as part of the session
scope.
2014-02-07 15:14:36 +01:00
Lennart Poettering 8190da36f7 core: don't send duplicate SIGCONT when killing units 2014-02-07 15:14:36 +01:00
Lennart Poettering 6e8314c420 cgroup: make sure to properly send SIGCONT to all processes of a cgroup if that's requested 2014-02-07 15:14:36 +01:00
Lennart Poettering 5f41d1f10f logind: rework session shutdown logic
Simplify the shutdown logic a bit:

- Keep the session FIFO around in the PAM module, even after the session
  shutdown hook has been finished. This allows logind to track precisely
  when the PAM handler goes away.

- In the ReleaseSession() call start a timer, that will stop terminate
  the session when elapsed.

- Never fiddle with the KillMode of scopes to configure whether user
  processes should be killed or not. Instead, simply leave the scope
  units around when we terminate a session whose processes should not be
  killed.

- When killing is enabled, stop the session scope on FIFO EOF or after
  the ReleaseSession() timeout. When killing is disabled, simply tell
  PID 1 to abandon the scope.

Because the scopes stay around and hence all processes are always member
of a scope, the system shutdown logic should be more robust, as the
scopes can be shutdown as part of the usual shutdown logic.
2014-02-07 15:14:36 +01:00
Lennart Poettering a911bb9ab2 core: watch SIGCHLD more closely to track processes of units with no reliable cgroup empty notifier
When a process dies that we can associate with a specific unit, start
watching all other processes of that unit, so that we can associate
those processes with the unit too.

Also, for service units start doing this as soon as we get the first
SIGCHLD for either control or main process, so that we can follow the
processes of the service from one to the other, as long as process that
remain are processes of the ones we watched that died and got reassigned
to us as parent.

Similar, for scope units start doing this as soon as the scope
controller abandons the unit, and thus management entirely reverts to
systemd. To abandon a unit introduce a new Abandon() scope unit method
call.
2014-02-07 15:14:36 +01:00
Thomas Hindoe Paaboel Andersen 1006a62d20 core: fix warning
introduced in c7040b5d1c
2014-02-07 00:01:19 +01:00
Tom Gundersen 5d63309cf5 nspawn: fix HAVE_SELINUX ifdef 2014-02-06 17:30:01 +01:00
Zbigniew Jędrzejewski-Szmek 75cb8502df transaction: print more information about conflicting jobs
Also remove some debug statement that should not have been committed.
2014-02-06 00:46:15 -05:00
Lennart Poettering 97e0691f85 core: only send SIGHUP when doing first kill, not when doing final sigkill 2014-02-06 02:13:23 +01:00
Zbigniew Jędrzejewski-Szmek 90b2de37b8 Update some message formats
Use PID_FMT/USEC_FMT/... in more places.

Also update logind error messages to print the full path to a file that
failed. This should make debugging easier for people who do not know
off the top of their head where logind stores it state.
2014-02-05 19:00:36 -05:00
Lennart Poettering 284c0b9176 nspawn: add --quiet switch for turning off any output noise 2014-02-06 00:43:14 +01:00
Lennart Poettering 1c03020cc4 nspawn: always use default bus 2014-02-05 23:06:34 +01:00
Lennart Poettering f4d140e9a6 bus: properly unset default bus pointer when destroying last reference 2014-02-05 23:06:13 +01:00
Lennart Poettering a4cd87e9dc man: introduce new "Desktop" property for sessions
This is initialized from XDG_SESSION_DESKTOP and is useful for GNOME
to recognize its own sessions. It's supposed to be set to a short string
identifying the session, such as "kde" or "gnome".
2014-02-05 20:44:49 +01:00