Notes having to do with Arch Linux on Loro and friends

Contents

1  Installation

1.1  Basics

Here is how to do the Arch install on systems connected to loro.

1.2  Solid state disks

Special considerations apply to the use of solid state disks (SSDs). For all SSDs, do the following:

1.3  SATA disks

These disks otherwise look like ordinary hard disks to the system.

1.4  NVME disks

This is a newer standard that allows much higher transfer rates than SATA. These disks have names in “/dev” of the form “nvmeXnY” where “X” indicates the controller number (starting from “0”) and “Y” indicates the disk on that controller (starting from “1”). Partition “Z” on the disk (starting from “1”) is indicated by “nvmeXnYpZ”. So partition 3 on disk 1 of controller 0 is “nvme0n1p3”.

Some NVME disks (those from Samsung are mentioned) don’t work with low power states, making the system unstable. To fix this problem, include the kernel option “nvme_core.default_ps_max_latency_us=5500”.

1.5  Intel processors

Intel processors need to load firmware at boot rather than later (as with AMD processors). To accomplish this with the syslinux boot loader (which we use):

1.6  Intel AMT

The kernel loads a module called “mei” which interfaces with Intel’s AMT (active management technology) hardware. This causes an annoying (but harmless) error message on boot and wakeup from sleep. Since we don’t use AMT (which allows remote management of your computer at the hardware level - by who knows whom! - ugh!), it is not a bad idea to turn this off. Do so by creating the file “mei.conf” in the directory “/etc/modprobe.d” containing the single line “blacklist mei”.

I don’t know if this is an issue on AMD machines.

1.7  Thinkpad laptops

1.7.1  Notes on Lenovo Thinkpad X230 and X1 Carbon, Generations 1, 4, 5

Most things work out of the box on an ARCH install. However, there are some minor issues:

For more information, see the ARCH wiki pages on these machines.

1.7.2  Notes on Lenovo Thinkpad E485

This laptop runs an AMD Ryzen 3/5 CPU.

1.7.3  Upgrading (or downgrading) the BIOS on Thinkpads

Here is how to do it. To downgrade, one generally has to turn off downgrade prevention in the BIOS beforehand.

1.8  Upgrading the operating system

Normally upgrading is done with the command

If upgrading fails due to a package failing to verify, your Arch keyring may be out of date. One way to solve this is to run

This updates your keyring from the last upgrade of the arch-keyring package on the local system. If the above doesn’t work, try reinstalling the package “archlinux-keyring” and repeat the above. Also be sure that the package “haveged” is installed.

2  Special installation instructions for loro

Loro is now our network file system and printing server, so it needs special consideration. loro acts as a hot backup. Loro also runs various jobs at specified times via the cron mechanism. Things having to do with the administrative functions of loro are located in “/usr/local/etc”.

2.1  Secure shell daemon

By default, the secure shell daemon turns off password access to root. For root-level communication on the loro cluster, as well as with kestrel, this needs to be turned on. Add to “/etc/ssh/sshd_config”:

PermitRootLogin yes

2.2  Network file system

Two things need to be done to set up file sharing of /usr/local, /home.loro, and /data.gy:

After installing, reboot.

2.3  Running MPI jobs

We now use OpenMPI to run parallel MPI jobs on loro and friends. The Arch “openmpi” package should be installed on all machines.

Generally you should create a “hosts” file to tell OpenMPI on which machines to run your job. For example, the file might be of the form

gy09 slots=1
gy01 slots=4
gy02 slots=4
gy07 slots=8

to run a job with one process on gy09, 4 processes on gy01 and gy02, and 8 processes on gy07. Make the number of slots on each machine no more than the number of CPU cores.

The command line for starting an MPI job is

The number following “-np” is the number of processes desired, which should be equal to (or less then, but not more) than the number of slots in the “hosts” file described above. If the host file is omitted, all processes are run on the current machine and the total number of processes must not be greater than the number of cores available on that machine. The absolute path to your executable is needed since the default path available to MPI is limited and probably does not include your home directory. (Is this still true???) This command may be run on any machine that shares any directories used by the MPI job. However, passwd-free ssh access between all the machines used must be set up beforehand.

2.4  Periodic jobs

Loro runs a number of jobs periodically. This is done using the “cron” program. To edit the schedule of jobs run:

