Getting started and managing accounts

Take another look at last week’s notes.

No, I still haven’t finished grading the shell scripts. ☹

Also, it is amazing how many Linux references are on Pinterest.

Chapter 6 — systemd and init

Other references

Section 6.4 — systemd

It isn’t easy to understand, but it much faster. Also, it is inevitable.

Login to your Pi or to check it out.

A systemd trail

It is doubtful you will ever write one of these.

Controlling services with systemd

Use systemctl with commands listed on man page.

Section 6.6 — System V init

Did that last month.

Section 6.7 — shutdown

Read the man page. Guess what the -k option abbreviates.

Section 6.8 — initrd, initial root disk

Did that last month.

Chapter 7 — logging & login control

7.2 — system log

Take a look at /var/log. I use dmesg, auth.log, kern.log and sys.log. You will need to us sudo to view most of these.

7.3 — /etc/passwd and /etc/shadow

Look at these files. You will not find yourself because user authentication is handled by Kerberos and LDAP. If you are brave, you can rename /etc/passwd. You won’t be able to reboot unless you have a console.

7.6 to 7.7 — cron and at

cron is useful for scheduling backups. at is useful for making a web page invisible for a few hours.

7.8 — The three user ids

Try out the following command
    ls -l /usr/bin | grep "^[-]rws"
Now figure out why we need three different user ids.

7.9 to 7.10 — Identification, authentication and PAM

Getting LDAP, Kerberos, Active Directory etc is so that most people just use the distribution-provided scripts such as auth-client-config and as pam-auth-update. However, you should take a look at /etc/ldap.conf, /etc/krb5.conf, and the files in /etc/pam.d directory to see how it is done locally.

Chapter 8 — Controlling and monitoring processes

8.1 — ps (2.16) revisted

Take a look at Conquering the command line or The Geek stuff or go back to Section 2.16.

8.2 — lsof

Useful for figuring out which process is writing that huge file

8.3 — strace for OS students

Useful for figuring out why the program you downloaded keeps crashing.

8.4 — threads for every one

It is amazing how many threads a browser can run.

8.6 to 8.12 — What process is that

top is useful for figuring out what is using up all the cycles. w displays the system load and the logged in users. vmstat displays memory usage. iostat displays I/O operations. is useful for figuring out what is using up all the cycles. top is useful for figuring out which processing are hogging the most resources. Take a look at Alvin Alexander’s tutorial on top.