What Linux Does

What Linux Does

On any operating system, a core set of tasks is performed. On multi-user or server systems such as Linux, these tasks include adding and configuring printers, adding and administering users, and adding new hardware to the system. Each of these tasks could take up an entire chapter in this book. In fact, I do cover all of these, and many others, in a fair bit of detail later on.

I think it’s important to briefly cover all of the basic tasks that an administrator needs to perform in one place. There are a couple of reasons for this. First, many administrators of Linux systems are not only novice administrators, they are novice users. They get into the position as they are the only ones in the company or department with computer experience. (They’ve worked with DOS before.) Second, by introducing the varied aspects of system administration here, I hope to lay the foundation for later chapters. If you are not familar with this issue, you may have trouble later.

Keep in mind that depending on what packages are installed, any Linux distribution can do a lot more. Here we will be discussing just the basic administrative functions.

The average user may not want to get into the details that the later chapters provide. So here I give an overview of the more important components. Hopefully, this will give you a better understanding of what goes into an operating system as well as just how complex the job is that your system administrator does.

The first job of a system administrator is to add users to the system. Access is gained to the system only through user accounts. Although it may be all that a normal user is aware of, these accounts consist of substantially more than just a name and password. Each user must also be assigned one of the shells, a home directory, and a set of privileges to access system resources.

Although the system administrator could create a single user account for all users to use to log in, it ends up creating more problems than it solves. Each user has his/her own password and home directory. If there were a single user, everyone’s files would be stored in the same place and everyone would have access to everyone else’s data. This may be fine in certain circumstances, but not in most.

Users are normally added to the system through the adduser command. Here, when adding a user, you can input that user’s default shell, his/her home directory as well as his/her access privileges.

Another very common function is the addition and configuration of system printers. This includes determining what physical connection the printer has to the system (e.g. parallel cable, USB, network), what characteristics the printer has (to choose the appropriate model printer) as well as making the printer available for printing. Generically, all the files and programs that are used to access and manage printers are called the print spool, although not all of them are in the spool directory.

Adding a printer can be accomplished like in many UNIX dialects: you do it manually with the primary configuration file, /etc/printcap file. The printcap man-page lists all the capabilities that your version of Linux supports. You must also add the appropriate directory and enable printing on the port. We’ll get into more detail about it as we move on.

Most newer Linux distributions support the Common Unix Printing System (CUPS). This provides a graphical interface (via web browser) to the printer configuration and makes the necessary changes when you add, modify or remove a printer.

What happens when you want to remove a file and inadvertently end up removing the wrong one (or maybe more than one)? If you are like me with my first computer, you’re in big trouble. The files are gone, never to show up again. I learned the hard way about the need to do backups. If you have a good system administrator, he/she has probably already learned the lesson and makes regular backups of your system.

There are several ways of making backups and several different utilities for doing them. Which program to use and how often to make backups completely depends on the circumstances. The system administrator needs to take into account things like how much data needs to be backed up, how often the data are changed, how much can be lost, and even how much will fit on the backup media.

There are tasks that an administrator may need to perform at regular intervals, such as backups, cleaning up temporary directories, or calling up remote sites to check for incoming mail. The system administrator could have a checklist of these things and a timer that goes off once a day or every hour to remind him/her of these chores, which he/she then executes manually.

Fortunately, performing regular tasks can be automated. One basic utility in every UNIX version is cron. Cron (the “o” is short) is a program that sits in the background and waits for specific times. When these times are reached, it starts pre-defined programs to accomplish various, arbitrarily defined tasks. These tasks can be set to run at intervals ranging from once a minute to once a year, depending on the needs of the system administrator.

Cron “jobs” (as they are called) are grouped together into files, called cron tables, or crontabs for short. There are several that are created by default on your system and many users and even system administrators can go quite a long time before they notice them. These monitor certain aspects of system activity, clean up temporary files, and even check to see if you have UUCP jobs that need to be sent.

What about a program that you only want to run one time at a specific time and then never again? Linux provides a mechanism: at. Like cron, at will run a job at a specific time, but once it has completed, the job is never run again.

A third command that relates to cron and at, the batch command, differs from the other two in that batch runs the job you submit whenever it has time; that is, when the system load permits.

Linux supports the idea of virtual consoles (VCs), like SCO. With this, the system console (the keyboard and monitor attached to the computer itself) can work like multiple terminals. By default, the system is configured with at least four VCs that you switch between by pressing the ALT key and one of the function keys F1-F6. Note that this is in addition to any graphical login you might have.

Normally, you will only find the first six VCs active. Also, if you are using the X Windowing System, it normally starts up on VC 7. To switch from the X-Windows screen to one of the virtual consoles, you need to press CTRL-ALT plus the appropriate function key.

Keeping the data on your system safe is another important task for the system administrator. Linux provides a couple of useful tools for this: tar and cpio. Each has its own advantages and disadvantages. Check out the details on the respective man-page.