Skip to content

Commit

Permalink
Stop the container gracefully, instead of outright killing it
Browse files Browse the repository at this point in the history
  • Loading branch information
spantaleev committed Dec 6, 2023
1 parent 932ef11 commit fd9867a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/gitea.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DefaultDependencies=no
[Service]
Type=simple
Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} kill {{ gitea_identifier }} 2>/dev/null'
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} {{ gitea_identifier }} 2>/dev/null'
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm {{ gitea_identifier }} 2>/dev/null'

ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
Expand Down Expand Up @@ -40,7 +40,7 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network conne

ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach {{ gitea_identifier }}

ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} kill {{ gitea_identifier }} 2>/dev/null'
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} {{ gitea_identifier }} 2>/dev/null'
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm {{ gitea_identifier }} 2>/dev/null'
Restart=always
RestartSec=30
Expand Down

0 comments on commit fd9867a

Please sign in to comment.