Sie sind auf Seite 1von 96

Lecture 5: Unix Startup

Configuration

Asoc. Prof. Guntis Barzdins


Asist. Girts Folkmanis
University of Latvia
Oct 22, 2004
Essential Admin Tasks

 Adding and Removing  Monitoring the System


Users  Troubleshooting
 Adding and Removing  Maintaining Local
Hardware Documentation
 Configuring the system  Auditing Security
 Performing Backups  Helping Users
 Installing New Software
Summary

 Kernel options
 Kernel re-compilation
 Dynamically loadable modules
 Kernel configuration files
 Startup files
 BSD model
 System V model
 Daemons
 Network
 Cron
Kernel boot tasks
Why Configure The Kernel?

 Kernel tailored for your devices


 Add support for new devices
Adding Device Drivers

 Device drivers are part of kernel


 Accessed through special files in the /dev
directory
 Major device number
 Minor device number (unit)
 Device files created with mknod
 Naming conventions for devices
 Loadable kernel modules
 Added or removed while kernel is running
Devices

 A device driver is a program that manages the interaction


between a piece of hardware and the kernel.
 Devices include
 Hard disk (SCSI & IDE)
 Tape drives
 CDROMs
 Floppy disks
 ISDN terminal adapters / modems
 mice
 terminals (i.e. the screen)
 keyboard
Devices II

 Device drivers implement a standardized set of function with a


device interacts with the kernel
 Functions include
 Open, close, read, stop, write, timeout
 Devices fall into two principle types
 Block devices read and write block (usually multiples of 512
bytes)
 Character devices can read and write one byte at a time
Devices III

 The kernel maintains tables for the block and


character devices
 When programs perform operations on devices
the kernel directs the control to the correct
function in a device driver
Linux Kernel Configuration

 Download the source code and extract it under /usr/src


 Customize kernel configuration
 make config
 make menuconfig
 make xconfig
 Two menu items: Networking options and Network device
support
 Device support
 Three options: y, m, n
Linux kernel

 After completing the configuration


 Build dependencies and Clean up:
make dep; make clean
 Build the kernel: make bzImage
Linux
 driver modules in /lib/module
[root@dafinn net]# pwd; ls
/lib/modules/2.4.22-1.2166.nptlsmp/kernel/drivers/net
3c509.o b44.o eepro100.o netconsole.o pppox.o tg3.o
3c59x.o bonding epic100.o ns83820.o ppp_synctty.o tlan.o
8139cp.o de4x5.o ethertap.o pcmcia r8169.o tulip
8139too.o dl2k.o fealnx.o pcnet32.o sis900.o tun.o
82596.o dmfe.o irda ppp_async.o sk98lin typhoon.o
8390.o dummy.o mii.o ppp_deflate.o slhc.o via-rhine.o
acenic.o e100 natsemi.o ppp_generic.o smc9194.o wireless
amd8111e.o e1000 ne2k-pci.o pppoe.o starfire.o

 Recompiling the kernel


 Make the kernel smaller
 Add a new device
 Modify a system parameter
Linux

 List installed modules : lsmod


 Module dependencies
 The meaning of (autoclean)
 Load the module mannually:
 insmod [–k] 3c509
 modprobe smc-ultra
 Generate the dependency: depmod –a
 Remove module: rmmod
 Device driver can be dynamically loaded to compiled into
the kernel.
Processes

 Operating systems are about managing resources


 Files are about storage (and I/O) resources

 Processes are about CPU resources

 Definition :A process is a single program running in its own virtual


address space,
 it receives a share (or time slice) of the CPU

 Processes and commands are not the same


 A simple command (ls) generates a single process
 complex commands or scripts can invoke several simultaneous
executing processes
Process types

There are 3 types of processes in Unix


 Interactive
 Daemons
 Typically started by init process
 Batch
 Outdated
Interactive processes

 initiated and controlled by terminal session


 can accept input from user as it runs
 can output results to the terminal
 Unix has job control to manage processes
Job control for interactive
processes I

 foreground process
 by default interactive processes run in the foreground and the
shell must wait until they complete
 only one process can be running in the foreground for each
user.
 But Remember that Unix is a multi-user system - foreground
and background relate to user sessions. Hence multiple
‘foreground’ processes can be running.
Job control for interactive processes
cont.

 Background process
 if a process has no output to terminal and will take some time
to run, rather than waiting, it can be run as a background
process
 Once started in the background control returns immediately to
the shell.
 a user can initiate multiple simultaneous background
