Xfce Forum

Sub domains
 

You are not logged in.

#1 2018-11-20 23:29:41

Vincent17
Member
Registered: 2018-03-15
Posts: 7

xfce4-session-logout to power off computer

Hello
I have been using

xfce4-session-logout --halt

in a script in MXLinux to power off the computer.  After reading about halt in other contexts, I wonder why this works!  For example,
https://unix.stackexchange.com/question … f-and-halt

halt terminates all processes and shuts down the cpu.  poweroff is exactly like halt, but it also turns off the unit itself (lights and everything on a PC).

Could someone explain exactly what the --halt switch means in xfce4-session-logout?
Thanks.

Last edited by Vincent17 (2018-11-21 02:08:17)

Offline

#2 2019-01-15 00:17:54

alcornoqui
Member
Registered: 2014-07-28
Posts: 831

Re: xfce4-session-logout to power off computer

The second answer in your link gives a reference that puts it all in perspective, selected quote:

In the systemd toolset halt, poweroff, reboot, telinit, and shutdown are all symbolic links to /bin/systemctl. They are all backwards compatibility shims, that are simply shorthands for invoking systemd's primary command-line interface: systemctl. They all map to (and in fact are) that same single program. (By convention, the shell tells it which name it has been invoked by.)

It's all systemd now.

Offline

#3 2019-01-19 03:01:52

Vincent17
Member
Registered: 2018-03-15
Posts: 7

Re: xfce4-session-logout to power off computer

alcornoqui, thanks for your answer.

The reason for my original question was that the command, which powers off one computer, only halts another laptop, leaving power on. So I was curious how exactly xfce4-session-logout --halt works, and why there isn't a --poweroff option. I infer from your answer that it calls systemctl halt.

This computer runs MX Linux-i386, where

Systemd is included by default but not enabled. ... MX Linux uses systemd-shim, which emulates the systemd functions that are required to run the helpers without actually using the init service.   (from MX users manual)

To achieve poweroff, I tried systemctl poweroff among many commands, but halt with power still on was nearly always the result.   /sbin/poweroff -fih works most of the time hmm  In MX Linux, this command links to /sbin/halt -p, not to systemctl.

Last edited by Vincent17 (2019-01-30 01:03:08)

Offline

Board footer

Powered by FluxBB