Here is a typical list of entries:

#27 * * * * /usr/local/etc/munchallpwds.sh 
11 23 * * * /usr/bin/crontab -l > /etc/rootcrontab 
13 23 * * * /usr/local/etc/getcustom > /dev/null 
25 2 * * * /usr/local/etc/savehome-del home 
2 2 * * * /usr/local/etc/savelocal 
13 4 * * * /usr/local/etc/checkdata.sh 
2 22 * * * /usr/local/etc/savealldata.sh > /dev/null 
#2 22 * * * /usr/local/etc/savealldata.sh del > /dev/null 
0 21 * * * ssh coot /usr/local/etc/savekestrel.sh > /dev/null 
0 22 * * * ssh peregrine /usr/local/etc/savekestrel.sh > /dev/null 

See the “crontab” man page for further details.

2.5  New user setup on loro

To add a new user, run the program “/usr/local/etc/myuseradd.sh xxx” as root to add user “xxx”. Then run “passwd xxx” and let the new user enter a password. To delete a user, run “userdel -r xxx”. The “-r” removes the home directory and mail files.

3  Special instructions for merlin

Merlin is now our connection to the Internet and also our dnsmasq server that provides local DNS service as well as setting up an IP masquerading firewall. It also provides backup storage for kestrel and loro.

4  Enabling core dumps

To enable core dumps, put this in your .bashrc file:

In addition, systemd causes problems in creating core dumps. To fix this, get systemd out of the loop by doing (as root):

5  Python

Arch has moved to version 3 of python, which causes some complications.

Python is python3. Python2 is python2. Had to modify qplot and other programs to run python2, as matplotlib is not ported to python3 yet. To make these python programs run on Debian, link “/usr/bin/python” to “/usr/bin/python2” on the Debian systems.

Arch has up-to-date matplotlib and numpy packages. The package containing setuptools is called “python2-distribute” (for python2). This is needed for the “pupynere” package. “Pupynere” (python-only netcdf) and “pycandis” (candis package) are needed for our work environment. The source exists in “/usr/local/src/python” and is easily installed using

in the respective package directories.

6  Networking

6.1  Simple networking

For a desktop just use the netctl networking created in the install.

6.2  Laptops

For the laptop, turn off static networking completely by disabling the static, wired network used for the installation. Just install networkmanager and network-manager-applet along with gnome-keyring. This works well for wired as well as wireless networks. The gnome-keyring package allows the storage of network passwords. Since the applet likes to live in the notification area, this results in complications when not using gdm (the gnome session manager).

As an alternative, install use netctl. For each network (wireless or wired) a configuration file must be set up in /etc/netctl. These are simple and configuration examples are given. Wifi-menu (part of the netctl package) allows the generation of configuration scripts automatically while roaming. The additional packages should also be installed: dialog, wireless-tools, wpa-supplicant, dhcpcd. Since this stuff must be run as root, give yourself suid permissions (nopasswd) using visudo. Here is what I have in/etc/sudoers:

raymond ALL=(ALL) NOPASSWD: /usr/bin/netctl,/usr/bin/wifi-menu, /usr/sbin/wpa_supplicant,/sbin/dhcpcd, /usr/sbin/rfkill

I have created a set of convenience routines named ~/bin/net-* to access various networks, as well as a simple shell script called ~/bin/selectnetwork.sh to make it easy to run the desired network.

6.3  IP masquerading

Information comes mostly from the Arch Wiki site.

First, get your external and internal network interfaces set up using netctl. You can set up configuration files for each using the examples in /etc/netctl/examples. Second, prepare the networks to start at boot by running the commands “netctl enable external” and “netctl enable internal”.

Grab the files “masq-start.sh”, “masq-stop.sh”, and “masquerade.service” from “/usr/local/etc”. Edit “masq-start.sh” to correctly identify the ethernet device names used in the netctl files. Then copy the start and stop files to “/etc/iptables” and “masquerade.service” to “/usr/lib/systemd/system”

Start masquerading by running (as root)

Reboot.

7  Printing with CUPS

If this hasn’t been done yet, activate cups with the command

Then start cups

To configure cups, use your browser to access “http://localhost:631/”. For this to work, your account must be a member of the “lp” and “sys” groups. As root, execute the following:

