View previous topic :: View next topic |
Author |
Message |
0x006e n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 02 Aug 2023 Posts: 33
|
Posted: Wed Dec 27, 2023 12:33 pm Post subject: How to change the default kill timeout for systemd service |
|
|
I'm using distrobox for managing couple of containers w/ podman. The problem is when I reboot or shutdown of the host computer. It takes about 2 minutes which I believe is the current limit to kill the podman process and shutdown/reboot. So how can I change this timelimit to something reasonable like 15s. I tried changing the /etc/systemd/system.conf(DefaultAbortTimeoutSec) but it does not change anything
Code: |
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (at your option)
# any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file (or a copy of it placed in
# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
# /etc/systemd/system.conf.d/ directory. The latter is generally recommended.
# Defaults can be restored by simply deleting the main configuration file and
# all drop-ins located in /etc/.
#
# Use 'systemd-analyze cat-config systemd/system.conf' to display the full config.
#
# See systemd-system.conf(5) for details.
[Manager]
#LogLevel=info
#LogTarget=journal-or-kmsg
#LogColor=yes
#LogLocation=no
#LogTime=no
#DumpCore=yes
#ShowStatus=yes
#CrashChangeVT=no
#CrashShell=no
#CrashReboot=no
#CtrlAltDelBurstAction=reboot-force
#CPUAffinity=
#NUMAPolicy=default
#NUMAMask=
#RuntimeWatchdogSec=off
#RuntimeWatchdogPreSec=off
#RuntimeWatchdogPreGovernor=
#RebootWatchdogSec=10min
#KExecWatchdogSec=off
#WatchdogDevice=
#CapabilityBoundingSet=
#NoNewPrivileges=no
#SystemCallArchitectures=
#TimerSlackNSec=
#StatusUnitFormat=description
#DefaultTimerAccuracySec=1min
#DefaultStandardOutput=journal
#DefaultStandardError=inherit
#DefaultTimeoutStartSec=90s
#DefaultTimeoutStopSec=90s
DefaultTimeoutAbortSec=15s
#DefaultDeviceTimeoutSec=90s
#DefaultRestartSec=100ms
#DefaultStartLimitIntervalSec=10s
#DefaultStartLimitBurst=5
#DefaultEnvironment=
#DefaultCPUAccounting=yes
#DefaultIOAccounting=no
#DefaultIPAccounting=no
#DefaultMemoryAccounting=yes
#DefaultTasksAccounting=yes
#DefaultTasksMax=15%
#DefaultLimitCPU=
#DefaultLimitFSIZE=
#DefaultLimitDATA=
#DefaultLimitSTACK=
#DefaultLimitCORE=
#DefaultLimitRSS=
#DefaultLimitNOFILE=1024:524288
#DefaultLimitAS=
#DefaultLimitNPROC=
#DefaultLimitMEMLOCK=8M
#DefaultLimitLOCKS=
#DefaultLimitSIGPENDING=
#DefaultLimitMSGQUEUE=
#DefaultLimitNICE=
#DefaultLimitRTPRIO=
#DefaultLimitRTTIME=
#DefaultMemoryPressureThresholdSec=200ms
#DefaultMemoryPressureWatch=auto
#DefaultOOMPolicy=stop
#DefaultSmackProcessLabel=
#ReloadLimitIntervalSec=
#ReloadLimitBurst=
|
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
alamahant Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
Joined: 23 Mar 2019 Posts: 3950
|
Posted: Wed Dec 27, 2023 4:47 pm Post subject: |
|
|
Try
DefaultTimeoutStopSec=15s _________________
![Smile :)](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
pingtoo Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/gallery/Star Wars/movie_star_wars_storm_trooper.gif)
Joined: 10 Sep 2021 Posts: 1486 Location: Richmond Hill, Canada
|
Posted: Wed Dec 27, 2023 6:39 pm Post subject: |
|
|
0x006e,
I don't use podman but my understanding is podman do everything docker can do so,
I think in your case it is not service stop timeout is causing delay, it is more of container not stopped in time. In docker there is a global configuration directive to container dockerd to cause it forcefully stop container. may be you can check into where podman do that. I believe at least podman have --timeout command line option to cause per container stop delay. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
0x006e n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 02 Aug 2023 Posts: 33
|
Posted: Thu Dec 28, 2023 3:26 am Post subject: |
|
|
alamahant wrote: | Try
DefaultTimeoutStopSec=15s |
I have tried this, unfortunately doesn't work for me.
pingtoo wrote: | 0x006e,
I don't use podman but my understanding is podman do everything docker can do so,
I think in your case it is not service stop timeout is causing delay, it is more of container not stopped in time. In docker there is a global configuration directive to container dockerd to cause it forcefully stop container. may be you can check into where podman do that. I believe at least podman have --timeout command line option to cause per container stop delay. |
When I manually run podman stop, it SIGKILLs in 10s which is the default timeout. So I am not sure why systemd takes it 1.30 minutes. I've found a github issue in which this issue is mentioned but the solution it has is to reduce systemd timeout and that fedora does this nowadays.
https://github.com/containers/podman/issues/14531 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|