Discussion:
[blfs-support] UPower-0.99.7 No such method 'Suspend'
Wayne Sallee via blfs-support
2018-12-03 18:01:34 UTC
Permalink
I upgraded upower to version 0.99.7 but then could no longer suspend with the command "dbus-send --system --print-reply
--dest='org.freedesktop.UPower' /org/freedesktop/UPower org.freedesktop.UPower.Suspend", as it gives the error "Error
org.freedesktop.DBus.Error.UnknownMethod: No such method 'Suspend' ".

So I put the older version of upower back.



Google search shows that this is "because UPower has been superseded by Systemd.Logind".

So without systemd, what methods have y'all used to work around this?

Wayne Sallee
***@WayneSallee.com
http://www.WayneSallee.com
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/fa
Ken Moffat via blfs-support
2018-12-03 18:34:23 UTC
Permalink
Post by Wayne Sallee via blfs-support
I upgraded upower to version 0.99.7 but then could no longer suspend with
the command "dbus-send --system --print-reply
--dest='org.freedesktop.UPower' /org/freedesktop/UPower
org.freedesktop.UPower.Suspend", as it gives the error "Error
org.freedesktop.DBus.Error.UnknownMethod: No such method 'Suspend' ".
So I put the older version of upower back.
Google search shows that this is "because UPower has been superseded by Systemd.Logind".
So without systemd, what methods have y'all used to work around this?
Wayne Sallee
Three things:

pm-utils to provide the suspend and hibernate commands,

xbindkeys (run from startx) with a script to bind a specific key to
pm-suspend (on a plain keyboard I use F12 for suspend, F11 for
hibernate, but if there are extra silly keys at the top, I have used
one of those in the past),

and a file in /etc/sudoers.d so that I can run pm-suspend or
pm-hibernate via sudo without needing a password.

I will note that on modern *desktop* machines, not all of them
support suspend (nowadays, hibernate seems to work a lot more
reliably than it used to), and of those that do support suspend, a
PS/2 keyboard seems to be required (otherwise, there may not be a
way to wake it up). For laptops, hopefully suspend "just works".

ĸen
--
I'm saving up 22 shillings and 10 pence (almost a pound!) per week to
buy an ARM-13.
http://www.antipope.org/charlie/blog-static/2018/11/brexit-means-brexit.html
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.
Wayne Sallee via blfs-support
2018-12-03 23:00:24 UTC
Permalink
Post by Ken Moffat via blfs-support
Post by Wayne Sallee via blfs-support
I upgraded upower to version 0.99.7 but then could no longer suspend with
the command "dbus-send --system --print-reply
--dest='org.freedesktop.UPower' /org/freedesktop/UPower
org.freedesktop.UPower.Suspend", as it gives the error "Error
org.freedesktop.DBus.Error.UnknownMethod: No such method 'Suspend' ".
So I put the older version of upower back.
Google search shows that this is "because UPower has been superseded by Systemd.Logind".
So without systemd, what methods have y'all used to work around this?
Wayne Sallee
pm-utils to provide the suspend and hibernate commands,
xbindkeys (run from startx) with a script to bind a specific key to
pm-suspend (on a plain keyboard I use F12 for suspend, F11 for
hibernate, but if there are extra silly keys at the top, I have used
one of those in the past),
and a file in /etc/sudoers.d so that I can run pm-suspend or
pm-hibernate via sudo without needing a password.
I will note that on modern *desktop* machines, not all of them
support suspend (nowadays, hibernate seems to work a lot more
reliably than it used to), and of those that do support suspend, a
PS/2 keyboard seems to be required (otherwise, there may not be a
way to wake it up). For laptops, hopefully suspend "just works".
ĸen
I use xbindkeys for suspend and for hybernate, and for other things as well. And I also use Autokey.
I have pm-utils.

Can you elaborate?