7.1  CUPS client machine

Generally, you don’t have to explicitly add printers run by a CUPS server - they will be found automagically.

One can also connect with an LPRNG print server. With the browser interface, add the printer using the lpd protocol. For example, to connect to the physics printer on kestrel.nmt.edu, use

and select “raw” as the printer type. See more below about LPRNG.

8  Printing with LPRNG

LPRNG is old software, an update of the original Berkeley UNIX LPR system. Arch doesn’t support it, but the source code, updated with a modern configuration system, is available on SourceForge here. The best documentation for LPRNG is at its homepage. The cookbook and reference manuals are useful for those installing LPRNG.

Why LPRNG over CUPS? My experience with CUPS is that it is opaque and unstable as a print server (especially with Arch’s rolling update cycle), and generally a frustrating time sink for system admins. LPRNG takes some effort to set up, but it is stable and generally simpler and more transparent than CUPS. A disadvantage of LPRNG is that Gnome3 has seen fit to eliminate support for it. However, CUPs still works on client machines to drive LPRNG printers - see above. This way you can print directly from Gnome3 applications.

8.1  User hints

The main printing command with LPRNG is “lpr”; the status of print jobs can be examined using “lpq”; print jobs can be killed using “lprm”. See the respective man pages for more. As currently set up on kestrel and loro, PostScript, PDF, and plain text files can be printed directly. Other file types are rejected.

To make Gnome2 applications print to LPRNG, you need to create a file named “.gtkrc-2.0” with a single line:

If you are using LXDE, and you have changed the desktop look and feel, your .gtkrc-2.0 file may be overwritten. If so, put the above line in the file “.gtkrc-2.0.mine”. You may have to logout and log back in for this to have an effect.

If using a Gnome3 application such as evince or gnumeric and you still wish to use LPRNG, print to a PDF file and do the actual printing using the command line or an application such as atril (the Gnome2 version of evince, as included in the MATE desktop) or xpdf. Libreoffice prints directly to lpr, so no such monkey business is needed for that application. It uses the printer defined by your PRINTER environment variable in the .bashrc file. Set this variable by putting, for instance, the line

(or whatever printer you want) into this file. Look at the file “/usr/local/etc/printcap” to see what printers are available to you.

8.2  Components of LPRNG

LPRNG consists of several components:

Missing from the LPRNG distribution is a means of starting lpd on boot under systemd. However, I have constructed an lpd service file, called lpd.service. This can be installed and activated using the usual systemd commands. This file needs to be edited by hand before installation to get the location of lpd right.

8.3  Installation

8.4  Arch package

Note that I have put an LPRNG package on the Arch AUR, so you don’t have to compile it yourself! See the AUR page at the Arch website.

8.5  Print server setup

8.6  The printcap file and filters

The printcap file defines the available printers and controls how they are used. Consult the LPRNG documentation for further information. The current printcap file on kestrel is given here as an example of a server printcap, and the printcap file for loro client machines is given here to show how to construct client printcaps.

LPRNG employs filter programs to convert to a format that the printer can read. There are packages available to do this, including foomatic, apsfilter, and magic filter, but for maximum control, I have invented two filters to deal with postscript printers. These filters print postscript files directly and convert pdf and text files to postscript before printing. The filter psfilter-d.sh prints duplex files while the filter psfilter-s.sh prints simplex files. Note that printers should be set to single sided printing by default - otherwise, single sided printing won’t work.

8.7  CUPS and LPRNG together

Generally CUPS and LPRNG packages conflict and cannot be installed together. However, if a special version of LPRNG is compiled which puts executables in a hidden location not in the normal path, LPRNG can be used as a print server with a client-only configuration of CUPS which sends its print jobs to LPRNG. However, this doesn’t work if a printer is physically attached to the machine, as CUPS aggressively tries to attach to it, creating a deadlock with LPRNG. For network printers this appears not to be an issue. (Maybe CUPS can be house trained in this regard, but currently I don’t know how to do this.)

9  Desktop managers

Note: Be sure to delete any .xinitrc and .xsession files that you have in your home directory. With current versions of systemd, these files can interfere with the operation of LXDM and LightDM.

10  Desktop environments

11  Drawing packages on Linux

12  Making Arch packages for AUR


This document was translated from LATEX by HEVEA.