Note: The original is
here.
- Who is root?
- Root is the Superuser
- Root has ultimate authority
- Root is used to perform all administrative tasks
- YOU are root
- What is he talking about?
- Using Root
- How to be a player
Err...administrator.
- Using the root account
- That which I tell you three times is true:
- Use root only for administration,
- Use root only for administration,
- Use root only for administration!
- Why? It's too easy to do too much damage to your system.
- Try this: (no DON'T!)
rm -rf . /*
- Whoops! One extra space and now my system is dead!
- What did he say?
- Use root only for administration!!!
- A Brief Tour
- Where am I?
- Wide Open Spaces
| / | - the root |
| --> /etc | - configuration files |
| --> /usr | - user programs |
| --> /var | - log files and stuff |
| --> /proc | - system info |
| --> /tmp | - temporary files |
| --> /home | - home directories |
| --> /root | - root's home directory |
| --> ... | - some other stuff |
- Important Stuff, etc.
- /etc/passwd
- - contains user accounts
- can be edited by hand or with tools (see your distro's documentation for info on tools)
- see the man page passwd(5) for the format
- /etc/group
- contains information about the groups of users on the system
- users can be in many different groups
- primary group specified in etc/passwd
- other groups specified here
- groups allow users to share files
- /etc/fstab defines the drives you can access
- /etc/modules.conf defines kernel module configuration
- /etc/XF86Conf or etc/X11/XF86Conf is your X configuration file
- /etc/rc.d holds system startup scripts used by init and and etc/inittab
- What Happens When I Turn On My Computer?
- Get the jumper cables Gertrude!
- CLICK! Whirr...
- Boot time involves the coordinated effort of many programs
- LILO/MILO/SILO or something similar
- The Kernel
- init (the parent of all processes)
- initscripts
- boot:
- What makes the boot prompt? The boot loader.
- LILO (The LInux LOader) is used on x86 boxen.
- LILO loads the first bits of the OS from disk and starts them running
- Controlled from (you guessed it)
/etc/lilo.conf
- More Lilo
- Changes to the config file are committed by running /sbin/lilo
- The manpages and Linux HOWTOs detail its configuration
- Quick tip: configure a backup kernel bootable to take the terror out of kernel upgrades
- Now Booting The Kernel
- Lilo starts the kernel loading for us
- The kernel is the core of the operating system
- As the kernel boots, it sets up the hardware on the system, allocates memory for its own use, and starts init running.
- 'demesg' will show you the kernel's boot messages
- Controlling Daemons
- Daemons and Dragons
- Init, Father Of all Processes
- init is Process Number 1
- init's job is to start other processes running
- init's configuration file is called inittab
- init starts all of the background programs that make your system useable (login, inetd, etc.)
- Init Scripts
- The init scripts tell init what to run
- The scripts define a "runlevel"
- Runlevels are conceptual states. They define what daemons are running.
- Linux systems use 6 runlevels (numbered 1-6)
- Common Runlevels
- Common runlevels include:
- Runlevel 0: shutdown
- Runlevel 1: single user mode
- Runlevel 3: standard multiuser mode
- Runlevel 5: X Window mode
- Runlevel 6: reboot
- see the manpage for init for more details about what runlevels do
- BSD vs. SVR4
- Two forms of init scripts exist
- BSD
- SVR4 (Read that "System 5")
- BSD style init scripts are monolithic in nature (one main script
per runlevel)
- SVR4 scripts use many small scripts, each responsible for its
own little part
- SVR4 Style is now most common on Linux
- BSD Layout
- BSD scripts live in the directory /etc/rc.d
- They are typically named rc#.d (where # is the runlevel)
- They contain all the commands to put a system in a given runlevel,
but may call other scripts
- Slackware uses this style
- SVR4 Style
- SRVR4 style has all of its scripts living in /etc/rc.d as well
- The main scripts all live in a subdirectory called init.d
- These scripts know how to start and stop one specific daemon
- Subdirectories called rc#.d contain links to the scripts as needed for that runlevel.
- A Map of SVR4 Init Scripts
- /etc
- --> /rc.d
- --> rc.sysinit (system startup)
- --> rc (the main init script)
- --> rc.local (miscellaneous)
- --> init.d - thar be scripts here
- --> rc#.d - thar be symbolic links here
- Script Startup
The scripts in /etc/rc.d/init.d take four possible parameters
- start: starts the job
- stop: stops the job
- status: reports on the job's status (running or not)
- restart: restarts the job
Hint: You can start these manually! Try:
/etc/rc.d/init.d/httpd restart
- Scripts Mapped to Runlevels
- We map the scripts to runlevels through directories named rc#.d
(where # is a number)
- We create a symbolic link (like a Macintosh alias or a Windows
shortcut) to the script called S##name and/or K##name in the appropriate directory.
- The number determines the order in which things happen, lowest first.
- Boot Process
- The script /etc/rc.d/rc.sysinit starts up the system. This mounts
filesystems, etc.
- /etc/rc/rc.d/rc looks in the directory for the desired runlevel for scripts
called S##name, and runs them all with the "start" parameter.
- /etc/rc/rc.d/rc.local is called
- Changing runlevels
- We can change the runlevel of the system. Try: "init <runlevel>"
- First we stop the stuff in the current runlevel. All of the K##name scripts
are executed with the "stop" paremeter.
- All of the things to start in the new runlevel are started just like with the boot process.
- /etc/rc/rc.d/rc.local is run
- Special Runlevel Changes
- When we call "shutdown -r now" we're really just changing to runlevel 6.
- Calling "halt" is really just switching to runlevel 0.
- Calling "shutdown now" or saying "init 1" is puts us in single user mode.
- We're at a root prompt.
- Almost no daemons are running.
- Good for maintenance.
- Confused Yet?
- There are several good tools to help you out (and once you get the hang of it you'll really like it)
- Red Hat comes with 'tksysv' which gives you a nice interface to everything (in X)
- Other good ones exist. Look on Fresh Meat.
- Quickly: X
- You are in a maze of twisty passages all different.
- A Brief Map
- X provides the windowing system for your machine
- X is a pain in the ass to configure
- X's configuration file is /etc/XF86Conf or etc/X11/XF86Conf
- X lives in /usr/X11R6
- You run an X server which must support your card
- Configuring The Bugger
- An X configuration tool is provided by most distributions; see
your documentation.
- For common hardware, this can make things go very smoothly
- 'XF86Setup' comes with X and provides a text-based, question and
answer style setup tool
- It Won't Work
- If you get stuck, check the documentation on http://www.xfree86.org
- Read the HOWTO (more on that in a second)
- Ask someone on the Plug mailing list
- Getting Help
- Help! Help! I'm being repressed!
- Quick Links
- Join the Plug Mailing list, instructions on the page http://expert.cc.purdue.edu/~plug/
- The Linux Documentation Project
- Freshmeat
- Slashdot
- Unix Review's Performance Computing
- Don't forget the 'man' pages and info manuals
- Slide 38: Questions?
That's All Folks! (-: