Commit graph

7 commits

Author SHA1 Message Date
Victor Lyuboslavsky
6d73c6cccc
Delaying reboot so that script can report status. (#33386)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #33381 unreleased Linux unlock bug.

# Checklist for submitter
## Testing
- [x] QA'd all new/changed functionality manually
2025-09-24 14:25:52 -05:00
Victor Lyuboslavsky
6f986e5574
On lock, drop GDM Ubuntu into text mode to work around blank/unresponsive screen. (#32100)
Fixes #31291 

# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing
- [x] QA'd all new/changed functionality manually


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- New Features
- Linux lock now switches Ubuntu + GDM systems to text mode to avoid GUI
issues.
  - Persistent lock message is shown and survives reboots.
  - Unlock restores the original GUI mode automatically when applicable.

- Bug Fixes
- Prevents black-screen behavior on Ubuntu + GDM after locking by
rebooting to text mode.
  - Ensures lock message consistently appears across sessions.
  - Improves reliability of session handling during lock/unlock.

- Chores
  - Added change note describing the updated Linux lock behavior.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-08-21 13:55:00 -05:00
Dante Catalfamo
3604a9abf8
Add reboot to linux unlock script (#23382)
#22437

There is a bug in Ubuntu 24.04's distribution of GDM that prevents it
from starting correctly and displaying a prompt to the user if
`/etc/nologin` is present. This issue is not present on the current
release of Fedora, meaning it is Ubuntu specific.

The way we lock users out is by manually creating the `nologin` file and
then masking the `systemd-user-sessions` systemd unit, which creates the
file on shutdown and deletes it on startup. This will cause a PAM policy
to fail and prevents anyone from logging in. When we unlock the system
we delete the `nologin` file, unmask the `systemd-user-sessions` unit,
and manually run the binary that it should start.

This process removes the cause of the GDM bug, but we need to reboot the
machine to get GDM working again.

While I have not yet been able to determine the exact cause of the bug,
this fix will prevent the user from being stuck with a black screen once
the machine is unlocked.

This fix will not remedy GDM showing a black screen upon being locked,
it only ensures that the user isn't stuck having to manually reboot the
machine once it's unlocked.

We should check back on this soon to see if the bug gets been fixed
upstream.
2024-11-11 14:22:22 -05:00
Dante Catalfamo
feb32a274a
Linux Mask systemd-user-sessions (#20877)
#20370

Part 2 to #20699. Apparently `systemd` now automatically deletes
`/etc/nologin` on startup. In the previous PR, rebooting the machine
would remove the nologin file and allow users to login. This PR masks
the service that performs the deletion, preventing it from running.

The message displayed to the user will be what is specified in [this
file](7767896d12/tmpfiles.d/systemd-nologin.conf (L10)).
It's not the best, but I suspect messing with too many systemd files
could come back to bite us in the future if things change, so I'll leave
it as-is.
2024-08-01 10:27:17 -04:00
Dante Catalfamo
6094bb2c53
Use PAM nologin to disable Linux Logins (#20699)
#20370
2024-07-29 10:00:48 -04:00
Martin Angers
ff1e17680b
Fix the unlock linux host script to support users without password (#19665) 2024-06-12 09:49:37 -04:00
Martin Angers
9082438580
Feature: Remote Lock for macOS, Windows and Linux (#16783)
Feature branch for the #9949  story.

---------

Co-authored-by: Jahziel Villasana-Espinoza <jahziel@fleetdm.com>
Co-authored-by: Roberto Dip <me@roperzh.com>
Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com>
Co-authored-by: Sarah Gillespie <sarah@fleetdm.com>
2024-02-13 13:03:53 -05:00