Skip to content

feeadjuster: the daily timer unit hardcodes the clightning user and leaves the data directory unquoted #138

Closed

Description

@ostermayer

modules/clightning-plugins/feeadjuster.nix runs the daily feeadjust call from its own oneshot unit, but the unit names the user by hand instead of taking it from the clightning module:

serviceConfig = {
  Type = "oneshot";
  User = "clightning";
  ExecStart = "${clightning.package}/bin/lightning-cli --lightning-dir ${clightning.dataDir} feeadjust";
};

services.clightning.user is a configurable option, and modules/clightning.nix runs lightningd as cfg.user and keeps the data directory at 0770 cfg.user:cfg.group. An operator who sets a different user name gets a timer unit that either fails to start, because the literal clightning account doesn't exist, or runs as an unrelated account that can't reach the RPC socket. Either way the daily fee adjustment silently stops, and adjustDaily is the only thing that unit does. It's the only hardcoded service user left in modules/ (git grep 'User = "' finds no other).

The same line also interpolates ${clightning.dataDir} into ExecStart without quotes, so a data directory with a space in its path splits into two arguments and the call fails too.

Fix: User = clightning.user; and ExecStart = "${clightning.package}/bin/lightning-cli --lightning-dir '${clightning.dataDir}' feeadjust";. The JoinsNamespaceOf and requisite lines are right as they are.

I can send that PR if you want it.

Found by GLM 5.3 at max thinking in the review of master dbeb545. GPT-6 Astra, run at xhigh reasoning as the second opinion, confirmed it and rated it low, and added the quoting point. I checked both against the module.

Activity

  1. added
    area: modules
    type: bug
    on Oct 23, 2026
  2. added a commit that references this issue on Oct 27, 2026
    d9949c9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: modulestype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions