The officially official Devuan Forum!

You are not logged in.

#1 Re: Installation » SOLVED: Issues using "live" install on Thinkpad T410 » 2021-02-04 14:57:40

Seriously though

The issue appears to relate to a hand-off from xfce4-power-manager to systemd/logind, which is controlled by a hidden xfconf property that didn't exist on this machine (possibly because it does not have systemd installed). Adding that property and setting it to "false" hands back control to xfce4-power-manager and everything works as it should. Perhaps something for the devs to look into; maybe Devuan should set this property by default?

Would be interesting to hear what the Devuan gods say about this?

#5 Re: Installation » SOLVED: Issues using "live" install on Thinkpad T410 » 2021-02-03 10:04:29

Ha! I think I found the problem - and by the smell only. Something smelled wrong with the xfpm_manager_inhibit_sleep_systemd(): Inhibiting systemd sleep: handle-lid-switch messages in the xfce-power-manager --debug output, so I started digging in that spot. I soon found some interesting bug reports on the Xfce bug tracker, including this one:

Laptop lid action not respected
Xfce4-power-manager not respecting laptop lid setting.  Regardless of power manager setting (Switch off display or Lock screen), closing the lid always results in suspend on ac or battery.

Not quite the same issue I was experiencing, but close enough to be potentially relevant. At first I was disappointed that the proposed solution didn't seem to have any effect (xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/logind-handle-lid-switch -s false), but in comment #10 on that bug report someone says

Just in addition to the answers above, the setting didn't exist for me yet. I needed to create it.

He suggests

sudo xfconf-query -c xfce4-power-manager -n -t 'bool' -p /xfce4-power-manager/logind-handle-lid-switch -s false

but since xfce4-power-manager runs in the user context (started from Sessions and Start Up > Application Autostart) I ran the command without sudo - expecting to see a warning that the key already existed. But I got no such warning - and when I closed the lid afterwards the laptop suspended and locked. Multiple tests on battery & on AC, with multiple reboots, confirms that this indeed fixed the problem.

So the lessons learned are 1) xfce4-power-manager handles suspend and locking without involving any scripts in /etc/acpi - as indicated by the CheckPolicy condition in lid.sh 2) the acpi-support package is not needed (for this functionality anyway). 3) the issue appears to relate to a hand-off from xfce4-power-manager to systemd/logind, which is controlled by a hidden xfconf property that didn't exist on this machine (possibly because it does not have systemd installed). Adding that property and setting it to "false" hands back control to xfce4-power-manager and everything works as it should. Perhaps something for the devs to look into; maybe Devuan should set this property by default?

Edit: Just to be clear, I now only have two acpi events/scripts defined, one of which is my home made mic-mute function:

$ ls /etc/acpi
events  powerbtn-acpi-support.sh  thinkpad_micmute.sh

$ ls /etc/acpi/events
powerbtn-acpi-support  thinkpad_micmute

So the whole suspend & lock on lid close process takes place elsewhere (i.e. xfce4-power-manager), and all that digging in /etc/acpi only turned up a red herring. Smelly, but red.

#6 Re: Installation » SOLVED: Issues using "live" install on Thinkpad T410 » 2021-02-03 01:45:23

When I check the box in the power management applet that says "Lock screen when system is going for sleep", xfce4-power-manager --debug outputs this:

TRACE[xfpm-xfconf.c:216] xfpm_xfsession_property_changed_cb(): property /shutdown/LockScreen

TRACE[xfpm-xfconf.c:225] xfpm_xfsession_property_changed_cb(): Property modified: /shutdown/LockScreen

TRACE[xfpm-xfconf.c:203] xfpm_xfconf_property_changed_cb(): Property modified: /xfce4-power-manager/lock-screen-suspend-hibernate

TRACE[xfpm-xfconf.c:203] xfpm_xfconf_property_changed_cb(): Property modified: /xfce4-power-manager/logind-handle-lid-switch

