b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file. |
2adae5ac5dd87cc6426ae0aa22116f20abc6646f |
|
18-Jan-2016 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
logind: simplify job variable handling
manager_{start,stop}_{slice,scope,unit} functions had an optional job
output parameter. But all callers specified job, so make the parameter
mandatory, add asserts. Also extract common job variable handling to
a helper function to avoid duplication.
Avoids gcc warning about job being unitialized. |
b3267152783d5784c45010615045d4e8ee459da2 |
|
13-Jan-2016 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tree-wide: check if errno is greater than zero (2)
Compare errno with zero in a way that tells gcc that
(if the condition is true) errno is positive. |
4afd3348c7506dd1d36305b7bcb9feb8952b9d6b |
|
27-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy
GLIB has recently started to officially support the gcc cleanup
attribute in its public API, hence let's do the same for our APIs.
With this patch we'll define an xyz_unrefp() call for each public
xyz_unref() call, to make it easy to use inside a
__attribute__((cleanup())) expression. Then, all code is ported over to
make use of this.
The new calls are also documented in the man pages, with examples how to
use them (well, I only added docs where the _unref() call itself already
had docs, and the examples, only cover sd_bus_unrefp() and
sd_event_unrefp()).
This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we
tend to call our destructors these days.
Note that this defines no public macro that wraps gcc's attribute and
makes it easier to use. While I think it's our duty in the library to
make our stuff easy to use, I figure it's not our duty to make gcc's own
features easy to use on its own. Most likely, client code which wants to
make use of this should define its own:
#define _cleanup_(function) __attribute__((cleanup(function)))
Or similar, to make the gcc feature easier to use.
Making this logic public has the benefit that we can remove three header
files whose only purpose was to define these functions internally.
See #2008. |
a832ab6f9953d070ee8f5cf2c7869425760b2645 |
|
16-Nov-2015 |
David Herrmann <dh.herrmann@gmail.com> |
login: fix re-use of users
If the last reference to a user is released, we queue stop-jobs for the
user-service and slice. Only once those are finished, we drop the
user-object. However, if a new session is opened before the user object is
fully dropped, we currently incorrectly re-use the object. This has the
effect, that we get stale sessions without a valid "systemd --user"
instance.
Fix this by properly allowing user_start() to be called, even if
user->stopping is true. |
b690ef12b59187074cf5a9c02a69d06fa1398789 |
|
16-Nov-2015 |
David Herrmann <dh.herrmann@gmail.com> |
login: make user->service static
Just like user->slice, there is no reason to store the unit name in /run,
nor should we allocate it dynamically on job instantiation/removal. Just
keep it statically around at all times and rely on user->started ||
user->stopping to figure out whether the unit exists or not. |
157f50577fbee094eb8ca18f3f0af4e82af8558f |
|
16-Nov-2015 |
David Herrmann <dh.herrmann@gmail.com> |
login: make user_new() and user_free() follow coding-style
Few changes to user_new() and user_free():
- Use _cleanup_(user_freep) in constructor
- return 'int' from user_new()
- make user_free() deal with partially initialized objects
- keep reverse-order in user_free() compared to user_new()
- make user_free() return NULL
- make user_free() accept NULL as no-op |
6230bf750a4c41ff9a7ec291243fc92b059e896b |
|
16-Nov-2015 |
David Herrmann <dh.herrmann@gmail.com> |
login: keep user->slice constant
Currently, we allocate user->slice when starting a slice, but we never
release it. This is incompatible if we want to re-use a user object once
it was stopped. Hence, make sure user->slice is allocated statically on
the user object and use "u->started || u->stopping" as an indication
whether the slice is actually available on pid1 or not. |
f9e4283df30ad8916878396da449b2e38656b6f7 |
|
16-Nov-2015 |
David Herrmann <dh.herrmann@gmail.com> |
login: simply XDG_RUNTIME_DIR management
Lets not pretend we support changing XDG_RUNTIME_DIR via logind state
files. There is no reason to ever write the string into /run, as we
allocate it statically based on the UID, anyway. Lets stop that and just
allocate the runtime_path in "struct User" at all times.
We keep writing it into the /run state to make sure pam_systemd of
previous installs can still read it. However, pam_systemd is now fixed to
allocate it statically as well, so we can safely remove that some time in
the future.
Last but not least: If software depends on systemd, they're more than free
to assume /run/user/$uid is their runtime dir. Lets not require sane
applications to query the environment to get their runtime dir. As long as
applications know their login-UID, they should be safe to deduce the
runtime dir. |
90558f315844ec35e3fd4f1a19ac38c8721c9354 |
|
13-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
logind: add a new UserTasksMax= setting to logind.conf
This new setting configures the TasksMax= field for the slice objects we
create for each user.
This alters logind to create the slice unit as transient unit explicitly
instead of relying on implicit generation of slice units by simply
starting them. This also enables us to set a friendly description for
slice units that way. |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
ee104e11e303499a637c5cd8157bd12ad5cc116d |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
user-util: move UID/GID related macros from macro.h to user-util.h |
8b43440b7ef4b81c69c31de7ff820dc07a780254 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move string table stuff into its own string-table.[ch] |
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move a number of fs operations into fs-util.[ch] |
4349cd7c1d153c4ffa23cf1cff1644e0afa9bcf0 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move mount related utility calls to mount-util.[ch] |
6bedfcbb2970e06a4d3280c8fb62083d252ede73 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split string parsing related calls from util.[ch] into parse-util.[ch] |
3ffd4af22052963e7a29431721ee204e634bea75 |
|
25-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them
over. |
4f5dd3943bef8a04be7e3b838b822bb9a7ad6cb3 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util: split out escaping code into escape.[ch]
This really deserves its own file, given how much code this is now. |
12ca818ffddb77eb6a0fabe369a5bcbf6994ff8b |
|
30-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: clean up log_syntax() usage
- Rely everywhere that we use abs() on the error code passed in anyway,
thus don't need to explicitly negate what we pass in
- Never attach synthetic error number information to log messages. Only
log about errors we *receive* with the error number we got there,
don't log any synthetic error, that don#t even propagate, but just eat
up.
- Be more careful with attaching exactly the error we get, instead of
errno or unrelated errors randomly.
- Fix one occasion where the error number and line number got swapped.
- Make sure we never tape over OOM issues, or inability to resolve
specifiers |
59f448cf15f94bc5ebfd5b254de6f2441d02fbec |
|
10-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: never use the off_t unless glibc makes us use it
off_t is a really weird type as it is usually 64bit these days (at least
in sane programs), but could theoretically be 32bit. We don't support
off_t as 32bit builds though, but still constantly deal with safely
converting from off_t to other types and back for no point.
Hence, never use the type anymore. Always use uint64_t instead. This has
various benefits, including that we can expose these values directly as
D-Bus properties, and also that the values parse the same in all cases. |
a1e58e8ee1c84b633d6d6d651d5328d4dd4eba5b |
|
09-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: use coccinelle to patch a lot of code to use mfree()
This replaces this:
free(p);
p = NULL;
by this:
p = mfree(p);
Change generated using coccinelle. Semantic patch is added to the
sources. |
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9 |
|
29-Jul-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: port everything over to fflush_and_check()
Some places invoked fflush() directly with their own manual error
checking, let's unify all that by using fflush_and_check().
This also unifies the general error paths of fflush()+rename() file
writers. |
71161305f191d1fe1242ccca47657f9ab51caad4 |
|
17-Jun-2015 |
Simon McVittie <simon.mcvittie@collabora.co.uk> |
logind: save /run/systemd/users/UID before starting user@.service
Previously, this had a race condition during a user's first login.
Some component calls CreateSession (most likely by a PAM service
other than 'systemd-user' running pam_systemd), with the following
results:
- logind:
* create the user's XDG_RUNTIME_DIR
* tell pid 1 to create user-UID.slice
* tell pid 1 to start user@UID.service
Then these two processes race:
- logind:
* save information including XDG_RUNTIME_DIR to /run/systemd/users/UID
- the subprocess of pid 1 responsible for user@service:
* start a 'systemd-user' PAM session, which reads XDG_RUNTIME_DIR
and puts it in the environment
* run systemd --user, which requires XDG_RUNTIME_DIR in the
environment
If logind wins the race, which usually happens, everything is fine;
but if the subprocesses of pid 1 win the race, which can happen
under load, then systemd --user exits unsuccessfully.
To avoid this race, we have to write out /run/systemd/users/UID
even though the service has not "officially" started yet;
previously this did an early-return without saving anything.
Record its state as OPENING in this case.
Bug: https://github.com/systemd/systemd/issues/232
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> |
9e281beb8ebff96366eff63bd54087681706c803 |
|
17-Jun-2015 |
Lennart Poettering <lennart@poettering.net> |
logind: apply selinux label to XDG_RUNTIME_DIR
As discussed in #257: we should ensure the selinux label is correctly
applied to each user's XDG_RUNTIME_DIR. |
5cb14b3742038b28551b161635a0cba3559404b2 |
|
16-Jun-2015 |
Lennart Poettering <lennart@poettering.net> |
everywhere: actually make use of DUAL_TIMESTAMP_NULL macro
Let's use it as initializer where appropriate. |
b9460fdc8b57102b665a662b82efcced4b1af72b |
|
15-Jun-2015 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
login: fix potential null pointer dereference
Fix CID 1304686: Dereference after null check (FORWARD_NULL)
However, this commit does not fix any bug in logind. It helps to keep
the elect_display_compare() function generic. |
cde40acc805b855909b95f15fd9a3111e40be672 |
|
10-Jun-2015 |
Lennart Poettering <lennart@poettering.net> |
logind,sd-event: drop spurious new-lines |
7ffeb45cc63e1326690fd9461b7a4719a3d4f85c |
|
05-Jun-2015 |
Philip Withnall <philip.withnall@collabora.co.uk> |
logind: Fix user_elect_display() to be more stable
The previous implementation of user_elect_display() could easily end up
overwriting the user’s valid graphical session with a new TTY session.
For example, consider the situation where there is one session:
c1, type = SESSION_X11, !stopping, class = SESSION_USER
it is initially elected as the user’s display (i.e. u->display = c1).
If another session is started, on a different VT, the sessions_by_user
list becomes:
c1, type = SESSION_X11, !stopping, class = SESSION_USER
c2, type = SESSION_TTY, !stopping, class = SESSION_USER
In the previous code, graphical = c1 and text = c2, as expected.
However, neither graphical nor text fulfil the conditions for setting
u->display = graphical (because neither is better than u->display), so
the code falls through to check the text variable. The conditions for
this match, as u->display->type != SESSION_TTY (it’s actually
SESSION_X11). Hence u->display is set to c2, which is incorrect, because
session c1 is still valid.
Refactor user_elect_display() to use a more explicit filter and
pre-order comparison over the sessions. This can be demonstrated to be
stable and only ever ‘upgrade’ the session to a more graphical one.
https://bugs.freedesktop.org/show_bug.cgi?id=90769 |
e26d6ce517a49c246141ed20528614823c2f5799 |
|
29-May-2015 |
Martin Pitt <martin.pitt@ubuntu.com> |
path-util: Change path_is_mount_point() symlink arg from bool to flags
This makes path_is_mount_point() consistent with fd_is_mount_point() wrt.
flags. |
7410616cd9dbbec97cf98d75324da5cda2b2f7a2 |
|
06-May-2015 |
Lennart Poettering <lennart@poettering.net> |
core: rework unit name validation and manipulation logic
A variety of changes:
- Make sure all our calls distuingish OOM from other errors if OOM is
not the only error possible.
- Be much stricter when parsing escaped paths, do not accept trailing or
leading escaped slashes.
- Change unit validation to take a bit mask for allowing plain names,
instance names or template names or an combination thereof.
- Refuse manipulating invalid unit name |
6482f6269c87d2249e52e889a63adbdd50f2d691 |
|
10-Apr-2015 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
shared: add formats-util.h |
c6878637502b1717a110a9a7e8bba32a8583fcdf |
|
06-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
util: rework rm_rf() logic
- Move to its own file rm-rf.c
- Change parameters into a single flags parameter
- Remove "honour sticky" logic, it's unused these days |
2eec67acbb00593e414549a7e5b35eb7dd776b1b |
|
23-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
remove unused includes
This patch removes includes that are not used. The removals were found with
include-what-you-use which checks if any of the symbols from a header is
in use. |
a9c67ea2a24d61640971fc1ca366a3e6c7d75266 |
|
10-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
logind: tell Coverity that we knowingly ignore mkdir()'s return value |
63c372cb9df3bee01e3bf8cd7f96f336bddda846 |
|
03-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
util: rework strappenda(), and rename it strjoina()
After all it is now much more like strjoin() than strappend(). At the
same time, add support for NULL sentinels, even if they are normally not
necessary. |
11c6476a08af7a8a9ae6a2d0f8370587f7b31663 |
|
27-Jan-2015 |
Christian Seiler <christian@iwakd.de> |
logind: chown+chmod /run/user/$UID if mount(tmpfs) fails with EPERM
In containers without CAP_SYS_ADMIN, it is not possible to mount tmpfs
(or any filesystem for that matter) on top of /run/user/$UID.
Previously, logind just failed in such a situation.
Now, logind will resort to chown+chmod of the directory instead. This
allows logind still to work in those environments, although without the
guarantees it provides (i.e. users not being able to DOS /run or other
users' /run/user/$UID space) when CAP_SYS_ADMIN is available. |
4d858e7d9f39038713f760d7acc64acf7bba2aa7 |
|
27-Jan-2015 |
Christian Seiler <christian@iwakd.de> |
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. |
8cb4ab0058e51f1fba93683d145ef95f97c2fa86 |
|
09-Jan-2015 |
Lennart Poettering <lennart@poettering.net> |
logind: unify how we cast between uid_t and pointers for hashmap keys |
56f64d95763a799ba4475daf44d8e9f72a1bd474 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: use log_*_errno whenever %m is in the format string
If the format string contains %m, clearly errno must have a meaningful
value, so we might as well use log_*_errno to have ERRNO= logged.
Using:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/'
Plus some whitespace, linewrap, and indent adjustments. |
f647962d64e844689f3e2acfce6102fc47e76df2 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: yet more log_*_errno + return simplifications
Using:
find . -name '*.[ch]' | while read f; do perl -i.mmm -e \
'local $/;
local $_=<>;
s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg;
print;'
$f
done
And a couple of manual whitespace fixups. |
da927ba997d68401563b927f92e6e40e021a8e5c |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values. |
0a1beeb64207eaa88ab9236787b1cbc2f704ae14 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: auto-convert the simple cases to log_*_errno()
As a followup to 086891e5c1 "log: add an "error" parameter to all
low-level logging calls and intrdouce log_error_errno() as log calls
that take error numbers", use sed to convert the simple cases to use
the new macros:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/'
Multi-line log_*() invocations are not covered.
And we also should add log_unit_*_errno(). |
6baa7db00812437bbc87e73faa1a11b6cf631958 |
|
23-Oct-2014 |
Lennart Poettering <lennart@poettering.net> |
mac: also rename use_{smack,selinux,apparmor}() calls so that they share the new mac_{smack,selinux,apparmor}_xyz() convention |
374738d55b2bc4ab07c22f9a0be95a76de1c9478 |
|
09-Oct-2014 |
Lukasz Skalski <l.skalski@samsung.com> |
logind: mount per-user tmpfs with 'smackfsroot=*' for smack enabled systems |
e9e74f28d783a052dce7edfa94d7918bb591ba7a |
|
14-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
logind: add new session type "web" for PAM web clients, such as cockpit
On request of Stef Walter. |
952d32609f9bceee444fa2690afb4d28539b4b92 |
|
19-May-2014 |
Lennart Poettering <lennart@poettering.net> |
logind: fix Display property of user objects
When we dropped support for creating a per-user to the "main" X11
display we stopped returning useful data in the "Display" user property.
With this change this is fixed and we again expose an appropriate
(graphical session) in the property that is useful as the "main" one, if
one is needed. |
de0671ee7fe465e108f62dcbbbe9366f81dd9e9a |
|
15-May-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Remove unnecessary casts in printfs
No functional change expected :) |
66cdd0f2d0670b054bd27dad16fcb5838b11dde3 |
|
14-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
logind: automatically remove SysV + POSIX IPC objects when the users owning them fully log out |
1c231f56482546725c4dbd3303f70300bd3c63e9 |
|
04-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
logind: make $XDG_RUNTIME_DIR a per-user tmpfs
This way each user allocates from his own pool, with its own size limit.
This puts the size limit by default to 10% of the physical RAM size but
makes it configurable in logind.conf. |
b58b227a53ee2b9feba8433a1558b51132ffb18b |
|
13-Feb-2014 |
Djalal Harouni <tixxdz@opendz.org> |
logind: make sure to terminate systemd user on logouts
Currently if the user logs out, the GC may never call user_stop(),
this will not terminate the systemd user and (sd-pam) of that user.
To fix this, remove the USER_CLOSING state check that is blocking the
GC from calling user_stop(). Since if user_check_gc() returns false
this means that all the sessions of the user were removed which will
make user_get_state() return USER_CLOSING.
Conclusion: that test will never be statisfied.
So we remove the USER_CLOSING check and replace it with a check inside
user_stop() this way we know that user_stop() has already queued stop
jobs, no need to redo.
This ensures that the GC will get its two steps correctly as pointed out
by Lennart:
http://lists.freedesktop.org/archives/systemd-devel/2014-February/016825.html
Note: this also fixes another bug that prevents creating the user
private dbus socket which will break communications with the user
manager. |
9bb69af4f2823fdd30902f5ffd959e9b041feb53 |
|
12-Feb-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
logind: always kill session when termination is requested
KillUserProcesses=yes/no should be ignored when termination is
explicitly requested. |
00555a2ee1b008bccbb570320047307b8b9159f9 |
|
11-Feb-2014 |
Djalal Harouni <tixxdz@opendz.org> |
logind: use session_get_state() to get sessions state of the user
In function user_get_state() remove the session_is_active() check, just
count on the session_get_state() function to get the correct session
state.
session_is_active() may return true before starting the session scope
and user service, this means it will return true even before the creation
of the session fifo_fd which will produce incorrect states.
So be consistent and just use session_get_state(). |
5f41d1f10fd97e93517b6a762b1bec247f4d1171 |
|
07-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
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. |
90b2de37b80603168f4e9c9c81cff7eea4efa21a |
|
06-Feb-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
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. |
eb53c37e2eb1ff9e2dbf370985dd53c62a98fa66 |
|
22-Dec-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
logind: remove dead variable
Noticed-by: Jan Alexander Steffens <jan.steffens@gmail.com> |
63966da86d8e71b1f3f2b57d5448770d526421f9 |
|
18-Dec-2013 |
Thomas Bächler <thomas@archlinux.org> |
login: Don't stop a running user manager from garbage-collecting the user.
With the current logic, a user will never be garbage-collected, since its
manager will always be around. Change the logic such that a user is
garbage-collected when it has no sessions and linger is disabled. |
3a9f7a30ce89b44097731310221802f6d72ea752 |
|
05-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
logind: expose linger state on User object |
cc3773810855956bad92337cee8fa193584ab62e |
|
05-Nov-2013 |
Lennart Poettering <lennart@poettering.net> |
logind: port logind to libsystemd-bus |
71fda00f320379f5cbee8e118848de98caaa229d |
|
14-Oct-2013 |
Lennart Poettering <lennart@poettering.net> |
list: make our list macros a bit easier to use by not requring type spec on each invocation
We can determine the list entry type via the typeof() gcc construct, and
so we should to make the macros much shorter to use. |
405e0255d5e6950180d9563f1a26294b5360db03 |
|
13-Aug-2013 |
Lennart Poettering <lennart@poettering.net> |
logind: restore logic to kill user processes when session ends |
d0af76e68a5bab2e4fd9674b1c64a9f38d7afe97 |
|
02-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
logind: after deserializatio readd systemd units to unit-to-object hashmap correctly |
1ee306e1248866617c96ed9f4263f375588ad838 |
|
02-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
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. |
fb6becb4436ae4078337011b2017ce294e7361cf |
|
02-Jul-2013 |
Lennart Poettering <lennart@poettering.net> |
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. |
4ad490007b70e6ac18d3cb04fa2ed92eba1451fa |
|
27-Jun-2013 |
Lennart Poettering <lennart@poettering.net> |
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=). |
9444b1f20e311f073864d81e913bd4f32fe95cfd |
|
20-Jun-2013 |
Lennart Poettering <lennart@poettering.net> |
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. |
ae018d9bc900d6355dea4af05119b49c67945184 |
|
23-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
cgroup: make sure all our cgroup objects have a suffix and are properly escaped
Session objects will now get the .session suffix, user objects the .user
suffix, nspawn containers the .nspawn suffix.
This also changes the user cgroups to be named after the numeric UID
rather than the username, since this allows us the parse these paths
standalone without requiring access to the cgroup file system.
This also changes the mapping of instanced units to cgroups. Instead of
mapping foo@bar.service to the cgroup path /user/foo@.service/bar we
will now map it to /user/foo@.service/foo@bar.service, in order to
ensure that all our objects are properly suffixed in the tree. |
a32360f1a5a85c12f00e9dfb7353280067cccb5b |
|
15-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
core: always create /user and /machine top-level cgroup dirs
This allows clients to put inotify watches on these trees to watch for
state changes, without having to wait until these dirs are created.
This introduces the new top-level /machine cgroup dir as canonical
location where OS containers and VMs shall be located (as discussed with
the libvirt folks). |
a5c32cff1f56afe6f0c6c70d91a88a7a8238b2d7 |
|
14-Feb-2013 |
Harald Hoyer <harald@redhat.com> |
honor SELinux labels, when creating and writing config files
Also split out some fileio functions to fileio.c and provide a SELinux
aware pendant in fileio-label.c
see https://bugzilla.redhat.com/show_bug.cgi?id=881577 |
5a165aa6b9aa921d8b069059026d84e879ac38cc |
|
21-Sep-2012 |
Václav PavlÃn < <vpavlin@redhat.com> |
logind: check return value, log warning on error |
2dc8f41a2bdcc25e6ec69a99cb6f34615cce59a5 |
|
12-Sep-2012 |
Colin Guthrie <colin@mageia.org> |
logind: Add a two new variables to the user session tracking file.
This counts 'online sessions' in addition to 'active sessions' and 'sessions'.
In this context, an 'online session' covers all session in the 'active' state
in addition to the explicit 'online' state.
This provides an easy machanism to determin all relevant sessions easily
(i.e. those that are not 'closing') and adds new semantics to the sd-login.c
APIs sd_uid_get_sessions() and sd_uid_get_seats() where the require_active
argument can be supplied as a value 2 which only lists sessions which are
'online'.
This functionality should allow client applications to avoid deadlocks where
they only exit when all sessions are complete, such as a the problem where
PulseAudio will not exit until all sessions are gone, but in itself prevents
the session from exiting. |
47acb2f15f2319ec0fc341a4271d45067da2ed24 |
|
12-Sep-2012 |
Colin Guthrie <colin@mageia.org> |
logind: Properly list the ACTIVE_SEATS in the user session tracking file.
Prevsiouly the first active seat for a user would never be listed and
any subsequent seats would be concatenated on without any spaces. |
c9caad802128a5dc599342c1400a61f31e8b17b5 |
|
12-Sep-2012 |
Colin Guthrie <colin@mageia.org> |
logind: If all user sessions are in closing state, set the overall status to closing.
PulseAudio for example will keep a client connection open provided
at least one session exists. However, if all sessions are currently
in the process of closing, we should flag that as the overall state
appropriately to better reflect what is happening.
Although this does better reflect the status for any given user, it does
not actually solve the overall problem of PulseAudio still finding some
sessions active and thus not exiting and therefore actually preventing
the session from closing. Future commits will extend sd-login to cope
with this situation. |
0d0f0c50d3a1d90f03972a6abb82e6413daaa583 |
|
26-Jul-2012 |
Shawn Landden <shawnlandden@gmail.com> |
log.h: new log_oom() -> int -ENOMEM, use it
also a number of minor fixups and bug fixes: spelling, oom errors
that didn't print errors, not properly forwarding error codes,
few more consistency issues, et cetera |
669241a076108e0483d7d8475beaa506106d077e |
|
25-Jul-2012 |
Shawn Landden <shawnlandden@gmail.com> |
use "Out of memory." consistantly (or with "\n")
glibc/glib both use "out of memory" consistantly so maybe we should
consider that instead of this.
Eliminates one string out of a number of binaries. Also fixes extra newline
in udev/scsi_id |
2138e96918c7ed6fbf31f5df509f337a1973dfdd |
|
19-Jun-2012 |
Lennart Poettering <lennart@poettering.net> |
login: initialize XDG_RUNTIME_DIR as /run/user/$UID instead of /run/user/$USER
The sssd folks would like to place the kerberos credential cache in
XDG_RUNTIME_DIR, but need to do that in the PAM auth hooks, before
pam_systemd is run as part of the PAM session setup. Hence, in order to
make this easy for them: avoid usage of usernames, and use user IDs
instead thus making an additional NSS lookup unnecessary in the kerberos
bits, but still have the directory well-defined so that the kerberos
bits can determine it before pam_systemd is run. |
e96cd586c5195b73af74791280d8461510258b48 |
|
31-May-2012 |
Lennart Poettering <lennart@poettering.net> |
logind: add new user state 'closing' |
8c8c43515cee56dfc2298998a9e5958308c46f99 |
|
31-May-2012 |
Lennart Poettering <lennart@poettering.net> |
logind: properly clean up user cgroups when they run empty |
d2e54fae5ca7a0f71b5ac8b356a589ff0a09ea0a |
|
31-May-2012 |
Kay Sievers <kay@vrfy.org> |
mkdir: append _label to all mkdir() calls that explicitly set the selinux context |
9b958eff3fbcc345a72315a9167f6217dd841c40 |
|
22-May-2012 |
Lennart Poettering <lennart@poettering.net> |
logind: fix write out of user state file |
5430f7f2bc7330f3088b894166bf3524a067e3d8 |
|
12-Apr-2012 |
Lennart Poettering <lennart@poettering.net> |
relicense to LGPLv2.1 (with exceptions)
We finally got the OK from all contributors with non-trivial commits to
relicense systemd from GPL2+ to LGPL2.1+.
Some udev bits continue to be GPL2+ for now, but we are looking into
relicensing them too, to allow free copy/paste of all code within
systemd.
The bits that used to be MIT continue to be MIT.
The big benefit of the relicensing is that closed source code may now
link against libsystemd-login.so and friends. |
49e942b2bc9fdedba79cd266a076ce9c9d91fc13 |
|
10-Apr-2012 |
Kay Sievers <kay@vrfy.org> |
rename basic.la to shared.la and put selinux deps in shared-selinx.la
Only 34 of 74 tools need libselinux linked, and libselinux is a pain
with its unconditional library constructor. |
129eebe020118fc1bf0274c9ea75ffb6178a280f |
|
18-Jan-2012 |
Lennart Poettering <lennart@poettering.net> |
logind: simplify session_activate() a bit |
1637a8be5570dff7ce402451240b28ddb54e5dca |
|
16-Jan-2012 |
Michal Schmidt <mschmidt@redhat.com> |
logind: downgrade login message to debug
The messages make people nervous.
https://bugzilla.redhat.com/show_bug.cgi?id=727315 |
4bba9156da3e1df2cee24d10d7cd88c776ef4179 |
|
31-Dec-2011 |
Lennart Poettering <lennart@poettering.net> |
logind: move logind into its own subdirectory |