Commit Graph

159 Commits

Author SHA1 Message Date
Lennart Poettering 9185c8e626 time-util: also rename FORMAT_TIMESTAMP_PRETTY → _MAX 2012-11-23 22:51:55 +01:00
Lennart Poettering bbb8486e17 util: rename format_timestamp_pretty() to format_timestamp_relative() because that describes much better what it does 2012-11-23 22:12:59 +01:00
Colin Walters 1a37b9b904 dbus-common: Add helper method to handle no-reply messages
[Tested in latest gnome-ostree; if accepted, I'll look at a followup
 patch which fixes the other dbus_connection_send(reply, ...) calls
 besides logind]

DBus messages can have a flag NO_REPLY associated that means "I don't
need a reply".  This is for efficiency reasons - for one-off requests
that can't return an error, etc.

However, it's up to users to manually check
dbus_message_get_no_reply() from a message.  libdbus will happily send
out a reply if you don't.

Unfortunately, doing so is not just less efficient - it also triggers
a security error, for complex reasons.  This is something that will
eventually be fixed in dbus, but it's also correct to handle it in
client applications.

This new helper API is slightly nicer in that you don't have to pass
NULL to say you don't want a reply serial for your reply.

This patch also tweaks logind to use the API - there are more areas of
the code that need this treatment too.
2012-11-20 19:12:19 +01:00
Michal Schmidt 45a5ff0de7 util: nicer tree drawings
Draw trees more similar to pstree/findmnt/lsblk/...
2012-11-12 22:27:48 +01:00
Dave Reisner a9cdc94f7f enable localization for common *ctl commands 2012-11-12 14:16:07 -05:00
Michal Schmidt c339d9775d util : fallback to plain ASCII drawing if locale is not UTF-8
When printing cgroup and sysfs hierarchies, avoid using UTF-8 box drawing
characters if the locale is not UTF-8.

https://bugzilla.redhat.com/show_bug.cgi?id=871153
2012-11-02 17:39:52 +01:00
Lennart Poettering 978cf3c75f logind: it's OK if a process on an pty requests a session for seat0
After all, if a sudo/su inside an X terminal should get added to the
same session as the X session itself.
2012-10-30 03:40:42 +01:00
Lennart Poettering 7ba6438631 logind: unify all session lock loop 2012-10-30 03:40:42 +01:00
Zbigniew Jędrzejewski-Szmek 92b3623304 login: trivial grammar fix 2012-10-28 22:43:11 +01:00
Lennart Poettering 7654b2c259 logind: add 'lock' as possible choice for handling hw keys 2012-10-28 12:29:27 +01:00
Lennart Poettering 6524990fdc logind: support for hybrid sleep (i.e. suspend+hibernate at the same time) 2012-10-28 00:50:35 +02:00
Lennart Poettering 8481248b9f util: unify usage of on_tty() in util.c 2012-10-19 00:07:55 +02:00
Lennart Poettering c846716a5a loginctl: show pager also for status command 2012-10-17 21:25:42 +02:00
Lennart Poettering 6d0274f115 timedatectl: introduce new command line client for timedated
Much like logind has a client in loginctl, and journald in journalctl
introduce timedatectl, to change the system time (incl. RTC), timezones
and related settings.
2012-10-17 21:25:42 +02:00
Lennart Poettering 7708588119 logind: only release logind session from the PAM module if the same module instance actually created it 2012-10-16 19:21:21 +02:00
Zbigniew Jędrzejewski-Szmek 1ca6783f5e log: introduce a macro to format message id
The MESSAGE_ID=... stanza will appear in countless number of places.
It is just too long to write it out in full each time.

Incidentally, this also fixes a typo of MESSSAGE is three places.
2012-10-13 14:26:30 +02:00
Lennart Poettering 083f4da2a8 logind: expose missing signals in Session bus objects 2012-10-09 00:49:53 +02:00
Сковорода Никита Андреевич 2f1bb51336 man: handle-sleep-key is invalid, replace it with handle-suspend-key and handle-hibernate-key in systemd-inhibit help and man. 2012-10-03 19:15:02 -04:00
Lennart Poettering a8573ccc35 pam: check environ[] for XDG_SEAT as fallback
This is useful for systems such as kmscon which want to invoke classic
/sbin/login but use it on multiple seats.
2012-10-01 14:50:05 -04:00
Lennart Poettering aaeef05886 multi-seat-x: drop a lot of unnecessary code 2012-09-21 17:03:40 +02:00
Lennart Poettering 8e7705e52a pam: document that we don't do error checking when parsing vtnr 2012-09-21 16:17:26 +02:00
Lukas Nykryn 5d5e98eb8c login: missing break for getopt ARG_NO_ASK_PASSWORD in loginctl 2012-09-21 16:12:55 +02:00
Václav Pavlín ca4f2b6d6d login: check return value of session_get_idle_hint 2012-09-21 16:08:54 +02:00
Václav Pavlín 5a165aa6b9 logind: check return value, log warning on error 2012-09-21 16:04:48 +02:00
Dave Airlie e57d4fa35e multi-seat-x: drop framebuffer specific stuff, as we have a DRM driver now 2012-09-21 15:53:10 +02:00
Lennart Poettering ec29187225 Revert "multi-seat: drop multi-seat-x wrapper, as upstream X can handle multi-seat graphics on its own now"
This reverts commit 636d30a089.