processes
 with the bash shell following a command with an & places in
the background
 eg makewhatis &
Job control for interactive processes
cont.

 The ‘jobs’ command show what process are


suspended or running in the background
 Moving a process from the foreground to the background
takes two steps
 A process running in the foreground can be suspended ( ctrl-
Z)
 A suspended process can be placed in the background (use bg
command)
 One suspended or background process can be brought
to the foreground (fg command)
Daemons

 server process running in the background


 often started at boot time
 offer service to other processed
 examples
 ftpd - file transfer process daemon
 cron daemon - scheduling daemon

 Httpd - web server


Batch processes

 not associated with any terminal


 jobs that are submitted to a queue to await scheduling
 only basic support in Unix by default compared with
other mainframe op sys.
 3rd part system such as NASA’s Network Queue
System can be used
Process Attributes

 the ps and top commands can be used to look


at current processes
 PID - process ID : each process has a unique ID
 PPID parent process ID : The process that ‘folked’ to
start a process
 nice value - priority (-20 highest to 19 = lowest)
 TTY associated terminal (TTY teletype terminal)
Process life cycle

 On startup a single process (called init, with PID 1) is


created
 All subsequent process are derived from by the fork-
exec mechanism
 When a process forks it creates an exact copy of itself called
the child processes
 The exec system call them places the image of the new
process over the copy before allowing it to be scheduled to run
 when a process dies (finishes or is killed) it sends a signal to its
parent
Illustration of Process Control
Calls
Process Control
 A process is a program in execution.
 Processes are identified by their process identifier, an
integer.
 Process control system calls
 fork creates a new process
 execve is used after a fork to replace on of the two processes’s
virtual memory space with a new program
 exit terminates a process
 A parent may wait for a child process to terminate; wait provides
the process id of a terminated child so that the parent can tell
which child terminated.
 wait3 allows the parent to collect performance statistics about the
child
 A zombie process results when the parent of a defunct
child process exits before the terminated child.
Process Control (Cont.)

 Processes communicate via pipes; queues of bytes


between two processes that are accessed by a file
descriptor.
 All user processes are descendants of one original
process, init.
 init forks a getty process: initializes terminal line
parameters and passes the user’s login name to login.
 login sets the numeric user identifier of the process to that of
the user
 executes a shell which forks subprocesses for user commands.
Process Control (Cont.)

 setuid bit sets the effective user identifier of the


process to the user identifier of the owner of the
file, and leaves the real user identifier as it was.
 setuid scheme allows certain processes to have
more than ordinary privileges while still being
executable by ordinary users.
Signals
 Facility for handling exceptional conditions similar to
software interrupts (kill –l shows signal list)
 The interrupt signal, SIGINT, is used to stop a command
before that command completes (usually produced by
^C).
 Signal use has expanded beyond dealing with
exceptional events.
 Start and stop subprocesses on demand
 SIGWINCH informs a process that the window in which output
is being displayed has changed size.
 Deliver urgent data from network connections.
Process Groups

 Set of related processes that cooperate to accomplish a


common task.
 Only one process group may use a terminal device for
I/O at any time.
 The foreground job has the attention of the user on the
terminal.
 Background jobs – nonattached jobs that perform their function
without user interaction.
 Access to the terminal is controlled by process group
signals.
Process Groups (Cont.)

 Each job inherits a controlling terminal from its parent.


 If the process group of the controlling terminal matches the
group of a process, that process is in the foreground.
 SIGTTIN or SIGTTOU freezes a background process that
attempts to perform I/O; if the user foregrounds that process,
SIGCONT indicates that the process can now perform I/O.
 SIGSTOP freezes a foreground process (ctrl-Z).
Sending Signals from the Keyboard
 Typing ctrl-c (ctrl-z) sends a SIGTERM (SIGTSTP) to every job in
the foreground process group.
 SIGTERM – default action is to terminate each process
 SIGTSTP – default action is to stop (suspend) each process
pid=10
pgid=10 Shell

pid=20 Fore- Back- pid=32


Back-
pid=40
pgid=20 ground ground pgid=32 ground pgid=40
job job #1 job #2

Background Background
Child Child process process
group 32 group 40
pid=21 pid=22
pgid=20 pgid=20

Foreground
process group 20
Process Control Block
(PCB)

an Application

PCB

OS Kernel

Protected mode
Preemptive Scheduling

 100 msec window timer/clock interrupt


 scheduling decision
 “bill” the process
 context switching might or might not happen
 Priority
 Fairness

 …
