| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
| |
Create a private cgroup tree associated with no controllers, and use it
to map PIDs to sessions. Since we use our own path structure, remove
internal cgroup-related helpers that interpret the cgroup path structure
to pull out users, slices, and scopes.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/login/logind-action.c (shutdown_or_sleep, do_sleep): Take modes
from the manager instead of parsing them ourselves.
* src/login/logind-dbus.c (execute_shutdown_or_sleep): Adapt to
shutdown_or_sleep prototype change.
* src/login/logind-gperf.gperf: Add config items from sleep.conf.
* src/login/logind.c (manager_new): Wire up defaults for new config
items.
(manager_free): Free new config items.
(manager_parse_config_file): Arrange to parse a single
elogind/logind.conf file, not grovelling all over the filesystem.
Take the file from the ELOGIND_CONF_FILE environment variable if
present.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since we are catching the keys, we might as well just do
suspend/reboot/etc handling here.
* configure.ac: Get paths of halt and reboot.
* Makefile.am (systemsleepdir, systemshutdowndir): New variables. Look
in them for hooks to run.
* src/login/logind-action.c: Inline the salient bits from systemd's
sleep/sleep.c here.
* src/login/logind-dbus.c (execute_shutdown_or_sleep): Call our own
shutdown_or_sleep helper instead of invoking a systemd method.
* src/login/logind-action.h: Declare shutdown_or_sleep.
|
|
|
|
|
| |
Auto-spawning VTs requires systemd in practice. If you're using systemd
you can just use its logind :)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* elogind does not support systemd services and units. But at least
the units are needed to support the systemd cgroup slice/scope
system.
* Remove systemd subscription to scope, service and slice jobs.
These can not be supported in any way, as they depend on systemd
running the machine.
* The functions session_start_scope(), user_start_service() and
user_start_slice() no longer try to call systemd via dbus for
assistance.
This way they generate their proper scope, service and slice names,
and store them in the Managers HashMaps for session and user units.
This should enable us to reverse track pids to users and such
stuff, as that is what systemd-logind does, not knowing whether any
unit *really* has been started or not.
However, this will not work out of the box until we find a way to
integrate cg_create_everywhere() into elogind without becoming
dependent of systemd unit, service and job knowledge again.
|
|
|
|
|
| |
Let elogind setup cgroups support on its manager initialization and
free the cgroups subsystem when the manager is destroyed.
|
|
|
|
|
|
|
| |
* src/login/logind.c (main): Also create /run/systemd at startup.
* Create /run/systemd/machines, so that the login monitor works.
* Fail if any of the needed directories could not be created.
* But do not fail if any of the needed directories exist.
|
|
|
|
|
|
|
|
|
|
|
| |
* src/login/logind.c (manager_connect_bus):
- Notice instead of error if we can't subscribe to updates from
systemd. Perhaps we should remove this entirely. But leaving
it optional means, that a system managed by systemd can use
elogind substituting systemd-login.
- Warn instead of error if we can't add receiver matches from
systemd events. On a system not run by systemd, such events
wouldn't occur anyway.
|
| |
|
|
|
|
|
|
|
|
|
| |
These definitions were not valid when compiling against eudev.
As a nice consequence, our own copies of any udev includes are no
longer needed and could be removed for good.
Add label.h include to logind.c, as "udev.h" is no longer available which would have done so otherwise.
|
|
|
|
|
|
|
|
|
| |
build-sys: add check for gperf lookup function signature (#5055)
gperf-3.1 generates lookup functions that take a size_t length
parameter instead of unsigned int. Test for this at configure time.
Fixes: https://github.com/systemd/systemd/issues/5039
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We treat an empty wall-message equal to a NULL wall-message since:
commit 5744f59a3ee883ef3a78214bd5236157acdc35ba
Author: Lennart Poettering <lennart@poettering.net>
Date: Fri Sep 4 10:34:47 2015 +0200
logind: treat an empty wall message like a NULL one
Fix the shutdown scheduler to not deref a NULL pointer, but properly
check for an empty wall-message.
Fixes: #1120
|
|
|
|
| |
And not bool.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
On Dell and HP laptops the dock state/events (SW_DOCK) come from the "{Dell,HP}
WMI hotkeys" input devices. Tag them as power-switch so that login actually
considers them. Use a general match in case this affects other vendors, too.
Thanks to Andreas Schultz for debugging this!
https://launchpad.net/bugs/1450009
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
dbus-1.10 was just released, including systemd units to run
`dbus-daemon --session` as systemd user unit. This allows using a
user-bus with dbus1, just like we do per default with kdbus.
All the dbus libraries have already been fixed long ago to use the
user-bus as default. Hence, there's no need to set
DBUS_SESSION_BUS_ADDRESS= if we use the user-bus. However, gdm and
friends continue to spawn a session bus if this variable is not set
(instead of checking for the existence of the user-bus). Hence, we force
the user-bus, if it is available, in pam_elogind. Once gdm and friends
are fixed, we can continue to drop this again. However, that might take
a while.
With this in place, all that is needed to make the user-bus work is:
`systemctl --global enable dbus.socket`
If dbus.socket is not enabled, the legacy session-bus is still used.
Based on a patch by: Jan Alexander Steffens <jan.steffens@gmail.com>
|
|
|
|
| |
during git am transfer.
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the controlling process exits, any existing file descriptors
for that FD will be marked as hung-up and ioctls on them will
file with EIO. To work around this, open a new file descriptor
for the VT we want to clean up.
Thanks to Ray Strode for help in sorting out the problem and
coming up with a fix!
https://github.com/systemd/systemd/issues/989
|
|
|
|
|
|
|
|
|
|
|
| |
The open_terminal() function adds retries in case a terminal
is in the process of being closed when we open it, and should
generally be used to open a terminal. We especially need it
for code that a subsequent commit adds that reopens the terminal
at session shut-down time; such races would be more likely in
that case.
Found by Ray Strode.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since dacd6cee76a08331b8c8616c5f30f70ee49aa2f9 the two OOM's are
ignored as the value of r will be overwritten and we only log in
the fail section anyway.
This patch jumps to fail on OOM.
Note that this is different behavior compared to both the current
code and previous to dacd6cee76a08331b8c8616c5f30f70ee49aa2f9. Before
that commit we would log that saving the inhibit data failed, but
still write the file, though without the WHO/WHY section.
CID# 1313545
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Many boards like hisilicon D02 board use standard gpio key to power down system.
A description of gpio-key in dts shown below,
gpio_keys {
compatible = "gpio-keys";
#address-cells = <1>;
#size-cells = <0>;
pwrbutton {
label = "Power Button";
gpios = <&porta 8 1>;
linux,code = <116>; // KEY_POWER, used by SC System Power Down
};
};
-bash-4.3# udevadm info -a /dev/input/event3
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/platform/gpio_keys/input/input3/event3':
KERNEL=="event3"
SUBSYSTEM=="input"
DRIVER==""
looking at parent device '/devices/platform/gpio_keys/input/input3':
KERNELS=="input3"
SUBSYSTEMS=="input"
DRIVERS==""
ATTRS{name}=="gpio_keys"
ATTRS{phys}=="gpio-keys/input0"
ATTRS{uniq}==""
ATTRS{properties}=="0"
looking at parent device '/devices/platform/gpio_keys':
KERNELS=="gpio_keys"
SUBSYSTEMS=="platform"
DRIVERS=="gpio-keys"
ATTRS{keys}=="116"
ATTRS{switches}==""
ATTRS{driver_override}=="(null)"
ATTRS{disabled_keys}==""
ATTRS{disabled_switches}==""
looking at parent device '/devices/platform':
KERNELS=="platform"
SUBSYSTEMS==""
DRIVERS==""
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit replays the moving around of source files that have been
done between systemd-219 and systemd-221.
Further the Makefile.am is synchronized with the upstream version and
then "re-cleaned".
A lot of functions, that are not used anywhere in elogind have been
coated into #if 0/#endif directives to further shorten the list of
dependencies.
All unneeded files have been removed.
|
| |
|
| |
|
|
|
|
| |
version.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
Create a private cgroup tree associated with no controllers, and use it
to map PIDs to sessions. Since we use our own path structure, remove
internal cgroup-related helpers that interpret the cgroup path structure
to pull out users, slices, and scopes.
|
| |
|
|
|
|
|
|
| |
* src/login/logind.c (main): Create /run/systemd/machines, so that the
login monitor works.
* configure.ac: v219.10.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac: Get paths of halt and reboot.
* Makefile.am (systemsleepdir, systemshutdowndir): New variables. Look
in them for hooks to run.
* src/login/logind-action.c: Inline the salient bits from systemd's
system-sleep.c here.
* src/login/logind-dbus.c (execute_shutdown_or_sleep): Call our own
shutdown_or_sleep helper instead of invoking a systemd method.
* src/login/logind.h: Declare shutdown_or_sleep.
|
|
|
|
|
| |
Since we are catching the keys, we might as well just do
suspend/reboot/etc handling here.
|
|
|
|
|
|
| |
This removes attempts by logind to listen to systemd messages over the
bus, and to start and/or manage units associated with sessions and
users.
|
|
|
|
|
| |
Auto-spawning VTs requires systemd in practice. If you're using systemd
you can just use its logind :)
|
|
|
|
|
|
|
|
|
|
| |
* src/login/logind-user.c (user_start): Don't start slices and
systemd-user services.
* src/login/logind-dbus.c (method_create_session): Send a reply directly
instead of waiting on systemd that isn't there.
* configure.ac: Bump version.
|
|
|
|
|
| |
* src/login/logind.c (main): Also create /run/systemd at startup.
* configure.ac: Bump to 219.3.
|
|
|
|
|
|
|
|
|
| |
Make sure we release VT-positions when a session is closed. Otherwise,
lingering sessions will occupy VTs and prevent next logins from
succeeding.
Note that we already release session-devices when closing a session, so
there cannot be anyone using the VT anymore.
|
|
|
|
|
|
|
|
| |
WRITE_STRING_FILE_ATOMIC is only valid if WRITE_STRING_FILE_CREATE is also
given. IOW, an atomic file write operation is only possible when creating a
file is also being asked for.
This is a regression from the recent write_string_file() rework.
|
|
|
|
|
|
|
| |
If a session is in closing state (and already got rid of its VT), then
never re-select it for that VT. There is no reason why we should grant
something to a session that is already going away *AND* already got rid
of exactly that.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Our seat->positions[] array keeps track of the 'preferred' session on a
VT. The only situation this is used, is to select the session to activate
when a VT is activated. In the normal case, there's only one session per
VT so the selection is trivial.
Older greeters, however, implement take-overs when they start sessions on
the same VT that the greeter ran on. We recently limited such take-overs
to VTs where a greeter is running on, to force people to never share VTs
in new code that is written.
For legacy reasons, we need to be compatible to old greeters, though.
Hence, we allow those greeters to implement take-over. In such take-overs,
however, we should really make sure that the new sessions gets preferred
over the old one under all circumstances. Hence, make sure we override
the previous preferred session with a new session.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A while back we opened up all of logind's bus calls to unprivileged
users, via PK. However, the dbus1 policy wasn't updated accordingly.
With this change, the dbus1 policy is opened up for all bus calls that
should be available to unprivileged clients.
(also rearranges some calls in the vtable, to make more sense, and be in
line with the order in the bus policy file)
Fixes #471.
|