CentOS 6 Linux Server Cookbook
上QQ阅读APP看书,第一时间看更新

Finishing the installation process with Firstboot

In this recipe we will learn how to finalize the installation process by enabling Firstboot, a simple application that enables you to manage the first-time installation of your server in a slightly less complicated way.

Firstboot can function in both the console and desktop environments and its intention is to activate the Setup agent. It has a single purpose that is often considered to be an optional extra, it isn't always going to be necessary, but for beginners and experienced users alike, it does provide instant access to a tried and tested process that will enable you to finalize the installation of any CentOS server in a fast and efficient manner.

Getting ready

To complete this recipe, you will require a minimal installation of the CentOS 6 operating system with root privileges and a connection to the Internet in order to facilitate the download of additional packages.

How to do it...

On a minimal installation Firstboot is not installed by default and for this reason we will begin this recipe by installing the necessary package and its related dependencies.

  1. To do this, log in as root and type the following command:
    yum –y install firstboot
    
  2. When the installation is finished, simply enable the package to run at boot by typing the following command:
    chkconfig firstboot on
    
  3. At a convenient time, simply reboot the system to access Firstboot by typing:
    reboot
    
  4. On a successful reboot, you will be presented with the Firstboot application. To begin, simply use the Up and Down arrow keys in conjunction with the Tab key to jump between the elements on the screen. Make the appropriate changes to your system and use the Return key to confirm your choices. On certain screens you are given the opportunity to use the Space bar in order to nominate or activate a particular setting. Choose Quit to exit Firstboot at any time.
  5. Having quit Firstboot, you will be invited to access your server in the usual way but remember, any permanent changes to your security settings may not take effect until you reboot your server. So if this is the case, return to your console and type:
    reboot
    

How it works...

Firstboot is a simple package with the sole purpose of activating the Setup agent. It is not intended to be complicated and for this reason you probably found that it was both easy to install and even easier to activate.

So what did we learn from this experience?

We start the recipe by installing the necessary packages. In this case, the target package was called Firstboot and so we issued the following command to the server:

yum –y install firstboot

The system then proceeded to install a number of different dependencies that includes many setup utilities, but as Firstboot runs as a service, to access these utilities you should ensure that the service is running. So our next step was to return to the console and type:

chkconfig firstboot on

Note

If you prefer to ensure that Firstboot will only launch with the desktop environment, simply modify the preceding command to read as follows:

chkconfig --level 5 firstboot on

Having done this, we then proceeded to reboot the system like so:

reboot

On a successful reboot, you are then invited to run the various tools associated with this service. Of course, a discussion regarding the actual settings you should employ is a subject we will return to later on in this book, but having successfully completed this recipe you now understand that this small addition does have specific uses that serve to simplify the process of finalizing the installation of any CentOS server.

On a console-based server, the act of running Firstboot will enable you to run a screen by screen setup process that covers the main aspects of a first-time installation. For experienced users, this can prove to be a welcome reminder, but for new users Firstboot can prove to be a useful introduction to CentOS by offering a one-stop, tried and tested starting point. It may not be a necessary feature, but this small tool does go some way to make CentOS a very easy experience.

There's more...

As the name implies, Firstboot will only run once. However, should you ever wish to return to this screen in the future, simply log in to your server as the root user and ensure the service is set to run at boot by typing:

chkconfig firstboot on

Now remove the following file by typing:

rm /etc/sysconfig/firstboot

You will be asked if removing this file is intended, so type y (yes) and press the Return key to confirm your decision like so:

rm: remove regular file 'etc/sysconfig/firstboot' ? y

Having done this Firstboot is now active and will be ready to run on your next reboot.