Wayne Sallee
***@WayneSallee.com
http://www.WayneSallee.com
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the abo
Ken Moffat via blfs-support
2018-12-03 23:33:19 UTC
Permalink
Post by Wayne Sallee via blfs-support
Post by Ken Moffat via blfs-support
Post by Wayne Sallee via blfs-support
I upgraded upower to version 0.99.7 but then could no longer suspend with
the command "dbus-send --system --print-reply
--dest='org.freedesktop.UPower' /org/freedesktop/UPower
org.freedesktop.UPower.Suspend", as it gives the error "Error
org.freedesktop.DBus.Error.UnknownMethod: No such method 'Suspend' ".
So I put the older version of upower back.
[...]
Post by Wayne Sallee via blfs-support
Post by Ken Moffat via blfs-support
Post by Wayne Sallee via blfs-support
Google search shows that this is "because UPower has been superseded by Systemd.Logind".
So without systemd, what methods have y'all used to work around this?
Wayne Sallee
pm-utils to provide the suspend and hibernate commands,
xbindkeys (run from startx) with a script to bind a specific key to
pm-suspend (on a plain keyboard I use F12 for suspend, F11 for
hibernate, but if there are extra silly keys at the top, I have used
one of those in the past),
and a file in /etc/sudoers.d so that I can run pm-suspend or
pm-hibernate via sudo without needing a password.
I will note that on modern *desktop* machines, not all of them
support suspend (nowadays, hibernate seems to work a lot more
reliably than it used to), and of those that do support suspend, a
PS/2 keyboard seems to be required (otherwise, there may not be a
way to wake it up). For laptops, hopefully suspend "just works".
ĸen
I use xbindkeys for suspend and for hybernate, and for other things as well. And I also use Autokey.
I have pm-utils.
Can you elaborate?
Wayne Sallee
Not sure.