Preemptive vs. Nonpreemptive

 Preemptive:

 Nonpreemptive:

 Pros and Cons…..


 How about Unix??
 Preemptive only in the user mode.
 How about kernel mode? (system call locks)
Unix Process Hierarchy
[0]

/etc/inittab init [1]

Daemon Login shell


e.g. httpd

Child Child Child

Grandchild Grandchild
pstree

Kernel threads, not real processes

Forked processes for network connections


Unix Bootstrapping

 System Processes
 The kernel identifies the root, swap, and dump devices and then starts programs to
schedule processes, manage physical memory and virtual memory, and the init
process.
 Sched
 The real-time scheduler.
 Swapper
 It manages the physical memory by moving process from physical memory to swap
space when more physical memory is needed.
 Page Daemon
 Various memory handlers run as process 2.
Shell Programs
 A shell is an application program that runs programs on
behalf of the user.
 sh – Original Unix Bourne Shell
 csh – BSD Unix C Shell, tcsh – Enhanced C Shell
 bash –Bourne-Again Shell
int main()
{
char cmdline[MAXLINE];

while (1) {
/* read */
printf("> ");  Execution is a
Fgets(cmdline, MAXLINE, stdin);
if (feof(stdin)) sequence of
exit(0);
read/evaluate steps
/* evaluate */
eval(cmdline);
}
}
Simple Shell eval Function
void eval(char *cmdline)
{
char *argv[MAXARGS]; /* argv for execve() */
int bg; /* should the job run in bg or fg? */
pid_t pid; /* process id */

bg = parseline(cmdline, argv);
if (!builtin_command(argv)) {
if ((pid = Fork()) == 0) { /* child runs user job */
if (execve(argv[0], argv, environ) < 0) {
printf("%s: Command not found.\n", argv[0]);
exit(0);
}
}

if (!bg) { /* parent waits for fg job to terminate */


int status;
if (waitpid(pid, &status, 0) < 0)
unix_error("waitfg: waitpid error");
}
else /* otherwise, don’t wait for bg job */
printf("%d %s", pid, cmdline);
}
}
Shell Scripts

 Character file
 You must have permission to read and execute
the file
 It contains commands just like from the keyboard
 Like the .bat file from DOS
Booting and Kernel
Initialization
System Lifecycle: Ups &
Downs

Power Power
on off
Boot Kernel OS RUN! Shut
Init Init down
Boot Terminology

 Loader:
 Program that moves bits from disk (usually)
to memory and then transfers CPU control to the newly
“loaded” bits (executable).
 Bootloader / Bootstrap:
 Program that loads the “first program” (the kernel).
 Boot PROM / PROM Monitor / BIOS:
 Persistent code that is “already loaded” on power-up.
 Boot Manager:
 Program that lets you choose the “first program” to load.
LILO: LInux LOader

 A versatile boot manager that supports:


 Choice of Linux kernels.
 Boot time kernel parameters.
 Booting non-Linux kernels.
 A variety of configurations.
 Characteristics:
 Lives in MBR or partition boot sector.
 Has no knowledge of filesystem structure so…
 Builds a sector “map file” (block map) to find kernel.
 /sbin/lilo – “map installer”.
 /etc/lilo.conf is lilo configuration file.
Example lilo.conf File
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
default=linux

image=/boot/vmlinuz-2.2.12-20
label=linux
initrd=/boot/initrd-2.2.12-20.img
read-only
root=/dev/hda1
LILO v.s. GRUB

 LILO
 Run LILO to modify mini-bootloader in the MBR
 Cannot read file system itself
 GRUB
 Multistage loader
 Can read file-system itself

 Parameter passing (runlevel, init) to kernel


 Actually hacking – modifies address and name inside kernel for
the process to start
Init process (1)
init
When the kernel has started itself (has been loaded into memory, has
started running, and has initialised all device drivers and data structures
and such), it finishes its own part of the boot process by starting a user
level program, init. Thus, init is always the first process (its process
number is always 1).

The kernel looks for init in a few locations that have been historically used
for it, but the proper location for it (on a Linux system) is /sbin/init. If the
kernel can't find init, it tries to run /bin/sh, and if that also fails, the startup
of the system fails.

When init starts, it finishes the boot process by doing a number of


administrative tasks, such as checking filesystems, cleaning up /tmp,
starting various services, and starting a getty for each terminal and virtual
console where users should be able to log in (see Chapter 10).
Startup Sequence
Boot Create
Load
Power-on loader init
Kernel
LILO process