TRACE[xfpm-manager.c:645] xfpm_manager_inhibit_sleep_systemd(): Inhibiting systemd sleep: handle-power-key:handle-suspend-key:handle-hibernate-key

(xfce4-power-manager:7608): GLib-CRITICAL **: 00:53:09.746: g_error_free: assertion 'error != NULL' failed

And when I uncheck the checkbox I get:

TRACE[xfpm-xfconf.c:216] xfpm_xfsession_property_changed_cb(): property /shutdown/LockScreen

TRACE[xfpm-xfconf.c:225] xfpm_xfsession_property_changed_cb(): Property modified: /shutdown/LockScreen

TRACE[xfpm-xfconf.c:203] xfpm_xfconf_property_changed_cb(): Property modified: /xfce4-power-manager/lock-screen-suspend-hibernate

TRACE[xfpm-xfconf.c:203] xfpm_xfconf_property_changed_cb(): Property modified: /xfce4-power-manager/logind-handle-lid-switch

TRACE[xfpm-manager.c:645] xfpm_manager_inhibit_sleep_systemd(): Inhibiting systemd sleep: handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch

(xfce4-power-manager:7608): GLib-CRITICAL **: 00:54:21.371: g_error_free: assertion 'error != NULL' failed

What's going on with handle-lid-switch in the output above?

I removed the acpi-support package (and rebooted) to reduce the number of moving parts, and had another look at the behaviour. If I close the lid with the box unchecked, the laptop suspends. If I close the lid with the box checked, nothing happens. If I press the suspend hotkey (Fn+F4) with the box checked, the laptop suspends and locks. If I press the suspend hotkey with the box unchecked, the laptop suspends. So the hotkey works exactly as it should, but the lidswitch doesn't. This is where I am after another long session - the battle continues tomorrow, and I will get this to work.

#7 Re: Installation » SOLVED: Issues using "live" install on Thinkpad T410 » 2021-02-02 23:40:50

No that didn't work - or at least not while xfce4-power-manager is running. I noticed that if I kill it then light-locker will lock the screen when I close the lid (because CheckPolicy now returns false in the acpi lid script). If xfce4-power-manager is running nothing at all happens when I close the screen. xfce4-power-manager --debug shows nothing when the lid is closed and opened.

Oh and I realised I made a mistake earlier; I shouldn't have run xfce4-power-manager --dump as root, this will give misleading results since it normally runs as the user.

#8 Re: Installation » SOLVED: Issues using "live" install on Thinkpad T410 » 2021-02-02 22:44:19

The plot thickens. If I leave sudo xfce4-power-manager --dump running while I close/open the lid I get messages like this:

(xfce4-power-manager:7459): xfce4-power-manager-WARNING **: 22:25:05.954: Screensaver lock command not set when attempting to lock the screen.
Please set the xfconf property /general/LockCommand in xfce4-session to the desired lock command

Which strengthens my suspicion that xfce4-power-manager is indeed where the problem lies. But:

$ xfconf-query -lc xfce4-session
/general/FailsafeSessionName
/general/SaveOnExit
/general/SessionName
/sessions/Failsafe/Client0_Command
/sessions/Failsafe/Client0_PerScreen
/sessions/Failsafe/Client1_Command
/sessions/Failsafe/Client1_PerScreen
/sessions/Failsafe/Client2_Command
/sessions/Failsafe/Client2_PerScreen
/sessions/Failsafe/Client3_Command
/sessions/Failsafe/Client3_PerScreen
/sessions/Failsafe/Client4_Command
/sessions/Failsafe/Client4_PerScreen
/sessions/Failsafe/Count
/sessions/Failsafe/IsFailsafe
/shutdown/LockScreen
/splash/Engine

There is no such xfconf property for xfce4-session, and not for root either:

