From 27e4608d56c8c9e039d8f2a74301bd21b6eec82b Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 10 Oct 2022 15:23:12 +0200 Subject: [PATCH] change default service stop timeout to 10s --- CHANGELOG.md | 8 ++++++++ data/common.yaml | 1 + manifests/init.pp | 4 ++++ templates/thumbor.systemd.erb | 1 + 4 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3ff8f9..309b1a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Added +* add new parameter `$service_timeout` + +### Changed +* change default service stop timeout to 10s + ## [v2.1.1] - 2022-08-30 ### Fixed diff --git a/data/common.yaml b/data/common.yaml index d387f82..a016b0b 100644 --- a/data/common.yaml +++ b/data/common.yaml @@ -26,6 +26,7 @@ thumbor::python_config: venv: 'present' version: 'python3' thumbor::security_key: ~ +thumbor::service_timeout: 10 thumbor::statefile: 'thumbor.version' thumbor::update_enabled: true thumbor::user: 'thumbor' diff --git a/manifests/init.pp b/manifests/init.pp index a29bf3b..c359a43 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -58,6 +58,9 @@ # @param security_key # Security key to use in thumbor, default undef # +# @param service_timeout +# Configures the wait time for service commands. + # @param statefile # This file contains the version information, it is internally used to determine if a venv upgrade is necessary # @@ -94,6 +97,7 @@ Variant[Array[String],String] $ports, Hash $python_config, Optional[String] $security_key, + Integer $service_timeout, String $statefile, Boolean $update_enabled, String $user, diff --git a/templates/thumbor.systemd.erb b/templates/thumbor.systemd.erb index 9670a8b..1f43b0e 100644 --- a/templates/thumbor.systemd.erb +++ b/templates/thumbor.systemd.erb @@ -11,6 +11,7 @@ WorkingDirectory=<%= scope.lookupvar('thumbor::cfg_path') %> ExecStart=<%= scope.lookupvar('thumbor::bin_path') -%>/bin/thumbor -c "<%= scope.lookupvar('thumbor::cfg_path') -%>/thumbor.conf" -k "<%= scope.lookupvar('thumbor::cfg_path') -%>/thumbor.key" -i "<%= scope.lookupvar('thumbor::listen') -%>" -p "%i" User=<%= scope.lookupvar('thumbor::user') %> Group=<%= scope.lookupvar('thumbor::group') %> +TimeoutStopSec=<%= scope.lookupvar('thumbor::service_timeout') %> [Install] WantedBy=multi-user.target