hardware Linux

runlevel
rc.sysinit rc.local Ready
0-6

Initialisation Scripts
Unix Today - You want choice :)

 Unix systems are usually based in the


AT&T System III & V or BSD work.
 Sun Mircosystems Solaris 2.X (formally SunOS) BSD-ish
 DEC OSF/1 is BSD-ish (DEC use to do Ultrix)
 IBM AIX (neither ATT or BSD but something else)
 HP HP-UX (BSD-ish)
 Silicon Graphics, IRIX (ATTish)
 SCO (Santa Cruz Operation) PC unix (ATT)
 Linux, kernel from Linus Torvalds (BSD-ish for admin,
ATT-ish for programming)
 Distributions Slackware, Redhat, SuSE, Debian
 other free PC Unixs, NetBSD, 386BSD, free BSD
Startup files
 How to start other services not in kernel?
 BSD mode
 /etc/rc, /etc/rc.boot and /etc/rc.local
 System V
 Startup runlevels
 init process and /etc/inittab file
 On linux:
 0: shutdown and halt
 1 single-user mode
 2 multiuse mode, no file sharing
 3 full multiuser.
 4 unused
 5 X windows console
 6 shuts down and reboots
Sample BSD Startup Scripts
/etc/rc.boot
 First rc script to run is /etc/rc.boot
 The first two lines set HOME and PATH environment variables
 Executes basic system commands during boot
 hostname file in /etc for each network interface
 enables IP networking on each interface
 Reverse Address Resolution Protocol (RARP)

 Find hostname from other machine on NW using hostconfig


program and use NFS to mount filesystems
 System Administrator intervene to fix problem
Sample BSD Startup Scripts
/etc/rc.boot (cont.)
 Address or hostname of default Internet gateway is read
from /etc/defaultrouter
 non-local NW connections up prior to more complicated
routing in boot process
 /usr filesystem read-only for system check to see if
/fastboot exists
 Yes: system shut down cleanly~ filesystems in consistent state
 No: all filesystems listed in /etc/fstab checked in fsck
 If disks check cleanly~ rc.boot runs /etc/rc.single
Sample BSD Startup Scripts
/etc/rc.single
 Commands in /etc/rc.single are executed at boot time
even if not using single mode
 Remounts / and /usr filesystems read/write
 if not remounted~ system not able to come up
 Cleans out /etc/mtabfile and adds entries for / and /usr
 was previously mounted but not in mtab file because root
filesystem not writable
 /usr/kvm mounted~ clean up shared library cache
Sample BSD Startup Scripts
/etc/rc.single
 /etc/utmp file cleaned out
 contains user list of current log ins
 tzsetup command sets local time zone & status of daylight
savings time (kernal is GMT)
 loadkeys command sets keyboard mapping
 rc.single exits~rc.boot exits
 No problems in autoboot mode the next init process is
/etc/rc
 If problem~single-user (sh process) on console
Sample BSD Startup Scripts
/etc/rc

 /etc/rc is the main system startup up script in autoboot


after rc.boot
 if single-user: rc after shell is terminated
 if root filesystems not writable~ rerun rc.single
 clean up shared library cache
 remove /fastboot file
 /etc/passwd file edited ~system crashes
 vipw and /etc/rc script make sure password file not destroyed
at crash
Sample BSD Startup Scripts
/etc/rc (cont.)
 Enable quotas
 /bin/ps -u cleans out the ps database (status of
processes)
 /etc/nologin created by shutdown to prevent logins during
shutdown
 executes rc.local script
 swapon -a to make use of all swap partitions listed in
etc/fstab
 expreserve: looks in /tmp to find files that were edited
when system went down
Sample BSD Startup Scripts
/etc/rc (cont.)

 Start standard system daemons (i.e., lpd, inetd,


update, uushed)
Sample BSD Startup Scripts
/etc/rc.local
 /etc/rc.local contains commands for local system
 portmap daemon maps RPC (remote procedure call)
service numbers to the NW ports of appropriate servers
 NIS (NW info service) Domain Name set from /etc/default
domain
 set subnet mask of all machines interfaces
 default route reset~ if no default routing daemon run
 list current configuration of NW interfaces on console
Sample BSD Startup Scripts
/etc/rc.local (cont.)
 All NFS filesystems mounted
 named (server for Domain Name system) maps between
hostnames and Internet addresses
 Client side NFS daemon run (biod)
 syslogd: responsible for managing log messages
 save kernel core dump in /var/crash/hostname
 Image saved on swap partition~ save image to real filesystem
 Clean up temporary mail lock files and start sendmail