At the end of ~/.xbindkeysrc I have three entries (I initially
copied this one from a machine where I could not get it to suspend,
and with an older keyboard, so two entries for hibernate and a later
addition for suspend.

"sudo /usr/sbin/pm-hibernate"
XF86Calculator

"sudo /usr/sbin/pm-hibernate"
F11

"sudo /usr/sbin/pm-suspend"
F12

And

cat > /etc/sudoers.d/suspend << 'EOF'
# allow this user to run swsuspend without a password
ken ALL= NOPASSWD: /usr/sbin/pm-suspend
EOF
chmod -v 440 /etc/sudoers.d/suspend >>$KM_LOG 2>&1

After that, if it doesn't work start debugging by trying to run
pm-suspend as root.

NB I rarely install upower, and then only because it is a dep for
something in xfce.

ĸen
--
I'm saving up 22 shillings and 10 pence (almost a pound!) per week to
buy an ARM-13.
http://www.antipope.org/charlie/blog-static/2018/11/brexit-means-brexit.html
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above i
Wayne Sallee via blfs-support
2018-12-04 00:35:13 UTC
Permalink
Post by Ken Moffat via blfs-support
Post by Wayne Sallee via blfs-support
Post by Ken Moffat via blfs-support
Post by Wayne Sallee via blfs-support
I upgraded upower to version 0.99.7 but then could no longer suspend with
the command "dbus-send --system --print-reply
--dest='org.freedesktop.UPower' /org/freedesktop/UPower
org.freedesktop.UPower.Suspend", as it gives the error "Error
org.freedesktop.DBus.Error.UnknownMethod: No such method 'Suspend' ".
So I put the older version of upower back.
[...]
Post by Wayne Sallee via blfs-support
Post by Ken Moffat via blfs-support
Post by Wayne Sallee via blfs-support
Google search shows that this is "because UPower has been superseded by Systemd.Logind".
So without systemd, what methods have y'all used to work around this?
Wayne Sallee
pm-utils to provide the suspend and hibernate commands,
xbindkeys (run from startx) with a script to bind a specific key to
pm-suspend (on a plain keyboard I use F12 for suspend, F11 for
hibernate, but if there are extra silly keys at the top, I have used
one of those in the past),
and a file in /etc/sudoers.d so that I can run pm-suspend or
pm-hibernate via sudo without needing a password.
I will note that on modern *desktop* machines, not all of them
support suspend (nowadays, hibernate seems to work a lot more
reliably than it used to), and of those that do support suspend, a
PS/2 keyboard seems to be required (otherwise, there may not be a
way to wake it up). For laptops, hopefully suspend "just works".
ĸen
I use xbindkeys for suspend and for hybernate, and for other things as well. And I also use Autokey.
I have pm-utils.
Can you elaborate?
Wayne Sallee
Not sure.
At the end of ~/.xbindkeysrc I have three entries (I initially
copied this one from a machine where I could not get it to suspend,
and with an older keyboard, so two entries for hibernate and a later
addition for suspend.
"sudo /usr/sbin/pm-hibernate"
XF86Calculator
"sudo /usr/sbin/pm-hibernate"
F11
"sudo /usr/sbin/pm-suspend"
F12
And
cat > /etc/sudoers.d/suspend << 'EOF'
# allow this user to run swsuspend without a password
ken ALL= NOPASSWD: /usr/sbin/pm-suspend
EOF
chmod -v 440 /etc/sudoers.d/suspend >>$KM_LOG 2>&1
After that, if it doesn't work start debugging by trying to run
pm-suspend as root.
NB I rarely install upower, and then only because it is a dep for
something in xfce.
ĸen
Ok, so you are running pm-hibrnate and pm-suspend, instead of upower.
Could probably set those as root uid to accomplish the same thing.

Thanks.

Wayne Sallee
***@WayneSallee.com
http://www.WayneSallee.com
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Uns
Wayne Sallee via blfs-support
2018-12-04 00:43:39 UTC
Permalink
-------- Original Message --------
*Subject: *Re: [blfs-support] UPower-0.99.7 No such method 'Suspend'
*From: *Wayne Sallee <***@WayneSallee.com>
*To: *blfs-***@lists.linuxfromscratch.org
*Date: *12/03/2018 07:35 PM
Post by Wayne Sallee via blfs-support
Post by Ken Moffat via blfs-support
Not sure.
At the end of ~/.xbindkeysrc I have three entries (I initially
copied this one from a machine where I could not get it to suspend,
and with an older keyboard, so two entries for hibernate and a later
addition for suspend.
"sudo /usr/sbin/pm-hibernate"
XF86Calculator
"sudo /usr/sbin/pm-hibernate"
F11
"sudo /usr/sbin/pm-suspend"
F12
And
cat > /etc/sudoers.d/suspend << 'EOF'
# allow this user to run swsuspend without a password
ken ALL= NOPASSWD: /usr/sbin/pm-suspend
EOF
chmod -v 440 /etc/sudoers.d/suspend >>$KM_LOG 2>&1
After that, if it doesn't work start debugging by trying to run
pm-suspend as root.
NB I rarely install upower, and then only because it is a dep for
something in xfce.
ĸen
Ok, so you are running pm-hibrnate and pm-suspend, instead of upower.
Could probably set those as root uid to accomplish the same thing.
Thanks.
Wayne Sallee
http://www.WayneSallee.com
Actually those are shortcuts to scripts, so my previous statement of root uid would not work.

Wayne Sallee
***@WayneSallee.com
http://www.WayneSallee.com
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See
Wayne Sallee via blfs-support
2018-12-08 16:04:59 UTC
Permalink
Instead of going the sudo rout, I ended up creating a file chmod 4751:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>


int main()
{
setuid( 0 );   // you can set it at run time also
clearenv();
system("/usr/sbin/pm-suspend");
return 0;

}


Wayne Sallee
***@WayneSallee.com
http://www.WayneSallee.com
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Uns
Bruce Dubbs via blfs-support
2018-12-08 16:48:54 UTC
Permalink
Post by Wayne Sallee via blfs-support
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
int main()
{
setuid( 0 );   // you can set it at run time also
clearenv();
system("/usr/sbin/pm-suspend");
return 0;
}
I don't see why a C program is needed. Why not just:

sudo /usr/sbin/pm-suspend

It can be shortened by a little with a short bash scrript of even an alias.

-- Bruce
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above i
Wayne Sallee via blfs-support
2018-12-08 18:25:19 UTC
Permalink
Post by Ken Moffat via blfs-support
Post by Wayne Sallee via blfs-support
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
int main()
{
setuid( 0 );   // you can set it at run time also
clearenv();
system("/usr/sbin/pm-suspend");
return 0;
}
sudo /usr/sbin/pm-suspend
It can be shortened by a little with a short bash scrript of even an alias.
  -- Bruce
Yes, the sudo method would work, but I don't have sudo installed, and don't want it installed.

Wayne Sallee
***@WayneSallee.com
http://www.WayneSallee.com
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
U
Ken Moffat via blfs-support
2018-12-08 19:58:17 UTC
Permalink
Post by Wayne Sallee via blfs-support
Yes, the sudo method would work, but I don't have sudo installed, and don't want it installed.
Wayne Sallee
LOL. It was getting my desktop machines to suspend which persuaded
me to add sudo to my normal desktop build.

ĸen
--
I'm saving up 22 shillings and 10 pence (almost a pound!) per week to
buy an ARM-13.
http://www.antipope.org/charlie/blog-static/2018/11/brexit-means-brexit.html
--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above informat
Loading...