Showing posts from March, 2021

The Everywhere Cloud

Deploy an instance.
Accelerate your application.

Running Home Assistant on FreeBSD Servers

Home Assistant is an open-source home automation system powered by Python, primarily intended to run on single-board computers like the Raspberry Pi, with Linux as the host operating system. The following procedure shows how to run Home Assistant Core on FreeBSD servers, on either physical or virtual machines. ========== 1. PREPARING THE SERVER 1.1. Update the package list and upgrade the existing packages. root@host: # pkg update && pkg upgrade -y 1.2. Install Python and other required packages. root@host: # pkg install python38 py38-sqlite3 openssl autoconf libffi rust 1.3. Create a system account with disabled login (-w no), a dedicated home directory (-m), and some informational text (-c comment). root@host: #  pw useradd homeassistant -w no -m -c "Home Assistant" 1.3.1. If groups for hardware input/output are present, append the system account. Else, skip this step for now. root@host: #  pw groupmod gpio -m homeassistant root@host: #  pw groupmod i2c -m homeassis

Running FreeBSD Commands at Startup

The following procedure enables FreeBSD programs to start automatically after booting, without requiring users to log in first. This method is useful when automating custom daemons to act as servers with user-specific privileges. This is almost identical to the Linux procedure , except for one redirection parameter excluded here. ========== 1. Edit the user crontab file. user@host: $ crontab -e 2. Add the @reboot line with the desired command. # BEGIN CODE @reboot /myfolder/ > /dev/null & # "> /dev/null" discards standard output by redirecting to the null device. # Terminating with "&" executes the command in the background. # END CODE 3. Save and exit crontab, then reboot the machine. ========== The default shell configured in an account's environment variables is used by crontab to process the listed commands. In Linux crontab , the default Bourne Again shell (bash) accepts parameters like "2>&1" which redirects standa