Sample BSD Startup Scripts
/etc/rc.local (cont.)
 Make machine NFS Server if filesystems need to be
exported
 Daemon to support diskless clients
 rpc.statd and rpc.lockd manage advisory locks on
NFS filesystems
 Start automount daemon
 3rd party vendor install scripts
 Appletalk protocol stack started
 Licensed software add-ons
System V Run Levels

 Level 0 – shutdown
 Level 1 or S – single-user mode
 Level 2 thru 5 – multi-user mode
 Level 6 - reboot
Startup Script Directories

 /etc/inittab tells init where scripts are


 /etc/init.d script directory
 /etc/rc2.d link to script directory
Startup files

 Understanding /etc/inittab
 Label:runlevel:action:process
id:5:initdefault:

# System initialization.
si::sysinit:/etc/rc.d/rc.sysinit

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6
Some Linux inittab action valus
Action Meaning
Boot Runs when system boots
Bootwait Init waits for complete
Ctrlaltdel
Initdefault Set the detault runlevel
off Disable the entry
Once For every runlevel
Powerfail When init receive SIGPWR signal
Powerokwait SIGPWR and /etc/powerstatus has ok
Respawn Restart the process wheneven it termincates
Sysinit Before any boot
Wait Upon entrying the run mode and waits to
complete
Linux startup - rc.sysinit script

 /etc/rc.d/rc.sysinit - does a range of basic task including


 configures networking

 sets host name

 checks the root file system for repairs

 check root file system quota & turns quotas for groups and
users
 mount non-root file systems and checks them for repairs

 turns on swapping (virtual memory subsystem)

 checks and loads modules (drivers)

 (see /var/log/messages)
Linux Run Levels

 Linux defines 7 run levels


 Each run level defines a set of commands that are run to stop and start
processes.
 The actual commands are held in /etc/init.d directory
 The run level directories rc0.d, rc2.d…rc6.d contain links to the actual
commands
 Each command is prefixed with S or K and a number 00-99
 S prefix means that a process should be started e.g.
S10network
 K prefix means that a process should be stopped (killed)
K70syslog
 The numbers determine the order in which the commands are
run from lowest first to highest last
Linux Run Levels 0-2

 Runlevel 0 Directory /etc/rc.d/rc0.d


 Actually shutdown sequence
 Kill all processes
 Turn off virtual memory system (i.e. swap partition)
 unmounts swap and file systems
 Runlevel 1 /etc/rc.d/rc1.d
 single user mode
 used for maintenance by system administrators when they
need sole control of machine, e.g. reconfiguring hardware
installing software
 Runlevel 2 /etc/rc.d/rc2.d
 Multi-user + networking (minus NFS)
Linux Run level 3-6

 Runlevel 3 /etc/rc.d/rc3.d
 Default run level
 multi-user + NFS
 Runlevel 4 /etc/rc.d/rc4.d
 not defined ( available for customization)
 Runlevel 5 /etc/rc.d/rc5.d
 Same as 3 under Redhat this but includes starting X windows
 Runlevel 6 /etc/rc.d/rc6.d
 reboot
 similar to 0 but allow allows option to shutdown (halt) or reboot
Shutdown

 shutdown allows...
 users to be warned the systems is going down
 the contents of disk caches to be written disk
 file systems to be marked as having been closed properly (
avoid file system check on next startup)
 Access to the shutdown command is restricted (it is in
/sbin)
 eg shutdown -h now

h = halt
r = reboot
Init scripts in Gentoo

 Named (not numbered) run levels.


 Smart dependencies.
 Scripts can ‘use’ or ‘depend’ on others.
 Start / Stop / Pause.
 /etc/runlevels/default/.
Internet Daemon
 Daemon inetd started at boot time
 Configuration file /etc/inetd.conf
 Name, type, protocol, wait-status, uid, server,
arguments
#
ftp stream tcp6 nowait root /usr/sbin/tcpd in.ftpd
telnet stream tcp6 nowait root /usr/sbin/tcpd in.telnetd
#
# Mail is a useful thing...
pop3 stream tcp nowait root /etc/mail/popper popper -s
imap stream tcp nowait root /etc/mail/imapd imapd
Internet Daemon

 When to modify inetd.conf


 Disable a service
 Add a # at the beginning of the entry
 Send hang-up to inetd
kill –HUP processid
 Enable a service
 Change the path
 Modify arguments