$ sudo xfconf-query -lc xfce4-session
/general/FailsafeSessionName
/sessions/Failsafe/Client0_Command
/sessions/Failsafe/Client0_PerScreen
/sessions/Failsafe/Client1_Command
/sessions/Failsafe/Client1_PerScreen
/sessions/Failsafe/Client2_Command
/sessions/Failsafe/Client2_PerScreen
/sessions/Failsafe/Client3_Command
/sessions/Failsafe/Client3_PerScreen
/sessions/Failsafe/Client4_Command
/sessions/Failsafe/Client4_PerScreen
/sessions/Failsafe/Count
/sessions/Failsafe/IsFailsafe
/splash/Engine

Should I try to add it? And set it to, I dunno, light-locker-command -l?

#9 Re: Installation » SOLVED: Issues using "live" install on Thinkpad T410 » 2021-02-02 21:05:23

So I noticed something odd, on my X230 I have installed the acpi-support package (or something has pulled it in as a dependency), but this was not installed on the T410. It's really just a bunch of event definitions and handler scripts for /etc/acpi - including things like volume up/down, and lid close. So this is the mechanism my X230 uses to control the volume for example, which is why I don't need to add them as Application Shortcuts on that machine. BUT. Now that I have installed acpi-support on the T410, it still doesn't work without the Application Shortcuts, despite the event looking identical on the two systems (e.g. button/volumedown VOLDN 00000080 00000000 K). So something else is missing or getting in the way.

There's more. The acpi-support package also installs an event and support script for "lid" events - and this does get triggered when I open/close the lid (I moved my hommade acpi lid event handler out of the way first, of course), but it exits on the first condition:

/etc/acpi/lid.sh:

if { CheckPolicy || HasLogindAndSystemd1Manager; }; then
        exit
fi

Ok, so we don't have SystemD, it must be CheckPolicy which returns true then. Turns out CheckPolicy is just a list of power management utilities - including xfce4-power-manager - which, if present on the system, should handle the lid events.

/usr/share/acpi-support/policy-funcs:

...
CheckPolicy() {
        local PMS

        getXconsole
        PMS="/usr/bin/xfce4-power-manager /usr/bin/mate-power-manager /usr/lib/dalston/dalston-power-applet"
        pidof -x $PMS > /dev/null ||
        PowerDevilRunning ||
        GnomeSettingsDaemonPowerRunning
}
...

Or so the acpi script expects and happily exits. So I come back to xfce4-power-manager and not acpi as the likely culprit; hence the output of sudo xfce4-power-manager --dump above.

#10 Re: Installation » SOLVED: Issues using "live" install on Thinkpad T410 » 2021-02-02 20:48:19

sudo xfce4-power-manager --dump

** (xfce4-power-manager:7459): WARNING **: 20:37:14.848: Failed to get name owner: 
GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.xfce.PowerManager': no such name

** (xfce4-power-manager:7459): WARNING **: 20:37:14.849: Failed to get name owner: 
GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.freedesktop.PowerManagement': no such name

** (xfce4-power-manager:7459): WARNING **: 20:37:14.850: Failed to get name owner: 
GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.xfce.PowerManager': no such name

(xfce4-power-manager:7459): xfce4-power-manager-WARNING **: 20:37:14.850: Unable to connect to session manager : 
Failed to connect to the session manager: SESSION_MANAGER environment variable not defined

(xfce4-power-manager:7459): GLib-GObject-WARNING **: 20:37:14.981: ../../../gobject/gsignal.c:2523: 
signal 'Changed' is invalid for instance '0x55e8e96c81e0' of type 'GDBusProxy'

(xfce4-power-manager:7459): xfce4-power-manager-WARNING **: 20:37:15.026: could not map keysym 1008ffa8 to keycode

(xfce4-power-manager:7459): GLib-CRITICAL **: 20:37:15.047: g_error_free: assertion 'error != NULL' failed

** (xfce4-power-manager:7459): WARNING **: 20:37:15.048: No outputs have backlight property
xfce4-power-manager-Message: 20:37:15.089: Set kernel brightness switch to 0

