Reader small image

You're reading from  Webmin Administrator's Cookbook

Product typeBook
Published inMar 2014
Reading LevelIntermediate
Publisher
ISBN-139781849515849
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Michal Karzynski
Michal Karzynski
author image
Michal Karzynski

Michał Karzyński, with a scientific research background in the areas of molecular biology and bioinformatics, has been running Unix-like operating systems since 2002. He works as a web application developer, programming in dynamic languages such as JavaScript, Python, Perl, and PHP. He specializes in designing programming interfaces between servers and client applications based on the HTTP protocol. He has been using Webmin for over five years to assist in setting up and managing servers. He is currently employed as a project manager at the Gdańsk University of Technology in Poland. His blog can be found at http://michal.karzynski.pl.
Read more about Michal Karzynski

Right arrow

Controlling which system services are started at boot


During the boot process, your operating system should load all services that will be running in the background on your machine. This includes database servers, web servers, tools such as Webmin, and other system processes. Server distributions are very lean by default, so they will only start a handful of essential services. Webmin allows you to control which of these scripts is executed through the Bootup and Shutdown module.

How to do it...

Perform the following steps to check which system services are started at boot:

  1. Navigate to System | Bootup and Shutdown.

  2. Select a service to disable temporarily. If your system has the avahi daemon or the rsync service, these can probably be disabled for a minute without causing trouble. Consider the following screenshot:

  3. Mark the checkbox next to one of these services and click the Disable Now and On Boot button. You will see a screen notifying you that the service was stopped and disabled from starting at the next boot.

  4. Go back to the Bootup and Shutdown screen, select the same service again, and click the Start Now and On Boot button to revert your previous change.

How it works...

When your OS starts, it first loads the system kernel and then starts a process called init (short for initialization), which executes various init scripts that start system services. Under Linux, these scripts are stored in one directory (/etc/init.d) and activated by the creation of symbolic links to them in a special directory from which all scripts are executed at boot time. Webmin allows you to control which init scripts are executed by creating or removing these symbolic links or performing other activation functions specific to your system.

The init system described earlier is often referred to as SysV-style init. It's named after the historic UNIX System V that inspired all modern Unix-like operating systems, including Linux and BSD. Many distributions are gradually switching over to more modern alternatives such as Upstart and Systemd. The details of how these systems differ from SysV-init are beyond the scope of this book, but Webmin tries to provide a common interface to all of them. Screenshots in this recipe may differ slightly depending on which init system your distribution uses.

There's more...

Webmin also allows you to easily create your own init scripts and verify that a started service is actually running.

Creating a custom init script

Most server packages you install will come with their own init scripts and activate them in your init system. If you install a package that doesn't, you can use Webmin to create a simple init script for you.

Navigate to System | Bootup and Shutdown and click the Create a new bootup and shutdown action link.

Note

Depending on the init system you're using, this link may also be named Create a new action, Create a new upstart service, Create a new systemd service, and so on.

You will be asked to specify the name and description of the startup item as well as two commands: one for starting the service and one for shutting it down. Once you fill these out, click Create and Webmin will automatically create a basic init script for you.

Inspecting active processes

Even if a service is successfully started during boot, it could potentially crash. To inspect which services are actually running, go to System | Running Processes. There, you will see a tree of processes sorted in the order in which another process has started them. You can also sort processes by owner or the amount of CPU or RAM they are consuming. Consider the following screenshot:

Click on a process ID for one of Webmin's processes to get more information about it, including those files or network connections the process still has open.

Previous PageNext Page
You have been reading a chapter from
Webmin Administrator's Cookbook
Published in: Mar 2014Publisher: ISBN-13: 9781849515849
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Michal Karzynski

Michał Karzyński, with a scientific research background in the areas of molecular biology and bioinformatics, has been running Unix-like operating systems since 2002. He works as a web application developer, programming in dynamic languages such as JavaScript, Python, Perl, and PHP. He specializes in designing programming interfaces between servers and client applications based on the HTTP protocol. He has been using Webmin for over five years to assist in setting up and managing servers. He is currently employed as a project manager at the Gdańsk University of Technology in Poland. His blog can be found at http://michal.karzynski.pl.
Read more about Michal Karzynski