# Can't shutdown FreeBSD without hitting power button



## triplesquarednine (Aug 13, 2009)

hello,

i installed FreeBSD a few days ago, and so far i am enjoying using unix, although the learning curve can be a bit hard.
when i go to shutdown my system it fails to do so...

i have tried shutting down when i am loggin in. it tells me in 60seconds the system will shutdown, but then it does not.
so i have tried logging out to shutdown, and it gives me an error message says it has failed to shutdown...

so i am wondering if anyone else has encountered this problem and could provide insight...

i am running it on my Dell inspiron 6400...
intel core 2 duo 1.6
120g drive
ati x1300
etc...

the OS runs great aside from that, handles my CPU, RAM, etc for better than Linux...

i am posting this question now, as i am going to be building my own kernel, so that i can get my sound and wireless up and running, so if there is something i need to include or not include to fix my shutdown issue,
i would like to know before hand...

i have read thru the manuals and haven't found any help

thanx in advance for any help or ideas...


----------



## Free (Aug 13, 2009)

shutdown -p now

If it faill's what it says ?


----------



## triplesquarednine (Aug 14, 2009)

hey thanx alot, that seems to do the trick...

i guess gnome just can't shutdown using the gui, 
and instead i need to use a terminal everytime.
(which isn't a big deal to me).

my whole problem, as you can imagine, is that by hitting
my power switch i am risking data loss/corruptions.

shutdown -p now works fine and is quick...

quick question - is that harmful to my system???


----------



## epoxy (Aug 14, 2009)

triplesquarednine said:
			
		

> hey thanx alot, that seems to do the trick...
> 
> i guess gnome just can't shutdown using the gui,
> and instead i need to use a terminal everytime.
> ...




shutdown -p now shouldn't harm your system.

Also, are you using GDM or have a login manager in /etc/ttys ? If you load X that way, you will then have Restart/Shutdown/etc buttons (that work!) in the Gnome menu.


----------



## CodeBlock (Aug 14, 2009)

epoxy said:
			
		

> shutdown -p now shouldn't harm your system.
> 
> Also, are you using GDM or have a login manager in /etc/ttys ? If you load X that way, you will then have Restart/Shutdown/etc buttons (that work!) in the Gnome menu.



Just to throw in my two cents and elaborate a little, the reason (at least how I understand it from my Linux years), is that with GDM, etc, xorg runs as root, and so has the power to turn the machine off. If you run `startx` to run xorg as your user, it's the same as doing trying a `shutdown` without root privileges (won't work).


----------



## ale (Aug 14, 2009)

What adding your user to the operator group?


----------



## SirDice (Aug 14, 2009)

CodeBlock said:
			
		

> Just to throw in my two cents and elaborate a little, the reason (at least how I understand it from my Linux years), is that with GDM, etc, xorg runs as root, and so has the power to turn the machine off. If you run `startx` to run xorg as your user, it's the same as doing trying a `shutdown` without root privileges (won't work).



It has more to do with HAL these days. If you start Gnome using GDM PolicyKit/ConsoleKit will get properly loaded. It's this that makes sure you can do things like the administrative preferences and shutdown/reboot the machine.


----------



## DutchDaemon (Aug 14, 2009)

Have a look at /usr/local/etc/PolicyKit/PolicyKit.conf, PolicyKit(8), PolicyKit.conf(5). 

The links don't seem to work 

You can also try:

[cmd=]man /usr/local/man/man5/PolicyKit.conf.5.gz
man /usr/local/man/man8/PolicyKit.8.gz[/cmd]


----------



## triplesquarednine (Aug 16, 2009)

epoxy said:
			
		

> shutdown -p now shouldn't harm your system.
> 
> Also, are you using GDM or have a login manager in /etc/ttys ? If you load X that way, you will then have Restart/Shutdown/etc buttons (that work!) in the Gnome menu.



which way will give proper shutdown?? the latter?

i use GDM on startup...

doesn't work


----------



## triplesquarednine (Aug 16, 2009)

i took a look at Policy.conf, here it is:


```
<config version="0.1">
    <match user="root">
        <return result="yes"/>
    </match>
    <define_admin_auth group="wheel"/>
</config>
```