(xfce4-power-manager:7459): xfce4-power-manager-WARNING **: 20:37:15.096: Failed to get keyboard max brightness level :
GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.UPower.KbdBacklight” on object at path 
/org/freedesktop/UPower/KbdBacklight
---------------------------------------------------
       Xfce power manager version 1.6.1
With policykit support
With network manager support
---------------------------------------------------
Can suspend: True
Can hibernate: True
Authorised to suspend: True
Authorised to hibernate: True
Authorised to shutdown: True
Has battery: True
Has brightness panel: True
Has power button: True
Has hibernate button: True
Has sleep button: True
Has LID: True

Does that look right to you?

Edit: A lot of the errors and warnings here come from the fact that, like an idiot, I ran the command with sudo. xfce4-power-manager should run in the user context and the root account (being disabled) likely misses many of the pieces which make it work.

#11 Re: Installation » SOLVED: Issues using "live" install on Thinkpad T410 » 2021-02-02 15:07:11

Seems I'm not alone experiencing a blank screen after resume: https://www.reddit.com/r/xfce/comments/ … umes_to_a/

The issue is that when "Lock screen when system is going to sleep" is selected, resuming from suspend takes me to a blank screen - essentially an active screensaver - on which I have to press a key again in order to wake up the computer to show the login screen.

#12 Re: Installation » SOLVED: Issues using "live" install on Thinkpad T410 » 2021-02-02 15:03:11

Hmm... Digging around in dconf-editor I found the light-locker settings. One of the options is "lock-on-suspend", and this was enabled. So why didn't it lock on suspend?

Edit: I have confirmed that this is the same option as the "Lock screen when the system goes to sleep" checkbox on the security tab of Xfce Power Manager. Toggling one toggles the other.

#13 Re: Installation » SOLVED: Issues using "live" install on Thinkpad T410 » 2021-02-02 14:49:37

Thanks, I'll try that, but I just had a minor break through: I found this old issue on Xfce's old bugtracker: https://bugzilla.xfce.org/show_bug.cgi?id=11488 Reading a bit further down, there are details of a patch that has been applied to xfce4-power-manager, the description of which is:

Integrate Light Locker configuration into Xfce Power Manager. This
allows proper settings synchronization between the two applications
and eliminates some of the hackiness used in Light Locker Settings
to accomplish the same effect, and streamlines similar tools into
a single location. This depends on light-locker 1.5.1 configured
with the GSettings backend.

"Aha" I thought, and tried setting lid close to "Lock Screen" in the power management applet, and hey presto, the computer now suspends and locks when I close the lid. If I remove the pm-suspend command from my acpi script it only locks, so this is still needed. And when it resumes the screen blinks multiple times before going to DPMS-off; I have to press a key on the keyboard to turn it back on. So it's not a perfect solution, but I'm definitely getting closer!

Edit: dconf-gsettings-backend is already installed.

#14 Re: Installation » SOLVED: Issues using "live" install on Thinkpad T410 » 2021-02-02 13:47:37

Update: I've got suspend/resume working on lid close by using a similar route to the mic mute solution above:

/etc/acpi/events/thinkpad_lidbutton:

event=button[ /]lid
action=/etc/acpi/thinkpad_lidbutton.sh %e

/etc/acpi/thinkpad_lidbutton.sh:

#!/bin/bash

if [  "$3" = "close" ] ; then
     /usr/sbin/pm-suspend
fi

And:

sudo chmod +x /etc/acpi/thinkpad_lidbutton.sh
sudo service acpid restart

But I cannot get it to lock the screen. I changed from Slim to to LightDM and installed light-locker; from a user prompt I can issue "light-locker-command -l" and the screen will lock, but when I do this from my acpi script I get GDBus.error ServiceUnknown org.freedesktop.screensaver. Any ideas?

