Post Install Tasks

First setup AUR

Time

Setup time using systemd-timesyncd.

Configure Reflector

So you always have fresh mirrors, setup reflector.

Create service to select the 200 most recently synchronized HTTP or HTTPS mirrors, sort them by download speed, and overwrite the file /etc/pacman.d/mirrorlist.

Create timer.

That will run reflector weekly.

Configure SMTP

I used to use ssmtp but since it's now unmaintained I've started using Msmtp.

Setup system default.

Example config file

Set permissions.

You can setup a gpg encrypted passphrase if using interactively. The other (not very good option) is setting with 'password' in config.

Add aliases to /etc/aliases.

If anything private is in /etc/msmtprc, secure the file as shown on the Arch wiki.

Create an ssmtp group and set the owner of /etc/msmtp and the msmtp binary.

Make sure only root, and the msmtp group can access msmtprc, then et the SGID bit on the binary

Then add a pacman hook to always set the file permissions after the package has been upgraded:

Make it executable:

Now add the pacman hook:

Test mail

Send a test mail.

ZFS Configuration

I always set up snapshotting and replication as one of the first things I do on a new desktop.

Enable Snapshots

Install zfs-auto-snapshot (AUR) and setup snapshotting on all datasets.

Set all datasets to snapshot and disable any datasets that dont require snapshotting.

In one line:

ZFS Replication With ZnapZend

Install ZnapZend (AUR) (it's a great tool, I maintain the AUR package).

Create a config for each dataset thet needs replicating, where SYSTEM will be a name for the dataset at ${POOL}/replication/${SYSTEM} on the remote. Specify the remote user and IP as well. Here is a small script I use for my setup. The grep can be adjusted to exclude any datasets that are unwanted.

On remote I have a pre-znazendzetup script which makes sure the remote location exists.

I would then run, for chin on replicator@<server ip>.

Scrub

Setup a monthly scrub. Easiest way to set this up as install the systemd-zpool-scrub (AUR) package.

This could also easily set up by just installing a systemd unit containing the following.

Enable The ZFS Event Daemon

If an SMTP or MTA is configured, setup The ZFS Event Daemon (ZED)

Ad an email and mail program and set verbosity.

Start and enable the daemon.

Start a scrub and check for an email.

Define Hostid

Define a hostid or problems arise at boot.

smart

Install smartmontools.

Tests

Long or short tests can be run on a disk. A short test will check for device problems. The long test is just a short test plus complete disc surface examination.

Long test example:

Veiw results:

Or, veiw all test results.

Or detailed results.

Daemon

The smartd daemon can also run, periodically running tests and will send you a message if a problem occurs.

Edit the configuration file at /etc/smartd.conf.

To check for all errors on a disk use the option -a after the disk ID.

To test if your mail notification is working run a test, add -m <email address> -M test to the end of the config. This will run the test on the start of the daemon.:

Start smartd:

My config looks like:

nfs

Rpc has a bug caused by glibc, until it's resolved force rpc.gssd to start.

Autofs

Install autofs.

Add or uncomment the following.

Start and enable.

User Cache

I like to keep certain directories in tmpfs. It avoids extra writes to disk and can be faster since everything is stored in memory.

Cleaning the cache

I like periodically have my users cache directory cleaned. This can easily be done using tmpfiles.d.

Create a new file in the /etc/tmpfiles.d directory.

Add a rule that will delete any file older than 10 days.

Last updated