Commit graph

26 commits

Author SHA1 Message Date
Lennart Poettering 7027ff61a3 nspawn: introduce the new /machine/ tree in the cgroup tree and move containers there
Containers will now carry a label (normally derived from the root
directory name, but configurable by the user), and the container's root
cgroup is /machine/<label>. This label is called "machine name", and can
cover both containers and VMs (as soon as libvirt also makes use of
/machine/).

libsystemd-login can be used to query the machine name from a process.

This patch also includes numerous clean-ups for the cgroup code.
2013-04-16 04:41:21 +02:00
Lennart Poettering 97e1305817 sd-login: add a sd_pid_get_user_unit() call 2013-04-15 14:16:45 +02:00
Zbigniew Jędrzejewski-Szmek bcb161b023 errno is positive
Make sure we compare errno against positive error codes.
The ones in hwclock.c and install.c can have an impact, the
rest are unlikely to be hit or in code that isn't widely
used.

Also check that errno > 0, to help gcc know that we are
returning a negative error code.
2013-04-11 19:13:18 -04:00
Lennart Poettering 667c24a6a8 login: add sd_login_monitor_get_timeout() public api call
We don't need this right now, but we should keep our options open, in
case we need more than just an fd for waking up.
2013-04-04 18:31:22 +02:00
Lennart Poettering dace83cbd0 login: add new public API call sd_login_monitor_get_events() to get poll() flags to wait for
We should keep our options open, so that we can watch for POLLOUT later
on if we wish to. CUrrently this call will always return POLLIN however.
2013-04-04 17:38:08 +02:00
Harald Hoyer a5c32cff1f 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
2013-02-14 16:19:38 +01:00
Lennart Poettering 092c4c437f Revert "log_error() if inotify_add_watch() fails"
This reverts commit 2826d14091.

We never should generate log messages from a library.
2013-02-13 16:25:33 +01:00
Harald Hoyer 2826d14091 log_error() if inotify_add_watch() fails
[zj: Reworded message s/to watch/to add watch on/ to make it clear
     that it was the watch init action that failed, and not the
     "process of watching". I think this way it'll be clearer to
     people who don't know what inotify does.]
2013-02-13 10:04:02 -05:00
Thomas Hindoe Paaboel Andersen 641906e936 use strneq instead of strncmp 2013-02-13 00:56:13 +01:00
Lennart Poettering c84f5e4a82 login: introduce sd_session_get_tty() 2013-01-15 03:01:35 +01:00
Lennart Poettering 7d5e9c0f60 util: define union dirent_storage and make use of it everywhere
Make sure to allocate enough space for readdir_r().

https://bugzilla.redhat.com/show_bug.cgi?id=858754
2012-09-19 22:21:09 +02:00
Lennart Poettering d18dff430b login: reshuffle meaning of require_active parameter 2012-09-12 08:30:35 +02:00
Colin Guthrie 2dc8f41a2b 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.
2012-09-12 08:19:54 +02:00
Lennart Poettering 20747498c6 login: wrap CanTTY and CanGraphical seat attributes in libsystemd-login 2012-06-21 16:52:54 +02:00
Lennart Poettering 0604381b9d logind: introduce a state for session, being one of online, active, closing
online = logged in
active = logged in and session is in the fg
closing = nominally logged out but some left-over processes still around

Related to:

https://bugzilla.gnome.org/show_bug.cgi?id=677556
2012-06-21 16:14:53 +02:00
Lennart Poettering ba1261bc02 build-sys: fix built with --disable-logind 2012-05-30 22:25:01 +02:00
Lennart Poettering 5430f7f2bc 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.
2012-04-12 00:24:39 +02:00
Lennart Poettering fc8af9ff3f login: introduce sd_session_get_display() 2012-02-15 04:56:10 +01:00
Lennart Poettering 51f58f083a login: add new sd_session_get_type() and sd_session_get_class API calls 2012-02-14 21:54:00 +01:00
Lennart Poettering 50b1678aab sd-login: if NULL or 0 is passed as first parameter of the sd_xxx functions, work on objects of the calling process 2012-02-13 23:50:02 +01:00
Lennart Poettering ebda471d89 sd-login: teach sd_pid_get_unit() proper handling of instantiated services 2012-01-13 00:49:02 +01:00
Lennart Poettering eff406331a login: implement sd_session_get_service() 2012-01-05 23:14:22 +01:00
Lennart Poettering 94fb446e55 journald: store _SYSTEMD_UNIT= instead of _SYSTEMD_SERVICE= field, since processes might also be related to mount, swap or socket units, not just services 2012-01-04 15:35:30 +01:00
Lennart Poettering addedec48b logind: if we can't open /dev/tty0, assume there is no VT subsystem and don't pretend we could do VT switching 2012-01-03 21:47:54 +01:00
Lennart Poettering 9847946e12 login: introduce sd_pid_get_service() 2012-01-03 21:08:58 +01:00
Lennart Poettering 4bba9156da logind: move logind into its own subdirectory 2011-12-31 03:16:08 +01:00
Renamed from src/sd-login.c (Browse further)