ntkme / unifi-systemd-units

:package: Systemd Units for UniFi OS.
https://github.com/ntkme/unifi-systemd
MIT License
20 stars 0 forks source link
container podman systemd ubiquiti udm udm-pro unifi unifi-os

unifi-systemd-units

build

Systemd units for unifi-systemd container

Usage

Install unifi-systemd

Install unifi-systemd.

podman exec unifi-os sh -c "curl -fsSLo /tmp/unifi-systemd_1.0.0_all.deb https://github.com/ntkme/unifi-systemd/releases/download/v1.0.0/unifi-systemd_1.0.0_all.deb && dpkg -i /tmp/unifi-systemd_1.0.0_all.deb && rm /tmp/unifi-systemd_1.0.0_all.deb"

Install systemd Units

Install systemd units from this repository to /mnt/data/etc/systemd/system.

curl -fsSL https://github.com/ntkme/unifi-systemd-units/archive/HEAD.tar.gz | tar -vxzC /mnt/data --strip-components 1 --exclude '*/.github' --exclude '*/docs' --exclude '*/test' --exclude '*/*.md' --exclude '*/LICENSE' && unifi-systemd reload

Manage systemd Units

unifi-systemd is a container that runs systemd and nested podman containers.

Use unifi-systemd shell to enter the container shell to interact with systemctl and podman.

See the links below for documentation of services provided by this repository.

To create a new container service unit, see podman-generate-systemd(1).

Config and Data Directories

Backup

It is recommended to gracefully stop all services with unifi-systemd stop before create a backup. Services can be restarted with unifi-systemd start.

By default, the following directories are used to store config and data.

Store Data on Hard Disk

To store data on hard disk instead of the eMMC, move the directories into /mnt/data_ext and create symlinks on /mnt/data.

unifi-systemd stop
mv /mnt/data/etc /mnt/data_ext/etc && ln -s /mnt/data_ext/etc /mnt/data/etc
mv /mnt/data/var /mnt/data_ext/var && ln -s /mnt/data_ext/var /mnt/data/var
unifi-systemd start

Migrating from udm-boot

To migrate from udm-boot, please install unifi-systemd and unifi-systemd-units first.

podman exec unifi-os dpkg -P udm-boot
podman exec unifi-systemd systemctl enable unifi-entrypoint@mnt-data-on_boot.d.service