CrushMFT on a Raspberry Pi#
The server runs on a Raspberry Pi as it does on any Linux machine. A Pi makes a small file server for an office or a workshop, a drop box at a remote site, or a machine that reacts to switches and sensors: the server's jobs can read and set the Pi's pins.
What you need#
| the Pi | a model with a 64-bit processor and at least 2 GB of memory. More memory and a Pi 4 or 5 for more than a handful of users. |
| the system | Raspberry Pi OS, 64-bit. The 32-bit system has no current Java. |
| Java | version 21 at least; 25 or later is recommended. The server says so at start if it is older: "CrushMFT 27 requires Java 21 or later (Java 25 or later is recommended)." Take a build for 64-bit ARM (aarch64). |
| storage | the SD card for the system; an SSD or disk on USB for the files and the server's folder. SD cards are slow and wear out under a server's constant small writes. |
| power | the official supply. A Pi that browns out corrupts its card. |
Installing#
It is the Linux installation, described in full in Install on Linux and The Linux service:
-
Unpack the server into a folder on the SSD.
-
Open
crushmft_init.shin that folder and look at the lines near the top:Line Set JAVA="java"leave, if java -versionshows a current Java; otherwise the full path to oneJAVA_OPTS="-Xmx512m …"the first option is the server's most memory. On a Pi with 4 GB, -Xmx1gor-Xmx2g. Leave memory for the system.CRUSH_USER="root"the account the server runs as. Another account cannot open ports below 1024: see below. -
As root:
./crushmft_init.sh installmakes the service, so that the server starts with the Pi.start,stop,restartandstatusdo what they say. -
Open the admin pages in a browser on another machine and go on as on any server.
Ports below 1024#
Running as an ordinary account is safer, and such an account may not open ports 21, 22, 80 or 443. Let the server listen on high ports and redirect:
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 21 -j REDIRECT --to-ports 2121
and the same for the others. Make the rules permanent with the tool your system has for that.
What a Pi can carry#
A Pi is a small machine, and encrypting transfers is processor work.
| Fine | Too much |
|---|---|
| a dozen people sharing files, over the local network | hundreds of users at once |
| a partner dropping files by SFTP a few times an hour | large encrypted transfers in parallel all day |
| jobs that move, rename and mail | making previews of many pictures or videos |
| the files on a USB SSD | the files on the SD card, or on a network share over Wi-Fi |
Use the cabled network. Keep the Pi cool: a Pi that gets hot slows itself down.
The pins#
A job can work with the Pi's GPIO pins through the RaspberryPi task: set a pin, read one, or wait for a button to be pressed.
| With it | For example |
|---|---|
| a file arrives → a pin goes high | a lamp or a buzzer that says "delivery" |
| a button is pressed → a job runs | "send today's files now", for somebody who has no screen |
| a sensor's pin → a mail | a door contact, a float switch |
| a relay on a pin, set by a schedule | switching a device at given times |
The task uses the system's own tool for pins, pinctrl, which current Raspberry Pi OS has. Pins are named by their GPIO numbers.
The task runs where the job runs. Jobs run in the job engine on the same machine unless you set it otherwise, so on a single Pi nothing has to be arranged. Where the server is elsewhere and only the pins are on a Pi, run a job engine on the Pi: Engines on other machines.
Looking after it#
- Back up the server's folder to another machine. A Pi's storage fails more often than a server's.
- Updates of the system can be set to install by themselves. Restart at a quiet hour.
- The clock. A Pi has no battery clock: it takes the time from the network at start. Without network time, certificates and logs have wrong dates. Let it reach a time server.
- Shut it down properly. Pulling the plug is how cards and file systems break.
Not tried for this page#
The server was not installed on a Raspberry Pi for this page, and the RaspberryPi task was not run on one. What the start script does is read from the script; what the task does is on its own page.