FHS and System Logs FHS: Filesystem Hierarchy Standard

jboydt :: csci 26 | fhs and system logs FHS: what is it? ● A standard? ○ an agreed-upon set of rules and/or practices ○ developed by volunteer industry professionals

● Why FHS? ○ to provide users of FHS-compliant systems an assurance that: ■ the contents of the root filesystem are adequate to boot, restore, recover, and/or repair the system ○ to guide creators of systems in their choices about: ■ core system directories ■ core system utilities ○ to provide a predictable foundation for software developers ○ to provide a predictable experience for users

jboydt :: csci 26 | fhs and system logs FHS: core details ● Foundation ○ FHS assumes the underlying system has -like security features

● What the standard covers ○ the filesystem ○ the root filesystem ○ the /usr secondary hierarchy ○ the /var secondary hierarchy

jboydt :: csci 26 | fhs and system logs FHS: core details

● Root filesystem -- required directories: ○ /bin -- essential command binaries ○ /boot -- static files of the boot loader ○ /dev -- device files ○ /etc -- host-specific system configuration ○ /lib -- essential shared libraries and kernel modules ○ /media -- mount point for removable media ○ /mnt -- mount point for temporary filesystem ○ /opt -- add-on applications ○ /sbin -- essential system binaries ○ /srv -- data for services provided by the system ○ /tmp -- temporary files ○ /usr -- secondary hierarchy ○ /var -- variable data

jboydt :: csci 26 | fhs and system logs Bonus section: and locate

● find ○ find PATH EXPRESSION ○ examples: ■ find /bin -name “z*” ■ find /var -user root ■ find /etc -group staff ■ find / -user janedoe -name “*.log” 2> /dev/null ● locate ○ locate ○ updatedb ○ + faster than find as it uses its own database for a fast search ○ - its own database needs to be up-to-date ○ example: locate mail

jboydt :: csci 26 | fhs and system logs Bonus section: whereis and which

● whereis ○ search for file in a limited set of directories ○ + can be faster than find ○ - only searches a limited set of directories ○ example: whereis

● which ○ search user PATH for an executable ○ example: which ls

jboydt :: csci 26 | fhs and system logs Bonus section:

● type ○ display how a command will be interpreted ○ examples: ■ type ls ■ type

jboydt :: csci 26 | fhs and system logs System Logs

jboydt :: csci 26 | fhs and system logs System logs: the basics

● What is a log? ○ a file used to record information about system operations ○ system use many log files ○ examples in /var/log: ■ messages -- global system messages, including system startup ■ dmesg -- kernel ring buffer information (* dmesg command) ■ auth.log -- system authorization information ■ lastlog -- recent login information for users (* lastlog command)

jboydt :: csci 26 | fhs and system logs rsyslog: the basics

● What is rsyslog? ○ an implementation of syslog that is the default on Debian systems

● OK, so what is syslog? ○ a daemon to handle log maintenance on a Linux system ■ a daemon? ● a system service that runs non-interactively in the background ○ unifies all system logging activities ■ gives Sys Admin control over how and where messages are logged

jboydt :: csci 26 | fhs and system logs jboydt :: csci 26 | fhs and system logs