Skip to content

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.

SubcommandDescription
init credsInitialize credentials (custom download server)
deinit credsRemove credentials file
startStart flexFS systemd services
stopStop flexFS systemd services
restartStop and start services
statusShow status of flexFS services
cleanRemove flexFS temporary files from /tmp
downloadDownload flexFS binaries to /tmp
installInstall binaries from /tmp to /sbin
deployDeploy mount client binaries to staging/production channels
upgradeFull upgrade: clean, download, install, then restart the upgraded services
watchFollow journal logs for a service
versionPrint the build version
licensePrint license information

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:

Terminal window
sudo manage.flexfs init creds --downloadAddr download.internal:443

See 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.

Terminal window
sudo manage.flexfs deinit creds

Removes root’s credentials file created above. After removal, download commands fall back to get.flexfs.io.

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:

  1. error (flexfs-error.service)
  2. stat (flexfs-stat.service)
  3. aws (flexfs-aws.service)
  4. admin (flexfs-admin.service)
  5. free (flexfs-free.service)
  6. proxy (flexfs-proxy.service)
  7. 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.

Terminal window
sudo manage.flexfs start # Start all installed services
sudo manage.flexfs start meta proxy # Start specific services

Stop flexFS systemd services. Services are stopped in reverse order.

Terminal window
sudo manage.flexfs stop # Stop all installed services
sudo manage.flexfs stop proxy # Stop a specific service

Stop and start services again. Pass --vacuum to also vacuum the system journal logs between the stop and start.

Terminal window
sudo manage.flexfs restart
sudo manage.flexfs restart --vacuum # Also vacuum journal logs
sudo manage.flexfs restart meta # Restart a specific service

See manage.flexfs restart for its flags and their defaults.

Show the status and uptime of flexFS services.

Terminal window
sudo manage.flexfs status

Output shows each installed service with its systemd active state and uptime:

admin active 2d 14h
meta active 2d 14h
proxy active 2d 14h

Remove flexFS temporary files (/tmp/*.flexfs) and optionally vacuum journal logs.

Terminal window
sudo manage.flexfs clean
sudo manage.flexfs clean --vacuum

See 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.

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.

Terminal window
sudo manage.flexfs download admin meta proxy mount
sudo manage.flexfs download mount --version v1.9.x --arch amd64
sudo manage.flexfs download mount --install # Download and install in one step

See 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 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.

Terminal window
sudo manage.flexfs install # Install all /tmp/*.flexfs
sudo 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 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.

Terminal window
sudo manage.flexfs deploy # Deploy to both channels
sudo manage.flexfs deploy --channel staging # Deploy to staging only
sudo manage.flexfs deploy --channel production # Deploy to production only

deploy 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.

Full upgrade sequence: clean temporary state, download binaries, install them to /sbin, then stop and start only the services whose binaries were upgraded.

Terminal window
sudo manage.flexfs upgrade # Upgrade all installed binaries
sudo manage.flexfs upgrade mount meta proxy # Upgrade specific binaries
sudo manage.flexfs upgrade --deploy # Upgrade, then deploy mount.flexfs

See 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.

Follow the systemd journal logs for a flexFS service in real time.

Terminal window
sudo manage.flexfs watch meta
sudo manage.flexfs watch admin --lines 50 --cat

See manage.flexfs watch for its flags and their defaults.

Valid service names: admin, aws, error, free, meta, proxy, stat.

Print the build version.

Terminal window
manage.flexfs version