Change:
Despite beeing installed for a few days now: it seems like the uptimed service does not find its database properly and prints just the current uptime. I guess this is because the database file gets recreated every boot. But that's only a shot into the blue guess. System: 17.03pre99626. (Gorilla) Nix version: nix-env (Nix) 1.11.6 Nixpkgs version: "17.03pre99626."
Some logs from the journal: Pinging maintainers of the service (there is no maintainer in the pkg):
Probably a permission problem or the said directory does not exists.
Yep, looks like it,... though I have no time to investigate, so I'll just leave this here and hope it gets fixed.
In the meantime you can use this one instead:
:smile:
Still no love for this?
Still no love for this?
Does the following (untested) code help?
Tried yours and but fails with: tested on System: 18.03pre124015. (Impala) Nix version: nix-env (Nix) 1.11.16 Nixpkgs version: "18.03pre124015." Sandboxing enabled: build-use-sandbox = true (diff applied on )
It seems that it did not saved my updated change (I forgot to prefix first)
I know nothing about , sorry.
close as unresolved?
Closed as unresolved.
The issue is still present under 18.09 and (I presume) as  does not seem to contain any of the changes proposed here. Why is this issue closed?
Because I do not care anymore and nobody else seems to care either. Do you want me to reopen?
I probably do. I have some extra details on the issue: So it seems that the user cannot write to the directory even though it owns it.
It seems that is a workaround. Not sure about its safety though.
So now it works, but in a roundabout way: The next steps are making the directory world-readable and bringing into user scope.
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly: for maintainers and people that previously touched the related code and @ mention them in a comment. on the . on the on .
As people seemed to interested in this and it is a bug: still important to me
Should be made a tmpfiles rule or if possible changed to /var/lib/uptime, in which case we can set .
I marked this as stale due to inactivity. &rarr;

Discussion:
</listitem> </itemizedlist> </listitem> <ins> <listitem> <para> <literal>services.uptimed</literal> now uses <literal>/var/lib/uptimed</literal> as its stateDirectory instead of <literal>/var/spool/uptimed</literal>. Make sure to move all files to the new directory. </para> </listitem> </ins> </itemizedlist> </section> <section xml:id="sec-release-21.11-notable-changes">

- `CoenraadS.bracket-pair-colorizer` -> `coenraads.bracket-pair-colorizer` - `golang.Go` -> `golang.go` <ins> - `services.uptimed` now uses `/var/lib/uptimed` as its stateDirectory instead of `/var/spool/uptimed`. Make sure to move all files to the new directory. </ins> ## Other Notable Changes {#sec-release-21.11-notable-changes} - The setting [`services.openssh.logLevel`](options.html#opt-services.openssh.logLevel) `"VERBOSE"` `"INFO"`. This brings NixOS in line with upstream and other Linux distributions, and reduces log spam on servers due to bruteforcing botnets.

let cfg = config.services.uptimed; <del> stateDir = "/var/spool/uptimed"; </del> <ins> stateDir = "/var/lib/uptimed"; </ins> in { options = {

}; config = mkIf cfg.enable { <ins> environment.systemPackages = [ pkgs.uptimed ]; </ins> users.users.uptimed = { description = "Uptimed daemon user"; home        = stateDir; <del> createHome  = true; </del> uid         = config.ids.uids.uptimed; <ins> group       = "uptimed"; </ins> }; <ins> users.groups.uptimed = {}; </ins> systemd.services.uptimed = { unitConfig.Documentation = "man:uptimed(8) man:uprecords(1)";

PrivateTmp              = "yes"; PrivateNetwork          = "yes"; NoNewPrivileges         = "yes"; <del> ReadWriteDirectories    = stateDir; </del> <ins> StateDirectory          = [ "uptimed" ]; </ins> InaccessibleDirectories = "/home"; ExecStart               = "${pkgs.uptimed}/sbin/uptimed -f -p ${stateDir}/pid"; };

nativeBuildInputs = [ autoreconfHook ]; patches = [ ./no-var-spool-install.patch ]; <ins> postPatch = '' substituteInPlace libuptimed/urec.h  --replace /var/spool /var/lib ''; </ins> meta = with lib; { description = "Uptime record daemon"; longDescription = ''