emfor is an open-source health-check daemon that runs on every application host. It checks the backends of the services your applications use and writes which ones are healthy into a local file; applications ask a client library which backend to connect to and get an answer in about a microsecond, without a network round trip.
0.7.0 was released on 2026-11-22. 0.6.0 was about running emfor next to the tools you already have; this release is about what the daemon and its files trust. It follows a self-assessment against a security checklist and a review of the whole system: the check programs a daemon starts get a small environment, the files it reads and writes are held to stricter rules, and a few places where one slow or wrong input could stall or confuse it are fixed. Several of these are compatibility changes: each tightens a default, and an install that relied on the old behaviour needs one line of config. Read section 1 before you upgrade.
1. Before you upgrade
The store format (version 2) and the plugin protocol (1) are unchanged: clients and plugins of 0.6.0 keep working with this daemon. libemfor is now libemfor.so.0.7, so rebuild or reinstall what links against it. Six things can stop an install that relied on the old behaviour; run emfor check-config with the new binary, as the daemon’s user, on every host first, because it reports most of them.
execchecks and plugins get a small environment. A check program that readsHOME, a proxy variable or the like now needsenv_pass(section 2).check-configdoes not warn about this one.- The store files are
0640and0660by default (they were0644and0666). An application user that is not in the daemon’s group getsUNAVAILABLEfrom the client. Add the user to the group (usermod -aG emfor <user>), or writefile_mode = "0644"andlock_file_mode = "0666"under[store]to keep the old behaviour. - A daemon that encrypts peer messages drops plaintext ones by default. If a group still has members with
encrypt = falseor on 0.3.0, give the hosts that encrypt an explicitaccept_plaintext = trueuntil every member encrypts. A host on 0.3.0 or 0.4.0 does not know that key, so it goes in the same config change as the upgrade there; on 0.5.0 or 0.6.0 it goes in before the upgrade. - A peer secret file must be owned by root or by the user that runs emfor. Whoever owns a file can rewrite it, whatever its mode says.
chown root:emforit on every host before you upgrade. - The main config file is checked like the files of
include_dir: not writable by group or others, owned by root or the user that runs emfor. The deb, rpm and FreeBSD port install it that way. A file with mode0664stops the daemon at start untilchmod g-w,o-w /etc/emfor/emfor.toml. previous_secret_fileis used only for the secret the daemon replaced. It is no longer used just because the current file was touched within 120 seconds (section 4). The first start of 0.7.0 has no record yet, so it ignores the option once.
2. exec checks and plugins no longer get the daemon’s whole environment
A program that an exec check or a plugin starts used to inherit every variable of the daemon’s environment, so a secret set there (by a unit file, for example) reached every check program. It now gets only PATH, LANG, TZ and the LC_* variables, with the daemon’s values, and exec also gets EMFOR_IP, EMFOR_PORT and EMFOR_SERVICE.
The new env_pass is a list of variable names, never values, in the check_options of an exec check and in [plugins."<name>"]. It adds variables the daemon has; a name the daemon does not have is skipped. Changing a plugin’s env_pass restarts the plugin on reload, like changing its command, and the names are part of the check definition that peers compare, so the hosts of a group must list the same names for a service. emfor-check also reads SSL_CERT_FILE and SSL_CERT_DIR, to find the system CAs of a TLS check that has no ca_file.
3. Stricter files, and warnings for passwords sent in clear text
- The store files. The lock file holds LMDB’s reader table and the lock the daemon takes for every commit, and it was writable by every local user. The daemon sets the new modes on the existing files at every start.
emfor check-configand the daemon warn, one line per option, about afile_modeorlock_file_modethat other users can write. - The main config file can declare a plugin
command, which runs with the daemon’s rights, as a fragment can; only the fragments were checked. At start a refusal exits with status 2 before the store is opened; at a reload the old config keeps running. - Peer secrets are opened first and the opened file is checked (mode, regular file, owner) and read, so the file cannot be swapped in between and a FIFO named as the secret no longer makes the once-a-second re-read wait. A secret larger than 65536 bytes is a config error (a secret needs 32). The daemon wipes the secret and the keys derived from it from memory when it drops them.
- Warnings, never errors. A
password_file,secret_fileortls_key_filein a check’s options that every user can read or that anyone but its owner can write gets one line naming the services that use it. Apassword_filewithouttlson aredis,ldap,mysql,pgsqloramqpcheck gets a line too. A config that works keeps working. - Invisible characters in a check’s reason (the bidirectional controls such as U+202E, the zero-width characters, the soft hyphen) are escaped as
\u{202e}, and so are the lines a plugin writes to stderr and the name and version in its handshake, so a backend or a plugin cannot forge a log line or makeemfor statusshow a service as something else. A redis server that echoes the AUTH password in an error no longer puts it in the reason, and the reason of a failedhttpcheck no longer holds the request URL, token in its query string included. - The systemd unit sets
UMask=0027,ProtectProc=invisibleandProcSubset=pid, and stops retrying after five failed starts in a minute (an invalid config used to be retried every two seconds without end).systemd-analyze securityrates it 1.5, it was 1.7. A copy of the example unit has to be updated by hand; the packages bring the new one.
4. Fixes
- A late peer message no longer overwrites a newer one. The replay check lets a message that the network delivered late through, if its
seqis within 64 of the highest, and the daemon then kept it as the sender’s latest result, replacing a later one and making the result look fresh again. Each kept result and each member’s tags now remember thebootandseqthey came from, and an older one leaves them alone. The wire format is unchanged. - A retired secret could come back. After a change of secret from K1 to K2 with
previous_secret_filestill holding K0, a restart within 120 seconds signed with K0, and the members that had dropped K0 stopped hearing the host. The daemon now keeps a record of the secrets it has used (a fingerprint, never the secret) in<store path>-peers, mode 0600, and usesprevious_secret_fileonly for the secret it replaced less than 120 seconds ago. - A hung peer secret file no longer stops the peer loop. On a network file system that does not answer, the once-a-second read never returned and the other members saw the host as not live after three seconds while its checks and DNS went on. The read now runs on a blocking thread, and where the system allows it (inotify, kqueue) the file is watched and read when it changes. A hung config file no longer blocks
SIGTERMon a reload either. httpchecks work on a host without CA certificates. Everyhttpcheck was anerrorwithcannot build http client: builder error, even withscheme = "http", because building the client read the system roots for a verifier that a plain request never uses.httpswith verification on still needs the certificates, and its reason now says so.- A client that opens the store while the daemon pads it no longer fails. The daemon commits a write and only then extends the data file to the recorded length, and a client that opened the store in that gap refused it as truncated for one second. It now measures again up to five times, 20 ms apart.
- Smaller ones: a restarted plugin leaves no tasks behind;
libemforon FreeBSD no longer aborts a process that forks while a thread is exiting; the rpm keeps a changed/etc/emfor/emfor.tomlon upgrade (noreplace) instead of replacing it with the packaged one; durations in the config are parsed by emfor itself, because thehumantimecrate is now flagged unmaintained; andexamples/pf/emfor-pf-table.shandexamples/nagios/check_emfor.shcheck what they hand on topfctland to Nagios.
The deploy scripts have a change of their own: emfor-drain.sh and emfor-peers-sync.sh ran emfor check-config as root, and check-config starts the plugins the config declares, so a plugin ran as root outside the service’s sandbox. They now run it as EMFOR_USER (default emfor). There is also a new recipe for a peer group whose hosts come and go: emfor-peers-sync.sh writes [peers] members into a conf.d file from a list of addresses (AWS and Google Cloud examples are in the peer groups chapter of the manual).
5. Known limits
- The pf recipe and the Nagios examples were run on FreeBSD 15.1-RELEASE (arm64, in a VM) after these changes. Not tested: Nagios itself (only its plugins), FreeBSD 13.x and 14.x, poudriere, and the kqueue watch of the peer secret on FreeBSD by hand. Most checks of this release ran in a Debian container; macOS was run only for part of the tests.
- The container check that an
httpcheck works without CA certificates was run once, on Debian 13, and is not part of the test gate. - Environment: the
PATHthat systemd gives the daemon was not checked, and neither were installs whose check programs need variables that nobody here knows about; if one fails after the upgrade, add its variable toenv_pass. - Unchanged from earlier releases: the HAProxy 503 after a
server-templateslot with port 0 on FreeBSD; the deb and rpm tested in containers, the deb also under systemd but not the rpm, not signed and not in any repository; peer messages have no forward secrecy; theldapplugin has been checked against Active Directory only without a certificate; lookup throughput across threads levels off at about two million a second on Linux; with[store] sync = false(the default) a host crash can damage the store; a host announces at most 80 services left out of the peer group.
6. How to upgrade
- Run
emfor check-configas the daemon’s user with the 0.7.0 binary on the config of every host before you upgrade it (section 1). - Before the upgrade:
chown root:emforthe peer secret files, put application users into the daemon’s group (or set the old store modes), and addaccept_plaintext = truewhere a group still has plaintext members. Look at everyexeccheck and plugin that needs a variable of the daemon’s environment and give it anenv_pass. - Install
libemforand the daemon from 0.7.0, host by host. Once every member hasencrypt = trueand theplaintextcount inemfor_peer_messages_rejected_totalstops increasing, removeaccept_plaintext = trueagain and reload.
The user manual on this site is rewritten for 0.7.0. The full list of changes is in the CHANGELOG, and the source is in the v0.7.0 release on GitHub.
💡 Technical collaboration and architecture consulting
Are your services struggling with inconsistent health checks, slow failure detection, or check traffic that weighs on your backends? We can help you assess your architecture and adopt the health-check and service-discovery approach that fits.
