DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 25th April 2019
hitest's Avatar
hitest hitest is offline
Real Name: George Nielsen
VPN Cryptographer
 
Join Date: Sep 2008
Location: B.C., Canada
Posts: 374
Default Shut down issue in 6.5

Installed 6.5 yesterday, everything mostly behaves as expected. I am having one issue with shutting down my PC when running XFCE.
When I click on my name and then click on shut down the PC starts counting down for a shut down. When it reaches the 30 second mark the PC reverts back to the xenodm log-in screen. On OpenBSD 6.4 this previously worked. I'm assuming that something may have changed moving from 6.4---> 6.5?

Here is my /etc/rc.conf.local file:

Code:
xenodm_flags=""
pkg_scripts="messagebus"
ntpd_flags="-s"
Here is my .xsession file which is in my home directory:

Code:
exec ck-launch-session startxfce4
Thanks for any and all replies. This isn't emergent. I can shut down the PC using the XFCE terminal.
__________________
hitest
Reply With Quote
  #2   (View Single Post)  
Old 25th April 2019
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

I don't use XFCE, but I noticed that the pkg-readme for the XFCE meta package says:
Quote:
If you run a systemwide D-BUS service, have consolekit2/polkit installed and don't use --with-ck-launch you will not be able to shutdown/reboot.
http://cvsweb.openbsd.org/cgi-bin/cv...ype=text/plain
Reply With Quote
  #3   (View Single Post)  
Old 25th April 2019
hitest's Avatar
hitest hitest is offline
Real Name: George Nielsen
VPN Cryptographer
 
Join Date: Sep 2008
Location: B.C., Canada
Posts: 374
Default

Thanks for the reply. I read the link you provided. I tried adding --with to my .xsession file and locked myself out of my system until I logged in as root and reverted back to the previous state.

Tried this and locked myself out.

Code:
exec --with-ck-launch-session startxfce4

This is what I'm using now.

Code:
exec ck-launch-session startxfce4
I do have consolekit2 and polkit installed. I suspect I don't understand the XFCE link you provided.
__________________
hitest

Last edited by hitest; 25th April 2019 at 04:09 PM. Reason: typo
Reply With Quote
  #4   (View Single Post)  
Old 25th April 2019
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

An XFCE user may jump in with specific answers. Meanwhile, you'll find a more readable version of that link as a file on your system in /usr/local/share/doc/pkg-readmes/
Reply With Quote
  #5   (View Single Post)  
Old 25th April 2019
hitest's Avatar
hitest hitest is offline
Real Name: George Nielsen
VPN Cryptographer
 
Join Date: Sep 2008
Location: B.C., Canada
Posts: 374
Thumbs up

Quote:
Originally Posted by jggimi View Post
An XFCE user may jump in with specific answers. Meanwhile, you'll find a more readable version of that link as a file on your system in /usr/local/share/doc/pkg-readmes/
Thanks, mate. I will go check that out.
__________________
hitest
Reply With Quote
  #6   (View Single Post)  
Old 25th April 2019
hitest's Avatar
hitest hitest is offline
Real Name: George Nielsen
VPN Cryptographer
 
Join Date: Sep 2008
Location: B.C., Canada
Posts: 374
Default

Read the text you suggested. I do have messagebus running. However, the suggested edits for .xsession and or /etc/rc.conf.local are very vague. I don't understand what they're talking about. Heh.
If you're an XFCE user please clarify this. Thank you kindly.
__________________
hitest
Reply With Quote
  #7   (View Single Post)  
Old 25th April 2019
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,507
Default

Quote:
Halting and rebooting require consolekit2 and polkit: you'll need to run
a systemwide D-BUS service (add messagebus to pkg_scripts in
rc.conf.local) and pass --with-ck-launch argument to startxfce4. If you
run a systemwide D-BUS service, have consolekit2/polkit installed and
don't use --with-ck-launch you will not be able to shutdown/reboot.
If I read this strictly the .xsession syntax should be:
Code:
/usr/local/bin/startxfce4 --with-ck-launch


