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 24th September 2018
bsd007's Avatar
bsd007 bsd007 is offline
Always learning
 
Join Date: Sep 2014
Posts: 219
Default [SOLVED] What is the correct way to shutdown OpenBSD from XFCE ?

What is the correct way to shut down OpenBSD from XFCE ?

I launched terminal then su to root the ran

Code:
shutdown now
What happened is it killed the Xserver then again presented me a promt.

I don't remember the exact output. I will have to try n shutdown again and check.
__________________
OpenBSD 6.4
Intel(R) Core(TM) i3-6100 CPU
Ram 4GB
Intel HD Graphics

Last edited by bsd007; 24th September 2018 at 06:12 AM.
Reply With Quote
  #2   (View Single Post)  
Old 24th September 2018
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
Bloaty McBloatFace
 
Join Date: Dec 2015
Location: London
Posts: 100
Default

I use dwm rather than xfce but pressing the power button always works on my laptop, OpenBSD's acpi support is excellent
__________________
Linux is for people who hate Windows. BSD is for people who love UNIX.
Reply With Quote
  #3   (View Single Post)  
Old 24th September 2018
bsd007's Avatar
bsd007 bsd007 is offline
Always learning
 
Join Date: Sep 2014
Posts: 219
Default

Quote:
Originally Posted by Head_on_a_Stick View Post
I use dwm rather than xfce but pressing the power button always works on my laptop, OpenBSD's acpi support is excellent
You are right. I just pressed the power button and it shutdown cleanly.

Thanks a lot.
__________________
OpenBSD 6.4
Intel(R) Core(TM) i3-6100 CPU
Ram 4GB
Intel HD Graphics
Reply With Quote
  #4   (View Single Post)  
Old 24th September 2018
LeFrettchen's Avatar
LeFrettchen LeFrettchen is offline
Marveled user
 
Join Date: Aug 2012
Location: France
Posts: 332
Default

I use the terminal :
Code:
$ doas halt -p
__________________
The secret of wisdom is not wisdom itself, it's the road that leads us there.
Reply With Quote
  #5   (View Single Post)  
Old 24th September 2018
bsd007's Avatar
bsd007 bsd007 is offline
Always learning
 
Join Date: Sep 2014
Posts: 219
Default

Quote:
Originally Posted by LeFrettchen View Post
I use the terminal :
Code:
$ doas halt -p
Thanks for sharing. I will try it out.
__________________
OpenBSD 6.4
Intel(R) Core(TM) i3-6100 CPU
Ram 4GB
Intel HD Graphics
Reply With Quote
  #6   (View Single Post)  
Old 24th September 2018
sacerdos_daemonis's Avatar
sacerdos_daemonis sacerdos_daemonis is offline
Real Name: Will forever be a secret.
Package Pilot
 
Join Date: Sep 2014
Posts: 214
Default

Code:
# shutdown -p now
or
Code:
$ shutdown -p now
works fine as well. The first if logged into the root account, the second if the user has permission to execute the shutdown command.
__________________
OpenBSD 6.3
Reply With Quote
  #7   (View Single Post)  
Old 24th September 2018
bsd007's Avatar
bsd007 bsd007 is offline
Always learning
 
Join Date: Sep 2014
Posts: 219
Default

Quote:
Originally Posted by sacerdos_daemonis View Post
Code:
# shutdown -p now
or
Code:
$ shutdown -p now
works fine as well. The first if logged into the root account, the second if the user has permission to execute the shutdown command.
I tried it without the -p but it didn't work. I will try with -p. Thanks for replying.
__________________
OpenBSD 6.4
Intel(R) Core(TM) i3-6100 CPU
Ram 4GB
Intel HD Graphics
Reply With Quote
  #8   (View Single Post)  
Old 26th September 2018
new2BSDlol new2BSDlol is offline
Port Guard
 
Join Date: Jun 2018
Posts: 15
Default

Quote:
Originally Posted by sacerdos_daemonis View Post
Code:
# shutdown -p now
or
Code:
$ shutdown -p now
works fine as well. The first if logged into the root account, the second if the user has permission to execute the shutdown command.
How do I give the user permission to run the shutdown command? I have "permit nopass username cmd shutdown" in /etc/doas.conf, but not having to use doas would be fine.
Reply With Quote
  #9   (View Single Post)  