it doesn't seem to work logged in as root or user, and my user is apart of the "wheel" group ----> 


```
----->         <define_admin_auth group="wheel"/>
```

seems like this indicates i should be able to edit it even under user...

i had an issue with gconf, stating something about NFS-lockfiles,
i wonder if the two issues correspond being as gconf is for gnome.
i was frustrated and re-installed freeBSD, in the hopes that maybe my first install was bad, and now it maybe fixed.

i need to reproduce the error message, i am thinking it may be, in part, the problem as it has to do with gnome's configuration..

hmm...

i don't know...


----------



## triplesquarednine (Aug 16, 2009)

SirDice said:
			
		

> It has more to do with HAL these days. If you start Gnome using GDM PolicyKit/ConsoleKit will get properly loaded. It's this that makes sure you can do things like the administrative preferences and shutdown/reboot the machine.




i definetly am using GDM for gnome....

i have tried a few things and still no luck 

let me know if you have any ideas, i see you are a senior member and i am sure you have seen your share of issues pop up...also read my post in this thread about gconf and nfs-lockfiles.(maybe they are linked?)

but that's a guess on my part..


----------



## triplesquarednine (Aug 16, 2009)

ale said:
			
		

> What adding your user to the operator group?




can you explain to me what the Operator group is, and how to
and myself to the group...i would need to do this from the command line(of course, since i cannot change it thru gnome).

thnx


----------



## ale (Aug 16, 2009)

`# pw usermod $USERNAME -G operator` replacing $USERNAME with your username


----------



## Beastie (Aug 16, 2009)

Have you read the HAL FAQ, especially part 3 "How do I mount media using hal?" step 2, which can be applied for reboot/shutdown. E.g.:

```
<match action="org.freedesktop.hal.power-management.shutdown">
  <match user="triplesquarednine">
    <return result="yes"/>
  </match>
</match>
```


----------



## triplesquarednine (Aug 16, 2009)

hey, thanks alot. that was usefel(and i got to know some new commands!).


----------



## triplesquarednine (Aug 16, 2009)

i had skimmed thru it, however my gnome configuration
was a bit screwed up. there was a conflict. after re-installing,
i was using 7.2 am now using 8.0-BETA2... and understanding some of the BSD config's(instead of the linux one's im used to)

i can now happily say, i can shutdown! restart sort of works,
it doesn't actually reboot - instead it exits gnome. which is fine. OSX on this dell laptop doesn't restart either so i am happy!

THANK YOU EVERYBODY FOR YOUR HELP AND INSIGHTS

AWESOMENESS - and i love FreeBSD!!


----------



## Beastie (Aug 16, 2009)

triplesquarednine said:
			
		

> it doesn't actually reboot - instead it exits gnome. which is fine.


What you're describing is logout not restart/reboot. Doesn't GNOME have both? Xfce for instance has the three (and more).
Did you add an *org.freedesktop.hal.power-management.reboot* action to /usr/local/etc/PolicyKit/PolicyKit.conf too?


----------



## triplesquarednine (Aug 16, 2009)

Beastie said:
			
		

> What you're describing is logout not restart/reboot. Doesn't GNOME have both? Xfce for instance has the three (and more).
> Did you add an *org.freedesktop.hal.power-management.reboot* action to /usr/local/etc/PolicyKit/PolicyKit.conf too?




yes, i have all 3, plus suspend and hibernate...

when i said restart doesn't reboot that is what i meant.
Xfce is a whole different story then gnome. it would be my next choice, though... im not a big KDE fan, too windows like.

i will probably adjust my Hal config(although, gnome is supposed to do that for me, by default). but right now i am more concerned with getting software setup and exploiting my GFXcard as best as possible...


----------



## floppytilleyhat (Sep 6, 2009)

Have you checked to make sure /proc is mounted in /etc/fstab.  I had the same problem and that alone made a world of difference. (Apparently HAL uses it.)


----------



## zeiz (Sep 6, 2009)

that's right. 
with Gnome it must be the line in /etc/fstab:


```
proc   /proc   procfs    rw   0  0
```

without this no way to reboot or shut down and even gdm's login
doesn't show your user, only "Others".
While PolicyKit.conf helps in mounting with hal.


----------