Turns out we will need the multi-seat wrapper a bit longer, however
without the fb-specific bits in it.
2012-09-21 15:51:04 +02:00
Lennart Poettering 8e7fd6ade4 logind: split up HandleSleepKey= into HandleSuspendKey= and HandleHibernateKey=
The kernel and X11 distuingish these two, and Thinkpad keys have both,
hence we really should distinguish them too.
2012-09-21 15:44:14 +02:00
Lennart Poettering 636d30a089 multi-seat: drop multi-seat-x wrapper, as upstream X can handle multi-seat graphics on its own now 2012-09-21 12:46:22 +02:00
Lennart Poettering 409133be63 logind: allow users to override their own suspend/sleep inhibitors 2012-09-21 11:57:48 +02: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 65b5116220 logind: if a lid-switch lock was taken while the lid was closed, recheck lid status when the lock is released 2012-09-19 15:42:29 +02:00
Lennart Poettering f981b9c5be logind: properly parse handle-lid-switch inhibitor 2012-09-19 15:29:24 +02:00
Lennart Poettering 12a1309e11 man: document new inhibitor types 2012-09-19 15:28:55 +02:00
Lennart Poettering beaafb2ea6 logind: rework power key/suspend key/lid switch handling
http://lists.freedesktop.org/archives/systemd-devel/2012-September/006604.html
https://bugzilla.gnome.org/show_bug.cgi?id=680689

This changes the meaning of the
HandlePowerKey=/HandleSleepKey=/HandleLidSwitch= setting of logind.conf
2012-09-19 13:10:10 +02:00
Lennart Poettering b14eda963c logind: split up inhibit acquire policy 2012-09-18 01:16:23 +02:00
Lennart Poettering d4d882e5ce logind: make VT reservation logic compatible with containers 2012-09-17 19:11:48 +02:00
Lennart Poettering 98a77df5fe logind: make sure there's always a getty available on TTY6
Previously, if X allocated all 6 TTYs (for multi-session for example) no
getty would be available anymore to guarantee console-based logins.

With the new ReserveVT= switch in logind.conf we can now choose one VT
(6 by default) that will always be subject to autovt-style activation,
i.e. we'll always have a getty on TTY6, and X will never take possession
of it.
2012-09-17 12:39:16 +02:00
Zbigniew Jędrzejewski-Szmek 4a271908f1 logind: redefine idleness to start at last activity
Before, after the timeout, a session would be timestamped as idle
since 'last activity' + 'idle timeout'. Now, it is timestamped as idle
since 'last activity'.

Before, after all sessions were idle, the seat would be marked with as
idle with the timestamp of the oldest idle session. Now it is
marked with the timestamp of the youngest idle session.

Both changes seem to me to be closer to natural understanding of
idleness: the time since last activity counts.
2012-09-16 11:34:53 +02:00
Lennart Poettering d18dff430b login: reshuffle meaning of require_active parameter 2012-09-12 08:30:35 +02:00
Colin Guthrie 78ab361c8f logind: Avoid unnecesary rewrite of user file when switching sessions of the same user. 2012-09-12 08:20:01 +02:00
Colin Guthrie 23bd3b6263 logind: Ensure the user, seat and session files are updated when the session is closing. 2012-09-12 08:19:59 +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
Colin Guthrie 47acb2f15f 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.
2012-09-12 08:19:43 +02:00
Colin Guthrie c9caad8021 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.
2012-09-12 08:19:40 +02:00
Colin Guthrie f904bdf2e9 pam: Add session class to the debug log. 2012-09-12 08:19:23 +02:00
Lennart Poettering 77030bd65f inhibit: close all fds when invoking inhibited tool 2012-09-10 09:45:55 +02:00
Lennart Poettering 3137e0bd52 dbus: minor coding style fixes 2012-09-10 09:38:49 +02:00
Matthias Clasen 680258b112 Make systemd-inhibit --list work
The code in the print_inhibitors function had an unintended
unconditional early exit, causing it to never print any
inhibitors.
2012-09-10 09:32:50 +02:00
Lennart Poettering 877d54e9b0 journal: generate structured journal messages for a number of events 2012-09-03 18:59:04 -07:00
Lukas Nykryn a34faf579d login: check return of parse_pid and parse_uid 2012-08-23 13:53:30 +02:00