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 29th April 2016
rain1 rain1 is offline
New User
 
Join Date: Apr 2016
Posts: 5
Default How to properly shut down OpenBSD?

Hello

what is the best way to shut down an openbsd computer?

I have been doing su to get root and then shutdown -h. It doesn't fully shut down though, it mostly does but stops at "you computer has stopped. press any key to reboot.".

I have to hold the power button after that to get it to actually go off.

Is there an option i have to change of a different way to shut down the system?
Reply With Quote
  #2   (View Single Post)  
Old 29th April 2016
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,507
Default

See the -p option in the shutdown(8) manual page
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #3   (View Single Post)  
Old 29th April 2016
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,387
Default

My turn to say, "Hello, and welcome!"

The shutdown(8) program will call halt(8) after sending messages to all users at a specified time. If you do not need to inform other users or need to schedule shutdown for a specific time, you may use halt(8) directly.

Both shutdown(8) and halt(8) have a -p option. If the hardware supports automatic power down, the system will power off after the halt(8) completes. See either command's man page.
Reply With Quote
  #4   (View Single Post)  
Old 29th April 2016
LeFrettchen's Avatar
LeFrettchen LeFrettchen is offline
Marveled user
 
Join Date: Aug 2012
Location: France
Posts: 334
Default

Quote:
Originally Posted by jggimi View Post
If the hardware supports automatic power down, the system will power off after the halt(8) completes.
Right with a recent OpenBSD version.
But a not so long time ago, it was a different story.

I think "halt -p" works directly since OpenBSD 5.6 (not really sure it was 5.6...).
Before, you had to edit first /etc/rc.shutdown and change the powerdown value "powerdown=NO" in "powerdown=YES".
__________________
The secret of wisdom is not wisdom itself, it's the road that leads us there.
Reply With Quote
  #5   (View Single Post)  
Old 29th April 2016
e1-531g e1-531g is offline
VPN Cryptographer
 
Join Date: Mar 2014
Posts: 448
Default

My user name is: open
My hostname is: r2d2

Using doas(1):
Code:
# grep halt /etc/doas.conf  
permit nopass open as root cmd /sbin/halt args -p
$ doas /sbin/halt -p
Using sudo from ports/packages:
Code:
# grep halt /etc/sudoers                                                       
open    r2d2=(root) NOPASSWD: /sbin/halt -p
$ sudo halt -p
You probably can make aliases in yours shell config to shorten that.
Reply With Quote
  #6   (View Single Post)  
Old 1st May 2016
rain1 rain1 is offline
New User
 
Join Date: Apr 2016
Posts: 5
Default

Thank you so much everyone, I will try it.
Reply With Quote
  #7   (View Single Post)  
Old 2nd May 2016
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 307
Default

You could also try this:
$ doas sysctl hw.allowpowerdown=1

Then:
$ doas halt -p

If your system powers-down nicely, then make it permanent by adding the following line to /etc/sysctl.conf:
Code:
hw.allowpowerdown=1
Reply With Quote
  #8   (View Single Post)  
Old 27th October 2018
hrsetrdr's Avatar
hrsetrdr hrsetrdr is offline
Port Guard
 
Join Date: Jul 2008
Posts: 11
Default

Apologies for the 'necro-thread' post, but
Code:
shutdown -p now
worked perfectly for my [new]OpenBSD 6.4 install.
Reply With Quote
  #9   (View Single Post)  
Old 28th October 2018
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
ISO Quartermaster
 
Join Date: Apr 2008
Location: NYC
Posts: 571
Default

Interestingly enough, after installing OpenBSD-6.4, shutdown -p now no longer works. hw.allowpowerdown is set to 1. It's a minor issue to me (on a multiboot laptop and not tested on multiple installs) and I suspect it's just one of those oddities.

At some point, I'll install in a few more places and see if it's just on this laptop, an old L420 Thinkpad, that also has to have acpi disbabled before it will boot.
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 set properly the email system fstef OpenBSD General 18 25th February 2015 07:32 AM
Secrets, lies and Snowden's email: why I was forced to shut down Lavabit J65nko News 1 22nd May 2014 01:08 AM
$dirmngr is not set properly nihonto NetBSD General 2 20th March 2011 07:38 PM
My keyboard is not working properly anymore in OpenBSD newbsdied OpenBSD General 2 4th November 2010 11:20 PM
/etc/rc.* files isn't read properly? mathias OpenBSD General 4 1st June 2008 06:35 PM


All times are GMT. The time now is 02:38 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