If you're as comfortable with NetWare services as you are in your favorite old jeans, I've got good (albeit old) news for you: the NetWare services you've grown to know and love are also available on Novell Open Enterprise Server for Linux. The arguably better news is that getting and keeping Open Enterprise Server for Linux up and running is easier than you might think.
This article is the second in a nine-part series designed to help you bridge your NetWare skills to Open Enterprise Server for Linux. Like the Novell training program upon which it is based, this series seeks to demystify the process of deploying and managing Open Enterprise Server for Linux. (See novell.com/products/openenterpriseserver/migrate.html.)
Last month's article launched this series with a brief history of Linux, an explanation of open source and a discussion of the Novell-Linux relationship. (See novell.com/connectionmagazine/2006/01/tech_talk_2.html.) This article continues to increase your Linux comfort level by introducing these fundamentals:
- Understanding runlevels
- Logging in and out
- Using the Linux desktop
- Using the Linux shell
- Understanding and viewing processes
- Shutting down and restarting the server
> Run Linux, Run!
After you power on your server, Linux runs through a seven-step boot process. (See This Boot Was Made for Running.) In the final step, /sbin/init executes the default runlevel for the system.
A runlevel defines a set of running services for a particular system state. For example, the default runlevel for a server is typically runlevel 3, which defines the set of services required for a multi-user system with full network functionality.
Linux offers seven runlevels, which you can switch between without having to shut down or reboot your system:
1 Single-user login
2 Multi-user login without network connection
3 Multi-user login with network connection
4 Not defined
5 Multi-user login with network connection and X server
> In and Out
After your system boots, you'll see a login dialog in either a graphical or command-line interface, depending on how you've configured Novell Linux Desktop.
Included with Open Enterprise Server for Linux, Novell Linux Desktop packs Novell products and services atop your choice of either GNOME or K Desktop Environment (KDE). In this series, you'll read about KDE.
From the KDE graphical login manager, you'll find no surprises. Here you simply type your username and password in the appropriate fields. For example, you might type the root or admin username and enter the appropriate password.
If you prefer, you can quit the graphical login manager and log in using a command-line interface from any one of six virtual (text) consoles. To access a virtual console from the graphical login manager, press Ctrl+Alt+Fx (x represents a number 1 through 6, for example, F1 is the first console, F2 is the second.)
Logging in from a command prompt is straightforward: at the prompt, type in your username, press Enter; type in your password, press Enter again, and voila: a command prompt now awaits your input. You can log in from any one of the consoles and switch between them by pressing Alt+Fx. (To return to the graphical login manager, press Ctrl+Alt+F7.)
To log out from a virtual console, type exit. To log out from the graphical interface, right-click on the desktop and select Logout username from the menu.
> Familiar Look and Feel
Like the login dialogs, the desktop should look and feel familiar to you. (See Figure 1.) It has three main components:
- control panel, also called the "kicker"
- desktop icons
- desktop itself
> The Kicker Is . . .
The kicker runs across the bottom of the desktop (See Figure 1) and displays several items (from right to left):
- the clock
- the system tray, which displays mini programs such as the clipboard
- the taskbar, which displays any open applications
- numbered buttons that enable you to switch between virtual desktops
- various icons, including:
- icons you click to open programs such as the Kmail client, the Konqueror browser, and the SUSE HelpCenter
- a terminal window, for one-click access to a command prompt
- a house icon, for easy access to your Home directory
- the Novell icon, to view the KDE Menu (See Figure 2).
> One Click Away From . . .
Several icons are included on the desktop:
- My Computer
- Novell and SUSE Linux icons (to access these Web sites)
- YaST (the SUSE Linux administrative utility)
These icons function as you'd expect them to, with maybe one exception: by default, they require only one click to launch their programs and services.
You can add desktop icons by either dragging entries from the KDE Menu to the desktop or right-clicking the desktop and selecting Create New.
> The Right-Click Way To . . .
Right-clicking the desktop opens a list of desktop configuration tools and tasks. This list enables you to easily complete tasks, such as creating new files and folders, locking the screen, logging out and cascading or uncluttering windows.
> Bourne Again
The default command-line interpreter for Linux is Bash, that is, Bourne Again SHell (named after Bourne, one of the original UNIX shells). Bash is also a programming language used to write scripts that automate tasks.
At the command line, the order you enter operatives is different than you might expect. In Linux, you enter the command, then options or switches, followed by parameters. For example, the command ls —l /etc displays a list of the contents of the /etc directory with added information.
You access the command prompt by logging in to a virtual console or from within the GUI by selecting the terminal program icon from the kicker. (This icon looks like a monitor with a sea shell on it. See Figure 1.)
Bash has several features that make it easier to use, including these:
- From the command prompt, type a few letters of a command or a directory path, and press Tab once (or twice) to complete the command (or path) or get a list of possible commands (or paths).
- From the command prompt, type history, then use the Up and Down Arrows to view commands in cache.
- Use the arrow keys to highlight the command in cache th't you'd like to execute, and press Enter.
- Type a few letters and use Page Up and Down to find the commands you've typed that start with those letters.
When a program starts on Linux, the kernel creates a process, and to each process the kernel assigns a Process ID, or PID. Several commands enable you to control the behavior of processes to varying degrees. Logged in as root, you can use these commands to manipulate any process. Other users can manipulate only their own processes.
To view the status of a process, use the ps command, which displays the processes (and their PIDs) connected to your terminal. If you're logged in as root and you want to see all processes connected to a terminal, use the ps a command.
The kill command stops a process (based on its PID) using one of several signals. If you use kill without specifying a signal (for example, kill 1234), the kernel sends the process signal 15, SIGTERM. SIGTERM instructs the process to finish what its doing and then stop; it's a tidy way to stop a process.
When a process is misbehaving and you need it to stop immediately, use signal 9, SIGKILL (kill -9 1234.) SIGKILL can be a little messy (potentially leaving open a file or two), so use it only in cases of emergency. To view a list of all available kill signals, use kill -l.
Various commands enable you to manipulate process priority levels, ranging from the lowest priority, 19, to the highest priority, -20. While it may seem counter intuitive to assign low-priority processes high numbers and high-priority processes low numbers, think of it this way: the higher the number, the nicer the process—and nice processes let other processes go first. (See Figure 3.)
The nice command enables you to specify just how nice you want a process to be when you start it. By default, nice assigns priority 10. Thus, typing nice prgm starts prgm with a priority of 10. To specify a different priority, type nice, the priority level, then the process (nice -10 prgm). Only root can start processes with a priority higher than -10.
You can run more than one command at a time. If you'd like to enter a new command when a different command is already running, press Ctrl+Z to pause the current command. Next, type bg to run this command in the background. Now you can enter a new command. To move a background command to the foreground, use fg. (See Table 1, Command Cheat Sheet.)
> Shutting Down
From the command line, you have several options for shutting down properly: shutdown —h now, halt, and init 0. To reboot, you have an equal number of options: shutdown —r now, reboot, and init 6.
Unlike the Windows world, Linux does not typically recognize Ctrl+Alt+Del as a shut down or reboot option; however, you can configure (or disable) this key combination in /etc/inittab.
> Moving On
When you take the training course on which this series is based, you'll be expected to complete several exercises at this piont. Each exercise offers the opportunity to practice the Linux fundamentals about which you've just read, from booting the system to shutting it down. Additionally, you'll be given the opportunity to locate and navigate many Linux help resources. (See Table 2, Help!)
In the next article, you'll learn about the features and installation of Novell Open Enterprise Server for Linux.