polkit(8) sets rules in /etc/polkit-1/rules.d/50-default.rules.

My /etc/polkit-1/rules.d/50-default.rules

Code:
/* -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- */

// DO NOT EDIT THIS FILE, it will be overwritten on update
//
// Default rules for polkit
//
// See the polkit(8) man page for more information
// about configuring polkit.

polkit.addAdminRule(function(action, subject) {
    return ["unix-group:wheel"];
});
Suggests you need to be a member of the wheel group.

There is also a /usr/local/share/polkit-1/rules.d/10-openbsd-consolekit.rules.

The 10-openbsd-consolekit.rules specifically address user shutdown, reboot, hibernation for users in the wheel group I'm not sure they are active - have not seen any code that references them. Classically, 10-openbsd-consolekit.rules would need to be in /etc/polkit-1/rules.d/.

Last edited by shep; 25th April 2019 at 10:15 PM.
Reply With Quote
  #8   (View Single Post)  
Old 26th April 2019
hitest's Avatar
hitest hitest is offline
Real Name: George Nielsen
VPN Cryptographer
 
Join Date: Sep 2008
Location: B.C., Canada
Posts: 374
Default

shep,

Thanks man. Will give that a try tomorrow. I appreciate your help!
__________________
hitest
Reply With Quote
  #9   (View Single Post)  
Old 26th April 2019
hitest's Avatar
hitest hitest is offline
Real Name: George Nielsen
VPN Cryptographer
 
Join Date: Sep 2008
Location: B.C., Canada
Posts: 374
Default

Okay made the suggested edits to .xsession and XFCE starts up normally. Checked my /etc/polkit-1/rules.d/50-default.rules and they are the same as yours.
I am still unable to shutdown from the upper right XFCE menu.
__________________
hitest
Reply With Quote
Old 26th April 2019
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

You might reach out to Landry, he's the port maintainer. You'll find his Email address with $ pkg_info xfce.
Reply With Quote
Old 26th April 2019
hitest's Avatar
hitest hitest is offline
Real Name: George Nielsen
VPN Cryptographer
 
Join Date: Sep 2008
Location: B.C., Canada
Posts: 374
Thumbs up

Quote:
Originally Posted by jggimi View Post
You might reach out to Landry, he's the port maintainer. You'll find his Email address with $ pkg_info xfce.
Thanks jggimi! I will do that in the next little while.
__________________
hitest
Reply With Quote
Old 26th April 2019
albator albator is offline
Shell Scout
 
Join Date: Jul 2011
Posts: 98
Default

I used to use XFCE (it was with OpenBSD 5.4).
By the time, to shutdown the computer from XFCE I added one of these two lines to /etc/sudoers:
Code:
username ALL=NOPASSWD: /usr/local/lib/xfce4/session/xfsm-shutdown-helper
or
Code:
%users ALL=NOPASSWD: /usr/local/lib/xfce4/session/xfsm-shutdown-helper
On the 1st line, username is to be replaced by your user name.
For the 2nd one, you need to belong to the user group.

If xfsm-shutdown-helper still exists, maybe the same thing can be achieved with doas.
Reply With Quote
Old 26th April 2019
hitest's Avatar
hitest hitest is offline
Real Name: George Nielsen
VPN Cryptographer
 
Join Date: Sep 2008
Location: B.C., Canada
Posts: 374
Default

Quote:
Originally Posted by albator View Post
I used to use XFCE (it was with OpenBSD 5.4).
By the time, to shutdown the computer from XFCE I added one of these two lines to /etc/sudoers:
Code:
username ALL=NOPASSWD: /usr/local/lib/xfce4/session/xfsm-shutdown-helper
I do like to use sudo. Tried adding this line of code to the end of /etc/sudoers. Didn't work. Thank you for the suggestion.
__________________
hitest
Reply With Quote
Old 27th April 2019
hitest's Avatar
hitest hitest is offline
Real Name: George Nielsen
VPN Cryptographer
 
Join Date: Sep 2008
Location: B.C., Canada
Posts: 374
Default

