Systemd default Timeout not working

Hello

I since i updated my system, i need to wait 1 to 2 Minutes at a shutdown/reboot for systemd to stop User Manager UID 1000.
I then wanted to set the timeout to 5 sec:

  systemd = {                                                                                                               
    extraConfig = ''                                                                                                        
      DefaultTimeoutStopSec=5s'';                                                                                           
    user.extraConfig = ''                                                                                                   
      DefaultTimeoutStopSec=5s'';                                                                                           
  };  

But everytime i reboot or shutdown my computer it still has a timer of 2 Minutes.

This is my /etc/systemd/system.conf:

ManagerEnvironment=LOCALE_ARCHIVE='/run/current-system/sw/lib/locale/locale-archive' PATH='/nix/store/c4j8is15x7zh1lvv6fikv8b9hm877vr9-dosfstools-4.2/bin:/nix/store/m63ci4axfiai59lzyjsxypgi90pcpdaj-mtools-4.0.44/bin:/nix/store/m3va2q8rlyvacgcz8m9x6lb5rb8qchr3-e2fsprogs-1.47.1-bin/bin:/nix/store/c4j8is15x7zh1lvv6fikv8b9hm877vr9-dosfstools-4.2/bin:/nix/store/6zs08dfkxmn8mzkya3a8wsn4sm7a67cx-util-linux-minimal-2.39.4-bin/bin' TZDIR='/etc/zoneinfo'
DefaultCPUAccounting=yes
DefaultIOAccounting=yes
DefaultBlockIOAccounting=yes
DefaultIPAccounting=yes

DefaultLimitCORE=infinity





DefaultTimeoutStopSec=5s

System:
NixOS 24.11.20240821.c374d94 (Vicuna) x86_64
Kernel: Linux 6.10.6

Any help is very appreciated.
Thank you

Could you post a screenshot, please?

Of what
The shutdown process?
Somehow the problem got better.
I now only wait 6 seconds on every shutdown.
But the Timeout is still not working

Yes. I’d like to make sure we’re talking about the same thing.

so i wanted to take a picture of the shutdown process.
But to my suprise it only took about one second and my pc was out.
I don’t know how or what i did but it seems that the reason, I had for the problem I posted this here, is solved.

1 Like

DefaultTimeoutStopSec may get overrided by the service, the DefaultTimeoutStopSec is 90s in systemd, your service is 120s so the configuration is not used.
you need to find the service name and override the service config

1 Like