Skip to main content
Add missing words, fix markup
Source Link
Kusalananda
  • 356.1k
  • 42
  • 737
  • 1.1k

Create a systemd service and add this to the [Service] section:

[Service]

Exec=gnome-session-quit --logout --no-prompt

How to start a systemd service after user login and stop it before user logout

How create a service in linux that can handle queries?

gnome-session-quit

Or you can also try the following, which probably won't work:.

@reboot sleep 60 && gnome-session-quit --logout --no-prompt 

@reboot sleep 60 && gnome-session-quit --logout --no-prompt ThisThis might help to wait 60 sec, if the session isn't fully loaded when the system starts, and the logout command might not work immediately for that reason.

Create a systemd service and add this to the [Service] section:

[Service]

Exec=gnome-session-quit --logout --no-prompt

How to start a systemd service after user login and stop it before user logout

How create a service in linux that can handle queries?

gnome-session-quit

Or you can also try which probably won't work.

@reboot sleep 60 && gnome-session-quit --logout --no-prompt This might help to wait 60 sec, if the session isn't fully loaded when the system starts, and the logout command might not work immediately for that reason.

Create a systemd service and add this to the [Service] section:

[Service]

Exec=gnome-session-quit --logout --no-prompt

How to start a systemd service after user login and stop it before user logout

How create a service in linux that can handle queries?

gnome-session-quit

Or you can also try the following, which probably won't work:.

@reboot sleep 60 && gnome-session-quit --logout --no-prompt 

This might help to wait 60 sec, if the session isn't fully loaded when the system starts, and the logout command might not work immediately for that reason.

Source Link

Create a systemd service and add this to the [Service] section:

[Service]

Exec=gnome-session-quit --logout --no-prompt

How to start a systemd service after user login and stop it before user logout

How create a service in linux that can handle queries?

gnome-session-quit

Or you can also try which probably won't work.

@reboot sleep 60 && gnome-session-quit --logout --no-prompt This might help to wait 60 sec, if the session isn't fully loaded when the system starts, and the logout command might not work immediately for that reason.