I'm pleased to report a solution to my problem. Landry said that something changed in the consolekit/policykit rules a bit before 6.5, and that might be related.
He suggested that I put myself in the operator group. That worked. I can now shut down my box using the XFCE shut down menu. Here's a snippet of my /etc/group.

Code:
bsd$ cat /etc/group
wheel:*:0:root,hitest
daemon:*:1:daemon
kmem:*:2:root
sys:*:3:root
tty:*:4:root
operator:*:5:root,hitest
Many thanks to Landry and to all of you for your kind help. It is appreciated!
__________________
hitest
Reply With Quote
Old 7th May 2019
TheTKS TheTKS is offline
Port Guard
 
Join Date: Sep 2018
Location: Canada
Posts: 43
Default

As wheel user, I'm unable to shutdown from Xfce. When clicking on my name, Shutdown and Restart are greyed out.

I can logout from xfce to the xenodm login screen, but I can only shutdown or reboot from a console as root.

I was able to shutdown from xfce in 6.4.

Here's how I took my machine from 6.4 to 6.5:

- Wiped drive dedicated to OpenBSD
- Did a clean install, from install65.fs (6.4 was installed from install64.iso)
- Did full drive encryption as https://www.openbsd.org/faq/faq14.html#softraid (did not encrypt in 6.4)
- After installation:
- As root
Code:
# pkg_add xfce xfce-extras consolekit2 polkit nano
- Originally I generated the wheel user’s .xsession as root and copied it to wheel user’s home directory. After I saw that I couldn’t shutdown from xfce as wheel user, I deleted that .xsession and, signed out of root, signed in as wheel user and generated, as user, a new .xsession
Code:
$ nano .xsession
exec startxfce4 --with-ck-launch
- Added wheel user to operator group

This is my /etc/rc.conf.local
Code:
sshd_flags=NO
xenodm_flags=
pkg_scripts="messagebus"
Any suggestions on what I could look at next?

- I think polkit is included in an OpenBSD installation. Could having run pkg_add polkit have broken something?
- Could full disk encryption affect this?

Thanks,

TKS

Last edited by TheTKS; 8th May 2019 at 11:24 AM. Reason: Edited for clarity and accuracy
Reply With Quote
Old 11th May 2019
victorvas victorvas is offline
Real Name: Victor
Linux
 
Join Date: May 2019
Posts: 148
Default

I use terminal commands for shutdown and reboot
Shutdown:
doas -u root shutdown -p now
Reboot:
doas -u root shutdown -r now

of course /etc/doas.conf must contain this line following by an empty line at the end of file:
permit setenv { -ENV PS1=$DOAS_PS1 SSH_AUTH_SOCK } :wheel

Don't forget the empty line at the end of file or doas will be returning syntax error.
Also your user should be a member of a wheel group.
To watch current groups of a user:
groups your_user_name
to add user to a wheel group:
usermod -G wheel your_user_name

Quote:
Originally Posted by TheTKS View Post
As wheel user, I'm unable to shutdown from Xfce. When clicking on my name, Shutdown and Restart are greyed out.
Edit or create /etc/rc.conf.local
Put these lines inside it:

pkg_scripts="dbus_daemon avahi_daemon messagebus"
dbus_enable

you can also enable avahi if you want
Then open your ~/.xinitrc

exec startxfce4 --with-ck-launch

that's should do it.

Last edited by victorvas; 11th May 2019 at 11:36 AM.
Reply With Quote
Old 12th May 2019
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Users who wish to shutdown with consolekit / polkit now need to be in the operator group.

https://www.reddit.com/r/openbsd/com...ut_openbsd_65/
Reply With Quote
Old 13th May 2019
TheTKS TheTKS is offline
Port Guard
 
Join Date: Sep 2018
Location: Canada
Posts: 43
Default

I am finally able to shutdown and reboot from Xfce as wheel and non-wheel users. I left root with the default fvwm.

After reading earlier posts and doing what I wrote in my note above, then spending way more time on this than I should have, and then not getting shutdown and reboot to work, and then reading /usr/local/share/doc/pkg-readmes/xfce, I decided that I should also read through avahi, dbus and consolekit2 in the same directory.

