manage.flexfs
manage.flexfs is an optional host management utility for flexFS. It manages flexFS systemd services, downloads and installs binary updates to /sbin, and provides log monitoring. Because it works with system services and folders, all subcommands except init creds, deinit creds, deploy, version, and license must be run as root. FlexFS servers and mount clients do not need manage.flexfs or root to run.
It works with both Enterprise and Community editions.
Subcommands
Section titled “Subcommands”| Subcommand | Description |
|---|---|
init creds | Initialize credentials (custom download server) |
deinit creds | Remove credentials file |
start | Start flexFS systemd services |
stop | Stop flexFS systemd services |
restart | Stop and start services |
status | Show status of flexFS services |
clean | Remove flexFS temporary files from /tmp |
download | Download flexFS binaries to /tmp |
install | Install binaries from /tmp to /sbin |
deploy | Deploy mount client binaries to staging/production channels |
upgrade | Full upgrade: clean, download, install, then restart the upgraded services |
watch | Follow journal logs for a service |
version | Print the build version |
license | Print license information |
Credential Initialization
Section titled “Credential Initialization”By default, manage.flexfs downloads binaries from get.flexfs.io. To use a custom download server, initialize a credentials file. download, install, and upgrade run as root and by default read root’s file (/root/.flexfs/manage/creds), so create it with sudo:
sudo manage.flexfs init creds --downloadAddr download.internal:443See manage.flexfs init creds for its flags and their defaults.
The credentials file is a TOML file written with 0600 permissions:
downloadAddr = "download.internal:443"Commands that download binaries (download, deploy, upgrade, install) read this file automatically, from the home folder of the user running them. deploy run as a user other than root reads that user’s file, so run init creds as that user as well. Their internal --downloadAddr flag overrides the file value.
deinit creds
Section titled “deinit creds”sudo manage.flexfs deinit credsRemoves root’s credentials file created above. After removal, download commands fall back to get.flexfs.io.
Service Management
Section titled “Service Management”Service Order
Section titled “Service Order”manage.flexfs manages seven flexFS systemd services. Services are started in this order and stopped in reverse order, ensuring that dependents are torn down before the services they depend on:
error(flexfs-error.service)stat(flexfs-stat.service)aws(flexfs-aws.service)admin(flexfs-admin.service)free(flexfs-free.service)proxy(flexfs-proxy.service)meta(flexfs-meta.service)
The error service starts first and stops last, so it is available to receive reports for the entire lifetime of the other services.
When no service names are specified, commands operate on all services that have unit files installed. Only services with existing systemd units are acted upon.
Start flexFS systemd services.
sudo manage.flexfs start # Start all installed servicessudo manage.flexfs start meta proxy # Start specific servicesStop flexFS systemd services. Services are stopped in reverse order.
sudo manage.flexfs stop # Stop all installed servicessudo manage.flexfs stop proxy # Stop a specific servicerestart
Section titled “restart”Stop and start services again. Pass --vacuum to also vacuum the system journal logs between the stop and start.
sudo manage.flexfs restartsudo manage.flexfs restart --vacuum # Also vacuum journal logssudo manage.flexfs restart meta # Restart a specific serviceSee manage.flexfs restart for its flags and their defaults.
status
Section titled “status”Show the status and uptime of flexFS services.
sudo manage.flexfs statusOutput shows each installed service with its systemd active state and uptime:
admin active 2d 14h meta active 2d 14h proxy active 2d 14hRemove flexFS temporary files (/tmp/*.flexfs) and optionally vacuum journal logs.
sudo manage.flexfs cleansudo manage.flexfs clean --vacuumSee manage.flexfs clean for its flags and their defaults.
When --vacuum is used, the command runs journalctl --rotate followed by journalctl --vacuum-time=1s to reclaim journal disk space. This deletes the archived logs of every service on the host, not only flexFS.
Binary Management
Section titled “Binary Management”download
Section titled “download”Download flexFS binaries to /tmp. With no binary names, it downloads the binaries installed in /sbin, and fails if there are none. Uses the download server address from the credentials file, or get.flexfs.io by default.
sudo manage.flexfs download admin meta proxy mountsudo manage.flexfs download mount --version v1.9.x --arch amd64sudo manage.flexfs download mount --install # Download and install in one stepSee manage.flexfs download for its flags and their defaults.
Valid binary names: admin, analyze, aws, configure, dedup, error, find, free, license, manage, meta, mount, proxy, stat.
install
Section titled “install”Install flexFS binaries from /tmp to /sbin. When binary names are given as arguments, only those are installed, and any that are missing from /tmp are downloaded automatically.
sudo manage.flexfs install # Install all /tmp/*.flexfssudo manage.flexfs install mount meta proxy # Install specific binaries (downloads missing ones)See manage.flexfs install for its flags and their defaults.
Only staged binaries that are regular files with a single link, owned by root, and not writable by group or others are installed. Any other file is downloaded again when its name was given, and skipped with a message otherwise. Each binary replaces the one in /sbin atomically (moved into place, or copied and then renamed when /tmp is on a different filesystem), so running processes are not affected. SELinux contexts are restored with restorecon where available, or set with chcon otherwise. Installing also removes /sbin/update.flexfs if present, since it is not part of flexFS.
deploy
Section titled “deploy”Deploy the latest mount.flexfs binaries to staging and/or production channels within the admin server’s deploy folder. Mount clients poll the admin server for updates from these channels.
sudo manage.flexfs deploy # Deploy to both channelssudo manage.flexfs deploy --channel staging # Deploy to staging onlysudo manage.flexfs deploy --channel production # Deploy to production onlydeploy writes to the deploy folder under ~/.flexfs/admin in the home folder of the user running it, or under the folder named by --adminPath. It does not itself require root: run it as the user that runs the admin server. On an installer-built host that user is root, so use sudo as shown. When run as root, deploy gives what it deploys the owner and group of the admin folder, so sudo manage.flexfs deploy --adminPath <path> also works for an admin server that runs as another user.
On a host without an admin server, such as a Community installation, deploy prints No admin server found in <path>; nothing to deploy and exits successfully. The admin folder counts as installed once it contains the admin database (db) or the admin credentials file (creds). An --adminPath given on the command line that holds neither is treated as a mistake: deploy exits with an error instead.
See manage.flexfs deploy for its flags and their defaults.
The deploy process downloads both amd64 and aarch64 mount client binaries along with the version file, replaces the channel’s version folder with them, and points the channel’s latest link at its newest version.
upgrade
Section titled “upgrade”Full upgrade sequence: clean temporary state, download binaries, install them to /sbin, then stop and start only the services whose binaries were upgraded.
sudo manage.flexfs upgrade # Upgrade all installed binariessudo manage.flexfs upgrade mount meta proxy # Upgrade specific binariessudo manage.flexfs upgrade --deploy # Upgrade, then deploy mount.flexfsSee manage.flexfs upgrade for its flags and their defaults.
When no binary names are specified, upgrade scans /sbin for existing flexFS binaries and upgrades all of them.
With --deploy, upgrade runs the equivalent of deploy once the upgrade completes, deploying mount.flexfs for the same --version it just installed. The --channel and --adminPath flags control that deploy step. On a host without an admin server, the deploy step does nothing and the upgrade still succeeds.
Log Monitoring
Section titled “Log Monitoring”Follow the systemd journal logs for a flexFS service in real time.
sudo manage.flexfs watch metasudo manage.flexfs watch admin --lines 50 --catSee manage.flexfs watch for its flags and their defaults.
Valid service names: admin, aws, error, free, meta, proxy, stat.
version
Section titled “version”Print the build version.
manage.flexfs version