#15 Re: Installation » SOLVED: Issues using "live" install on Thinkpad T410 » 2021-02-02 11:26:23

Yeah, but the power management applet also has suspend and screen blanking timeouts, so I just use those, which works fine. I managed to get the microphone mute button working, complete with LED, by adding an acpi event that listens to the button press:

/etc/acpi/events/thinkpad-micmute:

event=button/micmute MICMUTE 00000080 00000000 K
action=/etc/acpi/thinkpad-micmute.sh

/etc/acpi/thinkpad-micmute.sh:

amixer sset Capture toggle

then:

sudo chmod +x /etc/acpi/thinkpad-micmute.sh
sudo service acpid restart

I actually remember doing this on my X230 as well. Now only volume mute LED and lid suspend left on my list.

#16 Re: Installation » SOLVED: Issues using "live" install on Thinkpad T410 » 2021-02-02 10:54:48

Update: I found that the powerbtn ACPI event doesn't trigger unless you hold in the power button for a moment - and then it does "Ask" as requested, so that's actually working as it should. One issue off the list, now only lid suspend and mute buttons left.

#17 Re: Installation » SOLVED: Issues using "live" install on Thinkpad T410 » 2021-02-02 10:30:52

Thanks. laptop-mode-tools was not installed. Unfortunately the only obvious difference after installing it is that the machine now hangs for ~20s when a reboot is requested. I saw that there's a "Mic Mute LED-Mode" in alsamixer, which is set to "Follow Mute", but there is no equivalent for "Master" (and I did press F5 to see all devices). More frustratingly it turns out that for some reason I cannot add an Application Shortcut for the mic mute button like I could for the master mute button; the button press is not registered by the Application Shortcut applet, though it does show up as button/micmute with acpi_listen. I have removed my attempts at lid switch control from /etc/acpi , and I've uninstalled xscreensaver, rebooted a few times, all issues remain.

Oh and there's really nothing of note in .xsession-errors, I see volume change events there when I press the volume buttons, but there are no errors when I do this, or close the lid (which adds nothing to the log), or press the power button (also adds nothing to the log). Xsession/dbus init looks completely normal.

#18 Re: Installation » SOLVED: Issues using "live" install on Thinkpad T410 » 2021-02-02 01:47:49

The options are there (lid close set to "suspend" and "lock screen", power button set to "Ask"), but neither gets triggered.

#19 Re: Installation » SOLVED: Issues using "live" install on Thinkpad T410 » 2021-02-02 00:04:09

dice wrote:

so the mute button is working but not the led light?, that could be vendor specific for that laptop on how they control the feature i think. Maybe do a web search for "mute button led light not working lenovo T410"

Also what desktop environment is this?

Thanks. This is stock "Cinnabar" XFCE4 with the Slim DM. Beyond /home/user encryption (sshhh!) I haven't changed much. Had to mess around with the swap partition's UUID but that's now working (yes, encrypted - ssshhh!). Added xserver-xorg-input-synaptics to get clicks working on the touch pad (which enables an extra tab in the control panel app). Enabled unattended-upgrades and set up root emails to actually go somewhere. And yes, I got rid of pulseaudio, and got the volume control buttons (and mute) working as XF86 "Application Shortcuts", but yes, the mute LED does not come on. It does on my X230, and did on the X220 I had previously, and on neither did I have to add any "Application Shortcuts"; it just worked once I got all the desktop bits installed. And checking my X230 now I can see none have been created for me - it clearly uses some other mechanism (note: both systems run Devuan, ASCII on the X220 and ASCII upgraded to Beowulf on the X230 - neither has pulseaudio installed).

Edit: I am also still looking for a fix for the non-working power button, and a way to suspend and lock screen when the lid is closed.

Edit2: I should add, for the record, and in case anyone ends up here because they're searching for how to set up eCryptFS home directory encryption, that the required packages were pulled from the Buster release (and hence Beowulf) due to a critical bug which hadn't been fixed in time for the release. This has long since been fixed however, so I grabbed the latest debs from packages.debian.org and installed from there. The two packages you need are "ecryptfs-utils" and "libecryptfs1" ("libtspi1" and "cryptsetup" are also required but present in the Beowulf repos).