After reading /usr/local/share/doc/pkg-readmes/avahi and seeing these notes there...
Quote:
For proper functionality, multicast(4) needs to be enabled
Quote:
Note that you MUST have a system-wide D-BUS daemon running BEFORE starting avahi
... I did this:
Ran
Code:
# rcctl enable avahi_daemon
Changed wheel and non-wheel user .xsessions to
Code:
/usr/local/bin/startxfce4 --with-ck-launch
Changed my /etc/rc.conf.local to
Code:
multicast=YES
pkg_scripts=messagebus avahi_daemon
sshd_flags=NO
xenodm_flags=
I'm not convinced my set up is both right and as compact as it could be (for instance, I thought in 6.4 I didn't have "avahi_daemon" in pkg_scripts, and definitely not "multicast=YES"), but it's working.

After getting this working, I played with .xsession and with /etc/rc.conf.local, broke things and learned a few things, and came back to this .xsession and rc.conf.local, so I'm sticking with these for now.

If I stick with Xfce, I think learning more about messagebus, dbus, avahi, consolekit2 and polkit might be helpful.

Thanks hitest, shep and jggimi

Edit:
After reading more about avahi, I didn't see a need for it for what I do, and couldn't understand how it could affect this, so I removed two terms and am able to shutdown and restart from Xfce with just this in /etc/rc.conf.local:

Code:
pkg_scripts=messagebus
sshd_flags=NO
xenodm_flags=
TKS

Last edited by TheTKS; 13th May 2019 at 11:23 PM. Reason: Update
Reply With Quote
Old 14th May 2019
blackhole's Avatar
blackhole blackhole is offline
Spam Deminer
 
Join Date: Mar 2014
Posts: 320
Default

Yes avahi is unrelated. If you had functioning shutdown/reboot, etc before upgrading, you should only need to add your user to the operator group.

~/.xsession
Code:
exec ck-launch-session startxfce4
or
Code:
exec startxfce4 --with-ck-launch
And
Code:
pkg_scripts=messagebus
added to /etc/rc.conf.local

Refer to: /usr/local/share/doc/pkg-readmes/xfce
Reply With Quote
Old 14th May 2019
TheTKS TheTKS is offline
Port Guard
 
Join Date: Sep 2018
Location: Canada
Posts: 43
Default

Quote:
Originally Posted by cynwulf View Post
Yes avahi is unrelated. If you had functioning shutdown/reboot, etc before upgrading, you should only need to add your user to the operator group.

...

Refer to: /usr/local/share/doc/pkg-readmes/xfce
Thanks for the confirmation on avahi.

I was able to shutdown & restart from Xfce in 6.4 with the same terms in rc.conf.local as I have ended up with in 6.5 (possibly in a different order, though - I kept a copy, but I'm not posting from that machine.)

I didn't upgrade, though, I wiped and did a clean installation. Which is why I was puzzled why, with those same terms at one point in my 6.5 rc.conf.local (again, possibly in a different order), but with updated .xsession and user added to the operator group, I wasn't able to shutdown & restart from Xfce.

In the end, after...
- reading the posts here and on other forums and websites, and
- reading /usr/local/share/doc/pkg-readmes/xfce (and a few other pkg readmes)
- all more than once...
I tried a bunch of things and eventually got it to work.

Not a pretty process, but I think I got the setup correct and as compact as it should be, and I learned a couple of things along the way.

I'm declaring victory, with help from forum friendlies here and elsewhere, and from Landry Breuil via hitest.

TKS
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to properly shut down OpenBSD? rain1 OpenBSD General 8 28th October 2018 01:05 PM
xen 45 issue philo_neo71 NetBSD General 1 9th November 2015 11:05 AM
Secrets, lies and Snowden's email: why I was forced to shut down Lavabit J65nko News 1 22nd May 2014 01:08 AM
FTP issue? desreguard OpenBSD General 14 29th August 2011 04:21 PM
Possible SMP Issue? MetalHead OpenBSD General 1 25th November 2008 03:52 AM


All times are GMT. The time now is 12:16 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick