# Problem shutting down



## dennylin93 (Dec 17, 2008)

I just installed FreeBSD, and it doesn't shutdown properly. Whenever I enter "shutdown now", the system runs and "Enter full pathname of shell or RETURN for /bin/sh" appears. Is there a way to fix this? It doesn't appear when I enter "reboot" though.


----------



## DutchDaemon (Dec 17, 2008)

Use shutdown -p now.


----------



## sverreh (Dec 17, 2008)

I'm not sure, but maybe it helps to use the *-h* option (and possibly also *-o*)?

Oh, yes: and if your hardware supports it, do as DutchDaemon and SeanC propose: 
*-p*


----------



## SeanC (Dec 17, 2008)

Use *-p *or *-h* option. 

http://www.freebsd.org/cgi/man.cgi?query=shutdown&manpath=FreeBSD+7.0-RELEASE


----------



## dennylin93 (Dec 17, 2008)

Thanks. "shutdown -p now" works.


----------



## SirDice (Dec 18, 2008)

"Shutdown now" actually switches the machine to single user mode. Hence the prompt for a shell.


----------



## SeanC (Dec 18, 2008)

SirDice said:
			
		

> "Shutdown now" actually switches the machine to single user mode. Hence the prompt for a shell.



Really? I didn't know that. Is it documented somewhere?


----------



## DutchDaemon (Dec 18, 2008)

Not really clearly ... tucked away in shutdown(8), and not really referring to command-line options


```
Corresponding signal is then sent to init(8) to respectively halt, reboot or bring the system down to single-user state (depending on the above options).
```

The absence of options (i.e. a single 'shutdown') is not discussed.


----------



## lme@ (Dec 19, 2008)

It is documented here:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/book.html#BOOT-SINGLEUSER


----------



## DutchDaemon (Dec 19, 2008)

Should find its way into the man page, really ..


----------



## lme@ (Dec 19, 2008)

DutchDaemon said:
			
		

> Should find its way into the man page, really ..



Please file a PR for this.


----------



## DutchDaemon (Dec 19, 2008)

Actually did 

P.S.: update Dec 23: the requested explanation about omitting command-line switches has been added to man 8 shutdown.


----------



## bsddaemon (Dec 19, 2008)

lme@ said:
			
		

> It is documented here:
> http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/book.html#BOOT-SINGLEUSER



Im just wondering, if the console marked as *insecure*, in case I forgot root password, how can I recover then?

In */etc/ttys* file:

```
console none                            unknown off insecure
```


----------



## lme@ (Dec 20, 2008)

bsddaemon said:
			
		

> Im just wondering, if the console marked as *insecure*, in case I forgot root password, how can I recover then?
> 
> In */etc/ttys* file:
> 
> ...



Then you need to boot with a liveCD and set a new password.


----------



## DutchDaemon (Apr 1, 2009)

shutdown(8) with proper explanation of 'shutdown now' has been MFC'd to FreeBSD6 and FreeBSD7.
http://svn.freebsd.org/viewvc/base?view=revision&revision=190605


----------



## tangram (Apr 1, 2009)

Though not directly connected to the post...

If your are lazy add a nice alias for poweroff.

For csh/tcsh shell add this to your .cshrc file and source it:

```
alias poweroff  'shutdown -p now'
```

To source it:

```
source ~/.cshrc
```

To all users to shutdown add them to the operator group:

```
pw groupmod operator -m username
```


----------