Extended Internet Daemon

 Daemon xinetd
 Configuration file /etc/xinetd.conf and /etc/xinetd.d
 Attribute/value pair
 Diable = yes/no
Setup automatic Mounting
/etc/fstab
/etc/vfstab

# Device Mpoint FStype Opt Dump Pass


/dev/sd01sf /new ufs rw 0 2
/dev/da0b none swap sw 0 0
Sample Directory Tree with
Mount Points

/
/dev/hda9

/boot /usr /home swap /var


/dev/hda1 /dev/hda5 /dev/hda6 /dev/hda7 /dev/hda8
Mounting and Unmounting File
Systems
 File Systems mounted with the mount command:
mount [options] device directory
For example:
mount –o rw –t ext2 /dev/hda10 /tmp
 File systems umounted with the umount command:
umount [-f] directory
For example:
umount /tmp
 File systems should only be umounted when they are not in use.
/etc/fstab

 Configuration file for all partitions known to the system.


 Entry format:
/dev/device /dir/to/mount fstype
parameters fs_freq fs_passno
Sample entry:
/dev/hda10 /tmp ext2 defaults 1 2
 For entries in /etc/fstab, can run mount command with just mount
point:
> mount /tmp
To mount all file systems:
> mount -a
Scheduling processes - cron

 Many aspects of system administration require things to be


done on a routine basis
 Rotating logs
 building help files
 checking disk space
 checking permissions
 Remembering to do thing is error prone
 Unix provides scheduling mechanism refereed to as cron.
 Cron has two parts
 Daemon - crond
 table of actions /etc/crontab
Cron

 the crond Daemon is started at boot time


 the daemon ‘wakes up’ every minute to check its
table of actions
 if their is something to do -> run command
 if nothing to do --> go back to sleep for 1 min
 Cron table is a list (time,commnd) pairs. The
format is
 minute hour day month dayofweek command
Crontab

 Commands can be scheduled by


 minute (0 59)
 Hour ( 0 to 23)
 Day of the month (1 - 31)
 Month ( 1 to 12)
 Day of the week (0=Sunday 6 = sat, or use mon,tues,wed)
 Example
01 * * * * commnd2 # hourly at 1 minute past
* 1 * * * commnd2 # daily at 1 am
04 1 * * * commands 3 - run at 4 minute past
1 each day
* means ‘check every’
Cron

 Under Redhat Linux the cron table is used to execute a


set of commands in some special directories
 /etc/cron.hourly
 /etc/cron.daily
 contains logrotate, makewhatis,slocate,tmpwatch
 /etc/cron.weekly
 /etc/cron.monthly
 You can add you own commands to the appropriate directory, but
remember they need to be ‘batch’ commands as they will run
automatically
Crontab Files

 Minute 0-59
 Hour 0-23
 Day 1-31
 Month 1-12
 Weekday 0-6 (0=Sunday)
 * Matches everything
 1-3 Matches range
 1,5 Matches Series
Examples
15,45 10 * * 1-5
write garth % Hi Garth % get a job
30 2 * * 1 (cd /user/joe/p; make)
find /tmp –atime +3 –exec rm –f {} ‘;’
 Output mailed to owner of crontab file
crontab commands

 crontab Replace ^C exit


 crontab –l List
 crontab –e Edit
 crontab –l > cronfile
 crontab cronfile
 cron.allow
 cron.deny
Common Uses for CRON

 Cleaning the filesystem


 Distribution of config files
 Rotating log files
 Backups
Webmin

 Webmin is a web-based interface for system


administration for Unix. Using any browser that
supports tables and forms (and Java for the File
Manager module), you can setup user accounts,
Apache, DNS, file sharing and so on.
 http://www.webmin.com
Advanced Boot Concepts

 Initial ramdisk (initrd) – two-stage boot for flexibility:


 First mount “initial” ramdisk as root.
 Execute linuxrc to perform additional setup, configuration.
 Finally mount “real” root and continue.
 See Documentation/initrd.txt for details.
 Also see “man initrd”.

 Net booting:
 Remote root (Diskless-root-HOWTO).
 Diskless boot (Diskless-HOWTO).
Adding Users

 Edit passwd and shadow


 Set initial password
 Create home directory
 Copy startup files
 Configure disk quotas
Mac OS X Architecture
Simplified diagram
Mac OS X Architecture
Apple’s Boiled Sweets diagram
http://developer.apple.com/macosx/architecture/
Mac OS X

Das könnte Ihnen auch gefallen