BNR2 Linux Shutdown Options
===========================

This quote says it all.

"[Linux] was not made to be shut down, but if you really 
must, use the shutdown command."

The following describes how the Linux BNR2 version applies 
the Options Shutdown tab features.

Shutdown Method
===============
Exit (closes BNR2)

Logoff (logs off current user)
  [Windows]
  Shuts down all the processes that belong to the user 
  then logs the user off.
  [Linux]
  Executes the following command: Exit (closes BNR2)
  I have not found a way to logoff the current user.

Shutdown (shuts down OS)
  [Windows]
  Shuts down the system to the "It's now safe to turn 
  off your computer" screen.
  [Linux]
  Executes the following command: 'sudo /sbin/halt'
  Wait for the messages to end with 'System halted.' 
  then you can press the power button.

Reboot (shuts down OS and reboots computer)
  [Windows]
  Shuts down and then restarts the system.
  [Linux]
  Executes the following command: 'sudo /sbin/shutdown -r now'
  Shuts down and then restarts the system.

Poweroff (shuts down OS and powers off computer)
  [Windows]
  Shuts down the system and turns off the power if this is 
  supported.
  [Linux]
  Executes the following command: 'sudo /sbin/shutdown -h now'
  Shuts down the system and turns off the power if this is 
  supported.


To use the Shutdown, Reboot or Poweroff features you will 
need to make changes to your 'sudoers' file. The 'sudo' 
and 'visudo' commands also have to be on your system.


The SUDO Command.

sudo allows a permitted user to execute a command as the 
superuser or another user, as specified in the sudoers file. 
sudo determines who is an authorized user by consulting the 
file '/etc/sudoers'.


The VISUDO Command.

You use "visudo" to edit the sudoers file. There are two 
reasons for that - it prevents two users from editing the 
file at the same time, and it also provides limited syntax 
checking. Even if you are the only root user, you need the 
syntax checking, so use "visudo".


The SUDOERS File.

There probably are as many ways to apply changes to the 
'sudoers' file to allow the BNR2 Linux users to utilize 
the 'shutdown' command as there are Linux users. I will 
describe two of them.

The first one allows the named user to run all commands 
with no password. This is not the best solution. Just 
below root in the sudoers file you would add the line 
beginning with user. Change 'user' to your 'username'.

# User privilege specification
root	      ALL=(ALL) ALL
user        ALL=(ALL) NOPASSWD: ALL


Another way is to allow BNR2 users to run only the 
'shutdown' and 'halt' commands.

The following is my sample 'sudoers' file. Lines beginning 
with the '#' are comments. The only default line is the 
line beginning with root. Replace the user with your username.


# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a 
# sudoers file.
#

# Host alias specification

# User alias specification
User_Alias  BNR2RS = user

# Cmnd alias specification
Cmnd_Alias  SHUTDOWN = /sbin/shutdown, /sbin/halt

# Defaults specification

# User privilege specification
root	      ALL=(ALL) ALL
BNR2RS        ALL = NOPASSWD: SHUTDOWN

# Uncomment to allow people in group wheel to run all commands
# %wheel      ALL=(ALL)	ALL

# Same thing without a password
# %wheel      ALL=(ALL)	NOPASSWD: ALL

# Samples
# %users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users  localhost=/sbin/shutdown -h now


Here is how to edit the 'sudoers' file using 'visudo' command 
which is required.

Log in as root.

Now, ENTER the command visudo.
      
[root@localhost root]# visudo

Now move the cursor with the arrow keys and place it on the 
# on the line '# User alias specification'.

type  o

That is a lowercase "o". You are now in the insert mode that 
will allow you to make the changes. When you have finished 
making your changes hit the escape key.

type [ESC]

The :w will write the file. Notice you are now at the bottom 
of the page.

type :w [ENTER]

When you enter the :q and hit the return key the file is saved 
and you exit the file.

type :q [ENTER]

:q! will quit without saving the file.

That is it. Login as a normal user. Now BNR2 will halt, shutdown, 
or poweroff your system.