Old 26th September 2018
sacerdos_daemonis's Avatar
sacerdos_daemonis sacerdos_daemonis is offline
Real Name: Will forever be a secret.
Package Pilot
 
Join Date: Sep 2014
Posts: 214
Default

I use
Code:
# usermod -G operator name_of_user
when configuring USB mounting while following this guide http://daemonforums.org/showthread.php?t=2232
One benefit is it also gives the user shutdown privileges.
__________________
OpenBSD 6.3
Reply With Quote
Old 26th September 2018
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,354
Default

It also gives the user read access to drive devices, in order to conduct dump(8) backups. This bypasses filesystem read security, and should be carefully considered if the user runs untrusted code -- such as a browser running javascript from a website.
Reply With Quote
Old 26th September 2018
new2BSDlol new2BSDlol is offline
Port Guard
 
Join Date: Jun 2018
Posts: 15
Default

Right, thanks. At the moment my doas.conf is:

permit persist :wheel
permit nopass openbsd63user cmd mount
permit nopass openbsd63user cmd umount
permit nopass openbsd63user cmd find
permit nopass openbsd63user cmd disklabel
permit nopass openbsd63user cmd syspatch
permit nopass openbsd63user cmd shutdown
permit nopass openbsd63user cmd reboot
permit nopass openbsd63user cmd ntpd

Would you consider any of those to be an obvious security vulnerability (I was told off for using sudo in a screenshot that I posted on 4chan /g/ in BSD general and advised to switch to doas... someone commented that sudo is susceptible to subtle misconfiguration errors)?
Reply With Quote
Old 26th September 2018
TronDD TronDD is offline
Package Pilot
 
Join Date: Sep 2014
Posts: 178
Default

You have to be very careful with your rules.

doas is a much smaller codebase that is setuid root than sudo is. That's one of the benefits. But either one could mistakenly give root access you didn't intend.

Try
Code:
doas find <some file that exists> -exec /bin/ksh \;
And see if that is what you want to allow to happen.
Reply With Quote
Old 26th September 2018
new2BSDlol new2BSDlol is offline
Port Guard
 
Join Date: Jun 2018
Posts: 15
Default

Quote:
Originally Posted by TronDD View Post
Try
Code:
doas find <some file that exists> -exec /bin/ksh \;
And see if that is what you want to allow to happen.
Hahah ok, removing that line from doas.conf...

I just knew I'd make a dumb mistake...
Reply With Quote
Old 26th September 2018
shep shep is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,171
Default

The README for Xfce4 has information on using consolekit/polkit to shutdown from the menu.
http://cvsweb.openbsd.org/cgi-bin/cv...kg/README-main

Quote:
Logging out and shutting down the computer
==========================================
If your installation supports complete shutdown, clicking on the logout
button on panel will permit you to either logout, rebooting or halt
the computer.

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.
The same file should be on your system at /usr/local/share/doc/pkg-readmes/

Edit: I recall that you also need to add your user to the operator group.

Last edited by shep; 27th September 2018 at 08:00 PM. Reason: Operator group
Reply With Quote
Old 27th September 2018
johnR johnR is offline
Port Guard
 
Join Date: Nov 2017
Posts: 24
Default

Quote:
Originally Posted by new2BSDlol View Post
How do I give the user permission to run the shutdown command? I have "permit nopass username cmd shutdown" in /etc/doas.conf, but not having to use doas would be fine.
It's simpler to use the 'halt' command:
Code:
$ doas halt -p
I have the following line in /etc/doas.conf:
Code:
permit nopass username as root cmd halt args -p
If you need to use doas to execute a command with specific arguments (as above) you need to specify them with the 'args' keyword in doas.conf. See 'man doas.conf'.

Last edited by johnR; 27th September 2018 at 11:23 AM.
Reply With Quote
Reply

Tags
hang, shutdown

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
Barti asked about OpenBSD startup/shutdown jggimi OpenBSD General 0 17th July 2012 04:17 PM
OpenBSD Gnome/XFCE tools Noobification OpenBSD Packages and Ports 7 23rd December 2010 09:36 PM
HOWTO: Lightest XFCE - Making XFCE lighter and faster vermaden Guides 27 2nd September 2010 12:24 PM
openbsd shutdown phill OpenBSD General 3 27th October 2009 12:27 PM
Polkit Shutdown for XFCE in Freebsd 7.0 shep FreeBSD General 1 18th May 2008 12:24 AM


All times are GMT. The time now is 09:44 PM.


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