Post Install Tasks

First setup AURarrow-up-right

Time

Setup timearrow-up-right using systemd-timesyncdarrow-up-right.

timedatectl set-ntp true
timedatectl set-ntp 1

Configure Reflector

So you always have fresh mirrors, setup reflectorarrow-up-right.

pacman -S 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.

nano /etc/systemd/system/reflector.service
[Unit]
Description=Pacman mirrorlist update

[Service]
Type=oneshot
ExecStart=/usr/bin/reflector --latest 200 --protocol http --protocol https --sort rate --save /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 Msmtparrow-up-right.

Setup system default.

Example config file

Set permissions.

You can setup a gpg encrypted passphrasearrow-up-right 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 shownarrow-up-right 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)arrow-up-right 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)arrow-up-right (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 with a systemd unit and timercontaining the following.

Enable for pool.

Enable The ZFS Event Daemon

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

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 hostidarrow-up-right or problems arise at boot.

smart

Install smartmontoolsarrow-up-right.

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

Autofs

Install autofsarrow-up-right.

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