#20 Re: Installation » SOLVED: Issues using "live" install on Thinkpad T410 » 2021-02-01 22:55:07

Sorry about the rant. I'm afraid these have been more frequent of late. But really.

So, about that mute button...

#22 Re: Installation » SOLVED: Issues using "live" install on Thinkpad T410 » 2021-02-01 18:34:41

fsmithred wrote:

If you only encrypt your home and swap, there may be other things at risk. For example, wireless passwords may be stored in /var or /etc in plain text.

Not on my watch.

60632948-6d127880-9dd6-11e9-9821-2aa08a639740.png

#23 Re: Installation » SOLVED: Issues using "live" install on Thinkpad T410 » 2021-02-01 14:16:55

Ok, so I think we can move on from the encryption stuff - but what about the other issues I encountered? I have searched for info about the non-working power button, and I've had partial success getting the volume buttons to work - albeit in a way that doesn't seem quite right. No luck with the lid close suspend, despite messing around with scripts in /etc/acpi/. I have never needed to fiddle with any of this stuff previously; it's always just worked - what am I doing wrong here?

Edit: Oh and I must apologise; I was indeed thinking of the "Expert install" flow in the ncurses set-up - I don't think I've ever used the other option. It's not as "expert" as it sounds though, I find it really quite easy to use, with sensible defaults for most things.

#24 Re: Installation » SOLVED: Issues using "live" install on Thinkpad T410 » 2021-02-01 13:11:08

dice wrote:

ecryptfs looks user specific, not something i would want added to an installer. ecryptfs might work for ones home directory but cryptsetup is the gold standard imo. I believe there is a lot more configuration to be done for ecryptfs as you need to first create the encryption while logged in then log out and migrate the user from another account probably root and then unwrap the passphrase, that seems out of bounds for an installer imo.

I don't know enough about encryption to give any advice, I just want my laptop to not be wide open for any smack-head who finds it, and encrypting my home directory (and swap) takes care of that. This should be enough to prevent anyone stealing my laptop from also getting into my eBay account, or reading my personal data (identity theft). I don't store any state secrets so can't say how appropriate this method is if you do.

I don't think I suggested that this should be part of the installer - that's really not for me to say. But what I can say is that the /home encryption methods provided by the installer are unsuitable for my use case, since they require a separate partition and two passphrases at every boot. That's not how I want my laptop to work, but I'm not here to tell anyone how they should configure their system.

And no, there isn't any "more configuration to do"; ecyptfs hooks into PAM (I think) and decrypts and mounts my /home/user seamlessly, whether it's a console or desktop log-in. I've never had an issue, and I've used this method since before I moved to Devuan - in fact it used to be the default behaviour on Ubuntu if you selected to encrypt your home during installation.

#25 Re: Installation » SOLVED: Issues using "live" install on Thinkpad T410 » 2021-02-01 12:43:21

fsmithred wrote:

I'm not familiar with this method. What installer uses encryptfs?

No I did it after installing a minimal system, and it's eCryptFS - a stacked filesystem that can be mounted on any directory and on top of the main file system.

sudo apt-get install ecryptfs-utils cryptsetup

Then, while logged in as a different sudo user to the one you want to encrypt /home for

sudo ecryptfs-migrate-home -u user

Where "user" is your username. When the command completes you must log out and back in as "user", before rebooting. Then you should generate a recovery passphrase and write this down somewhere safe (I typically just take a picture of it with my phone - which is also encrypted, with LUKS in fact).

ecryptfs-unwrap-passphrase

Finally, to make the system fully secure, you should also encrypt /swap

sudo ecryptfs-setup-swap

And that's pretty much all there is to it.

Board footer

Forum Software