summaryrefslogtreecommitdiff
path: root/src/login/loginctl.c
Commit message (Collapse)AuthorAge
* loginctl: also use $XDG_SESSION_ID for session-statusZbigniew Jędrzejewski-Szmek2017-07-25
|
* loginctl: use $XDG_SESSION_ID for "our" sessionZbigniew Jędrzejewski-Szmek2017-07-25
| | | | | | | | | | | | | | | | Instead of always letting logind guess what the caller's session is, let's give it the value from $XDG_SESSION_ID when it is present in the caller's environment. Nowadays terminal emulators are often running as services under elogind --user, and not as part of an actual session, so all loginctl calls which depend on logind guessing the session will fail. I don't see a reason not to honour $XDG_SESSION_ID. This applies to LockSession, UnlockSession, TerminateSession, ActivateSession, SetUserLinger. Fixes #6032.
* Add short-iso-precise for journalctl output (#5884)Ian Wienand2017-07-25
| | | | | This adds a short-iso-precise option for journalctl output. It is similar to short-iso, but includes microseconds.
* loginctl: fix typo causing ignoring multiple session IDs (#5732)slodki2017-07-25
| | | | Fixes #5733
* Prep v233.3: Add 'loginctl list' as a shorthand for list-sessionsSven Eden2017-07-20
|
* tree-wide: make bus_map_all_properties return a proper sd_bus_errorLennart Poettering2017-07-17
| | | | | | | | And then show it, to make things a bit friendlier to the user if we fail acquiring some props. In fact, this fixes a number of actual bugs, where we used an error structure for output that we actually never got an error in.
* shared/cgroup-show: extract funtion to query unit cgroup pathZbigniew Jędrzejewski-Szmek2017-07-17
| | | | …and use it where possible.
* loginctl: report tty in session listingsZbigniew Jędrzejewski-Szmek2017-07-05
| | | | | | | | | | | | | | | Without the tty it's really hard to tell which session is which. New output: $ ./loginctl SESSION UID USER SEAT TTY 13 1002 zbyszek seat0 tty3 c1 42 gdm seat0 /dev/tty1 11 1002 zbyszek seat0 tty4 3 1002 zbyszek seat0 /dev/tty2 17 1002 zbyszek seat0 tty5 18 1002 zbyszek seat0 tty6 6 sessions listed.
* loginctl: drop casts in printfZbigniew Jędrzejewski-Szmek2017-07-05
|
* Prep v231.2: Apply some minor style fixesSven Eden2017-06-19
|
* Prep v231: Add missing line breaks in loginctl help textSven Eden2017-06-16
|
* Prep v231: Move elogind specific code in login/loginctl.c to login/eloginctl.cSven Eden2017-06-16
|
* systemctl: make sure we terminate the bus connection first, and then close ↵Lennart Poettering2017-06-16
| | | | | | | | | | | | | | | | the pager (#3550) If "systemctl -H" is used, let's make sure we first terminate the bus connection, and only then close the pager. If done in this order ssh will get an EOF on stdin (as we speak D-Bus through ssh's stdin/stdout), and then terminate. This makes sure the standard error we were invoked on is released by ssh, and only that makes sure we don't deadlock on the pager which waits for all clients closing its input pipe. (Similar fixes for the various other xyzctl tools that support both pagers and -H) Fixes: #3543
* sd-bus: make sure bus_map_all_properties() handle booleans rightLennart Poettering2017-06-16
| | | | | | | | | | sd-bus generally exposes bools as "int" instead of "bool" in the public API. This is relevant when unmarshaling booleans, as the relevant functions expect an int* pointer and no bool* pointer. Since sizeof(bool) is not necessarily the same as sizeof(int) this is problematic and might result in memory corruption. Let's fix this, and make sure bus_map_all_properties() handles booleans as ints, as the rest of sd-bus, and make all users of it expect the right thing.
* Prep v230: Update loginctl help textSven Eden2017-06-16
|
* Prep v230: No longer print double messages when shutting down or rebooting.Sven Eden2017-06-16
|
* Prep v230: Add support for scheduled shutdown/reboot and the cancellation of ↵Sven Eden2017-06-16
| | | | them.
* Prep v230: Apply missing upstream fixes and updates (6/8) src/login.Sven Eden2017-06-16
|
* loginctl: add --value optionZbigniew Jędrzejewski-Szmek2017-06-16
|
* systemctl: add --value optionZbigniew Jędrzejewski-Szmek2017-06-16
| | | | | | | | | | With this option, systemctl will only print the rhs in show: $ systemctl show -p Wants,After elogind-journald --value elogind-journald.socket ... elogind-journald-dev-log.socket ... This is useful in scripts, because the need to call awk or similar is removed.
* Prep v229: Add missing fixes from upstream [4/6] src/loginSven Eden2017-05-17
|
* Prep v228: Condense elogind source masks (4/5)Sven Eden2017-04-26
|
* Prep v228: Add remaining updates from upstream (3/3)Sven Eden2017-04-26
| | | | | Apply remaining fixes and the performed move of utility functions into their own foo-util.[hc] files on the rest of elogind.
* Prep v227: Removed src/shared/cgroup-show.[hc], it is not needed.Sven Eden2017-04-10
|
* [4/5] Apply missing fixes from upstreamSven Eden2017-03-29
|
* loginctl: print nontrivial properties in logictl show-*Lukas Nykryn2017-03-29
|
* Rename ELOGIND_CGROUP_CONTROLLER back to SYSTEMD_CGROUP_CONTROLLERSven Eden2017-03-14
| | | | | Although it is nice to have it read ELOGIND instead of SYSTEMD, all diffs just show too many irrelevant (false) positives.
* Add support for building elogind against musl libcSven Eden2017-03-14
| | | | | | | | | | | | | | | | | | | * Check whether printf.h is available and define/undef HAVE_PRINTF_H accordingly. * Added src/shared/parse-printf-format.[hc] by Emil Renner Berthing <systemd@esmil.dk> that provides parse_printf_format() if printf.h is unavailable * Added src/basic/musl_missing.h by Juergen Buchmueller <pullmoll@t-online.de> that implements glibc functions missing in musl libc as macros. * Extended src/basic/musl_missing.h and added src/basic/musl_missing.c providing - program_invocation_name - program_invocation_short_name and - elogind_set_program_name() to set the two where appropriate. * Added calls to elogind_set_program_name() to all main() functions where needed. * A few other fixes to work nicely with musl libc.
* Fixed gawk script for git-tar target.Sven Eden2017-03-14
| | | | | | | | | | | | | | | | | | | | | | | The previous variant was nice and sleek. But unfortunately, there are constructs like: #if 0 (... old code ...) #else (... alternative code for elogind ...) #endif // 0 These fragments couldn't be handled by the old code, but can by the new one. To make this work, the precompiler macros must be set like shown above. Apart from that, all lines like: /// Any doxygen one-line-comments with elogind in it are removed are removed, too. Please note the three slashes. And finally, all commented out #include directives are removed as well.
* Cleaned up more unneeded functions and types in:Sven Eden2017-03-14
| | | | | | | | | | | | | | | | | | | | - src/basic/ioprio.h - removed - src/basic/ring.h - removed - src/basic/capability.[hc] - cleaned - src/basic/cgroup-util.[hc] - cleaned - src/basic/hostname-util.[hc] - cleaned - src/basic/path-util.[hc] - cleaned - src/basic/socket-util.h - cleaned - src/basic/strv.[hc] - cleaned - src/basic/time-util.[hc] - cleaned - src/basic/unit-name.[hc] - cleaned - src/basic/util.[hc] - cleaned - src/libelogind/sd-bus/bus-introspect.c - cleaned - src/login/loginctl.c - cleaned - src/login/logind-dbus.c - cleaned - src/login/logind.h - cleaned - src/shared/conf-parser.[hc] - cleaned
* Add poweroff, suspend etc. loginctl commandsSven Eden2017-03-14
| | | | | | | * src/login/loginctl.c: Add poweroff, reboot, suspend, hibernate, and hybrid-sleep commands. Normally these are handled by systemctl but since elogind is targeted at the no-systemd use case, we incorporate them here.
* Prep v226: loginctl.c: Fix call to (changed) cg_is_empty_recursive().Sven Eden2017-03-14
|
* Prep v225: Applying various fixes and changes to src/login that got lost ↵Sven Eden2017-03-14
| | | | during git am transfer.
* Prep v222: Update build system:Sven Eden2017-03-14
| | | | | | | | - The content of the man pages directory has been overhauled - Makefile-man.am was regenerated - Makefile.am and configure.ac needed a few addtitions and fixes - Some masked functions had to be unmasked - Now superfluous files have been removed
* Prep v221: Some more cleanup and a few fixesSven Eden2017-03-14
| | | | | | | | | The files - src/core/org.freedesktop.systemd.policy.in.in and - src/core/systemd.pc.in have been deleted as they are not needed. The other changes are some minor fixes.
* Prep v220: Use new cgroups functionsSven Eden2017-03-14
| | | | | Prep v220: Update logind and loginctl to upstream version. Prep v220: src/shared/rm-rf.c does not need to be able to handle btrfs subvolumes for elogind.
* sd-bus: introduce new sd_bus_flush_close_unref() callLennart Poettering2017-03-14
| | | | | | | | | | | | | | | | sd_bus_flush_close_unref() is a call that simply combines sd_bus_flush() (which writes all unwritten messages out) + sd_bus_close() (which terminates the connection, releasing all unread messages) + sd_bus_unref() (which frees the connection). The combination of this call is used pretty frequently in systemd tools right before exiting, and should also be relevant for most external clients, and is hence useful to cover in a call of its own. Previously the combination of the three calls was already done in the _cleanup_bus_close_unref_ macro, but this was only available internally. Also see #327
* tree-wide: fix memory leaks in users of bus_map_all_properties()David Herrmann2017-03-14
| | | | | | | | | | If you use bus_map_all_properties(), you must be aware that it might touch output variables even though it may fail. This is, because we parse many different bus-properties and cannot tell how to clean them up, in case we fail deep down in the parser. Fix all callers of bus_map_all_properties() to correctly cleanup any context structures at all times.
* util: split out signal-util.[ch] from util.[ch]Lennart Poettering2017-03-14
| | | | No functional changes.
* shared: add terminal-util.[ch]Ronny Chevalier2017-03-14
|
* shared: add process-util.[ch]Ronny Chevalier2017-03-14
|
* Fix argument order when checking inhibitorsAndy Wingo2015-09-01
|
* Add poweroff, suspend etc. loginctl commandsAndy Wingo2015-08-29
| | | | | | | * src/login/loginctl.c: Add poweroff, reboot, suspend, hibernate, and hybrid-sleep commands. Normally these are handled by systemctl but since elogind is targeted at the no-systemd use case, we incorporate them here.
* Compiling.Andy Wingo2015-04-08
|
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-23
| | | | | | 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.
* logind: open up most bus calls for unpriviliged processes, using PolicyKitLennart Poettering2015-02-18
| | | | | | Also, allow clients to alter their own objects without any further priviliges. i.e. this allows clients to kill and lock their own sessions without involving PK.
* loginctl: fix misuse compound literalsLennart Poettering2015-01-14
| | | | | The lifetime of compound literals is bound to the local scope, we hence cannot refernce them outside of it.
* loginctl: make session/user arguments optional for a number commands, and ↵Lennart Poettering2015-01-09
| | | | | | | | imply calling session/user instead This turns "lock-session", "activate", "unlock-session", "enable-linger", "disable-linger" into commands that take no argument, optionally in which case the callers session/user is implied.
* loginctl: make "loginctl session-status" without session ID show the ↵Lennart Poettering2015-01-09
| | | | | | caller's session status Similar for user-status and seat-status.
* loginctl: port to generic verbs.h APILennart Poettering2015-01-08
|