LinuxCommandLibrary

cinnamon-session-quit

Log out, shutdown, or restart Cinnamon session

SYNOPSIS

cinnamon-session-quit [--logout] [--power-off] [--reboot] [--halt] [--suspend] [--hibernate] [--hybrid-sleep] [--cancel] [--force]

PARAMETERS

--logout
    Logs out the current user session, returning to the display manager's login screen.

--power-off
    Shuts down the system completely and powers off the hardware.

--reboot
    Restarts the system.

--halt
    Halts the system. On modern systems, this often has the same effect as --power-off.

--suspend
    Suspends the system to RAM (sleep mode), preserving the session state while consuming minimal power.

--hibernate
    Hibernates the system to disk, saving the session state and allowing the system to power off completely. Requires sufficient swap space.

--hybrid-sleep
    A combination of suspend and hibernate; the session state is saved to both RAM and disk for resilience.

--cancel
    Cancels a pending session termination action that was initiated with a timeout (e.g., from a shutdown dialog).

--force
    Forces the requested action immediately, without waiting for applications to save or respond. Use with caution as unsaved data may be lost.

DESCRIPTION

cinnamon-session-quit is a command-line utility for the Cinnamon desktop environment, serving as the primary interface for managing a user's graphical session and initiating system power state changes. Its core function is to enable users to programmatically trigger a logout from their current desktop session, execute a full system shutdown, or perform a system reboot.

The command operates by communicating with the cinnamon-session daemon, which is the central process managing the Cinnamon desktop environment. This daemon, in turn, interacts with lower-level system services, notably logind (a component of systemd) or other power management mechanisms, to carry out the requested action. A key feature of cinnamon-session-quit is its attempt to gracefully terminate running applications, giving them a chance to save unsaved data and exit cleanly before the session or system is closed.

CAVEATS

This command primarily operates within the context of a running Cinnamon user session. Power management actions (like suspend or hibernate) require underlying kernel support and proper system configuration (e.g., adequate swap space for hibernation). While cinnamon-session-quit initiates these actions, it delegates the actual system-level execution to services like logind, which may have specific user permission requirements or group memberships for full functionality.

GRACEFUL SESSION TERMINATION

When invoked without the --force option, cinnamon-session-quit attempts to gracefully terminate running applications. It sends signals (e.g., SIGTERM) to applications, allowing them to perform cleanup operations, save data, and exit cleanly. If applications do not respond or take too long, the user might be prompted for a decision, or the action might be delayed until an explicit override is provided or a timeout occurs.

INTEGRATION WITH SYSTEMD/LOGIND

On modern Linux distributions that utilize systemd, cinnamon-session-quit integrates seamlessly with the systemd-logind service via D-Bus. This integration is crucial for ensuring that system-wide power management actions (such as shutdown, reboot, suspend, and hibernate) are handled consistently and correctly by the operating system, rather than being confined solely to the desktop environment's scope. It allows for proper management of user sessions and secure system state transitions.

HISTORY

The Cinnamon desktop environment was developed by Linux Mint as a fork of GNOME Shell, aiming to provide a more traditional and familiar desktop experience. Consequently, cinnamon-session-quit emerged from the design principles and core functionality established by gnome-session-quit, its counterpart in the GNOME environment. It serves the same purpose of session management, adapted to interact with the Cinnamon-specific session daemon (cinnamon-session), ensuring consistent and reliable session control within the Cinnamon ecosystem.

SEE ALSO

Copied to clipboard