{"id":340692,"date":"2022-11-03T03:00:04","date_gmt":"2022-11-03T03:00:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=340692"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=340692","title":{"rendered":"<span>systemd: \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u044e\u043d\u0438\u0442\u044b \u0441 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u044b\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u0439 \u0435\u0449\u0451 \u043f\u043b\u044f\u0441\u043a\u043e\u0439 \u0441 \u0431\u0443\u0431\u043d\u043e\u043c. \u0412 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0438\u0440\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u043b\u0441\u044f \u0431\u044b \u044e\u043d\u0438\u0442\u043e\u043c <code>systemd<\/code>. <code>ExecStart<\/code> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0430 \u0431\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0439 <code>SIGTERM<\/code>, \u0430 <code>ExecStop<\/code> \u043e\u043f\u043e\u0432\u0435\u0449\u0430\u043b\u043e \u0431\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u043b\u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u043b\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438 \u0435\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u044b.<\/p>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043c\u043d\u043e\u0433\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u0430 \u0442\u043e \u0438 \u0432\u043e\u0432\u0441\u0435 \u0441\u0431\u0438\u0432\u0430\u044e\u0442 \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0438. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 <code>systemd<\/code> \u043f\u0440\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044e\u043d\u0438\u0442\u043e\u0432 <code>systemd<\/code> \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u043e\u0439 \u043e\u0447\u0438\u0441\u0442\u043a\u0438 (custom cleanup) \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435\u043c. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u2014 \u043a <u><a href=\"https:\/\/skillfactory.ru\/devops-ingineer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_devops_031122&amp;utm_term=lead\">\u0441\u0442\u0430\u0440\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u0443\u0440\u0441\u0430 \u043f\u043e DevOps<\/a><\/u>.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"systemd\">systemd<\/h2>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 <code>init<\/code>, <code>systemd<\/code> \u043d\u0430\u0440\u044f\u0434\u0443 \u0441\u043e \u043c\u043d\u043e\u0433\u0438\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u2014 \u043e\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0434\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b. \u041f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043e\u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u043e\u0439, \u0430 \u043f\u0440\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0438 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u043d\u043d\u0438\u0445 <strong>\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 (sequential scripts)<\/strong> \u0441\u0435\u0440\u0432\u0438\u0441\u044b <code>systemd<\/code> \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043d\u0430 <em>\u044e\u043d\u0438\u0442\u044b<\/em> <code>systemd<\/code>. \u0418\u0445 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043d\u0430 <em>\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/em> \u0438 <em>\u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u043d\u0438\u0438<\/em>. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c (\u0438\u043b\u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c) \u043c\u043d\u043e\u0433\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b <strong>\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e<\/strong>. \u0412\u0441\u0451 \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0421\u0435\u0440\u0432\u0438\u0441\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f (\u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f) \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043e \u0438\u043d\u043e\u0435.<\/li>\n<li>\u041f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <code>SIGTERM<\/code> \u0438\u043b\u0438 <code>SIGKILL<\/code> \u043f\u043e \u0438\u0441\u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u0438\u043d\u0430\u0447\u0435.<\/li>\n<li>\u041f\u0440\u0438 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u043e\u0442 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u043d\u0438\u044f (ordering dependency) \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0443.<\/li>\n<\/ul>\n<p>  <\/p>\n<h3 id=\"zavershenie-raboty\">\u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b<\/h3>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b? \u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u0447\u0438\u043d\u0451\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 <code>systemctl<\/code> (subcommands, \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u043d\u0438\u0436\u0435) \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u043d\u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u044e\u0442 <a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.special.html\">\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435<\/a> \u044e\u043d\u0438\u0442\u044b <code>systemd<\/code>: <code>reboot.target<\/code>, <code>poweroff.target<\/code> \u0438 <code>halt.target<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">systemctl halt      # \u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u044b systemctl poweroff  # \u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0438\u0442\u0430\u043d\u0438\u044f systemctl reboot    # \u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 <code>Requires<\/code> \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u044e\u043d\u0438\u0442\u043e\u0432 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043a\u0430\u043a <a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd-reboot.service.html\"><code>systemd-reboot.service<\/code><\/a>, <a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd-poweroff.service.html\"><code>systemd-poweroff.service<\/code><\/a>, \u0438 <a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd-halt.service.html\"><code>systemd-halt.service<\/code><\/a> (\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e), \u0430 \u0442\u0435 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044e\u0442 <a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.special.html#shutdown.target\"><code>shutdown.target<\/code><\/a>.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># reboot.target [Unit] Description=System Reboot Documentation=man:systemd.special(7) DefaultDependencies=no Requires=systemd-reboot.service After=systemd-reboot.service AllowIsolate=yes JobTimeoutSec=30min JobTimeoutAction=reboot-force  [Install] Alias=ctrl-alt-del.target<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">sudo systemctl list-dependencies --all --recursive reboot.target reboot.target \u25cb \u2514\u2500systemd-reboot.service \u25cf   \u251c\u2500system.slice \u25cf   \u2502 \u2514\u2500-.slice \u25cb   \u251c\u2500final.target \u25cb   \u251c\u2500shutdown.target \u25cb   \u2514\u2500umount.target<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0432\u0441\u0435\u0445 \u044e\u043d\u0438\u0442\u043e\u0432 \u0438 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f (scopes) \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e <a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.unit.html#DefaultDependencies=\"><code>DefaultDependencies=yes<\/code><\/a>, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u043b\u044f \u043d\u0438\u0445 \u0432 \u044f\u0432\u043d\u043e\u043c \u0432\u0438\u0434\u0435 <a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.special.html#shutdown.target\">\u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/a> Before=shutdown.target \u0438 Conflicts=shutdown.target. <a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.unit.html#Conflicts=\">Conflicts<\/a> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e <code>shutdown.target<\/code> \u0438 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0443\u044e\u0449\u0438\u0435 \u044e\u043d\u0438\u0442\u044b. \u0417\u0430\u043f\u0443\u0441\u043a <code>shutdown.target<\/code> \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0443\u044e\u0449\u0438\u0435 \u044e\u043d\u0438\u0442\u044b (\u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043e \u0438\u043d\u043e\u0435).<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u044e\u043d\u0438\u0442\u044b <code>systemd<\/code> \u0434\u043e\u043b\u0436\u043d\u044b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0438 \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b. \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 (load balancer) \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0442\u044c \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0432\u043e\u044e \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0433\u043e\u0442\u043e\u0432\u043d\u043e\u0441\u0442\u0438 (readiness endpoint). \u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0434\u0438\u0441\u043a, \u0430 \u0430\u0433\u0435\u043d\u0442 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0443 \u043e \u0441\u0432\u043e\u0451\u043c \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u0433\u0440\u0443\u043f\u043f\u044b. \u041b\u044e\u0431\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f <code>ExecStop<\/code> \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e (\u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e) \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>SIGKILL<\/code> \u0432 systemd (\u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0438\u043d\u044b\u0445 <a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.kill.html#KillMode=\">\u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a<\/a>).<\/p>\n<p>  <\/p>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u0430 \u0442\u043e \u0438 \u0432\u043e\u0432\u0441\u0435 \u0441\u0431\u0438\u0432\u0430\u044e\u0442 \u0432\u0441\u0435 \u0441\u0432\u043e\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 <code>systemd<\/code>. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044e \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u0441 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439. \u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0442\u0438\u043f\u0430 <a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd-analyze.html\">systemd-analyze<\/a> \u043f\u0440\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442. \u0410 \u043c\u043d\u043e\u0433\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043c\u043e\u0433\u0443\u0442 \u0434\u0430\u0436\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0432\u0430\u0448\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435\u043c. \u0412 \u044d\u0442\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u044e\u043d\u0438\u0442\u043e\u0432 \u043f\u043e \u043e\u0447\u0438\u0441\u0442\u043a\u0435 \u043d\u0430 \u0440\u0430\u043d\u043d\u0438\u0445 \u0441\u0442\u0430\u0434\u0438\u044f\u0445 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f (early shutdown units). \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044e\u043d\u0438\u0442\u043e\u0432 <code>systemd<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e \u043e\u0447\u0438\u0441\u0442\u043a\u0435 \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<p>  <\/p>\n<h2 id=\"skript-cleanup\">\u0421\u043a\u0440\u0438\u043f\u0442 Cleanup<\/h2>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 <code>cleanup<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0438\u043c\u0443\u043b\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e \u043e\u0447\u0438\u0441\u0442\u043a\u0435. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 <code>echo<\/code> \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0446\u0438\u043a\u043b \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441, \u0430 <code>sleep<\/code> \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u043b\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u0417\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u0435\u0442\u0438, \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/bash  echo \"cleaning...\" for i in {1..3}; do   sleep 5s   echo \"waiting...\" done  echo \"done\"<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 <code>\/usr\/local\/bin\/cleanup<\/code> \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c. \u0415\u0441\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u0435\u0435 \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0443 <code>systemd 203\/EXEC<\/code>, \u0432\u0435\u0440\u043d\u0438\u0442\u0435\u0441\u044c \u043a \u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0437\u0434\u0435\u043b\u0443.<\/p>\n<p>  <\/p>\n<p>\u041d\u0435 \u043f\u043e\u043c\u0435\u0449\u0430\u0439\u0442\u0435 \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433. \u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 SELinux \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0435 \u0434\u0430\u0451\u0442 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c <code>systemd<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u00ab\u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0435\u00bb \u0441\u043a\u0440\u0438\u043f\u0442\u044b. \u0418 \u044d\u0442\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.<\/p>\n<p>  <\/p>\n<h2 id=\"skript-execstart\">\u0421\u043a\u0440\u0438\u043f\u0442 ExecStart<\/h2>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0431\u043b\u043e\u043a systemd oneshot, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 <code>cleanup<\/code> \u043a\u0430\u043a \u0441\u043a\u0440\u0438\u043f\u0442 <code>ExecStart<\/code>. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0448\u0430 \u043f\u0435\u0440\u0432\u0430\u044f \u0438, \u043a\u0430\u043a \u043c\u044b \u0441\u043a\u043e\u0440\u043e \u0443\u0432\u0438\u0434\u0438\u043c, \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u0430\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># \/etc\/systemd\/system\/clean.service [Unit] Description=Clean on shutdown Before=shutdown.target    # implicit  [Service] Type=oneshot RemainAfterExit=yes ExecStart=\/usr\/local\/bin\/cleanup  [Install] WantedBy=shutdown.target<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u044e\u043d\u0438\u0442 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c <code>shutdown.target<\/code> \u043e\u0442 <code>clean.service<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <code>Before=shutdown.target<\/code> \u043f\u0440\u0438 \u043e\u0442\u0434\u0430\u0447\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>clean.service<\/code> \u043f\u0435\u0440\u0435\u0434 <code>shutdown.target<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.service.html#Type=\">Type=oneshot<\/a>, \u0447\u0442\u043e\u0431\u044b \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u0447\u0438\u0442\u0430\u043b\u0441\u044f \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 (\u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430 \u0434\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043e\u0447\u0438\u0441\u0442\u043a\u0438). <code>RemainAfterExit<\/code> \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u0434\u0430\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u044e\u043d\u0438\u0442\u044b <code>systemd<\/code> (<code>Type=simple<\/code>) \u0441\u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c. \u042d\u0442\u043e, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u044e\u043d\u0438\u0442\u0430\u043c \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u0410\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c <code>clean.service<\/code>, <code>systemctl reboot<\/code>, \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0436\u0443\u0440\u043d\u0430\u043b \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439\u2026<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">Sep 28 23:55:01 ip-10-0-13-150 systemd[1]: Starting clean.service - Clean on shutdown... Sep 28 23:55:01 ip-10-0-13-150 cleanup[6796]: cleaning... -- Boot 8e4734a82c754e549c9a9292ca5988fb --<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434. \u041c\u044b \u043d\u0435 \u0432\u0438\u0434\u0438\u043c \u0434\u0430\u0436\u0435 \u0438\u0441\u0442\u043e\u0440\u0438\u0438. \u0421\u0435\u0440\u0432\u0438\u0441 \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u043e\u0442\u0441\u0440\u043e\u0447\u0438\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b. \u0423 \u043d\u0430\u0441 <code>shutdown.target<\/code> \u0432\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u044e\u043d\u0438\u0442\u0430\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 <code>clean.service<\/code> \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f. \u0412\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <code>DefaultDependencies=no<\/code>, \u043d\u043e, \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c \u0432 <a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.unit.html#Before=\">systemd.unit man pages<\/a>, \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u043d\u0435 \u043e\u0442\u0441\u0440\u043e\u0447\u0438\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b: \u00abGiven two units with any ordering dependency between them, if one unit is shut down and the other is started up, the shutdown is ordered before the start-up\u00bb (\u00ab\u041f\u0440\u0438 \u043b\u044e\u0431\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u044e\u043d\u0438\u0442\u0430\u043c\u0438, \u043e\u0434\u0438\u043d \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443, \u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0435\u0451, \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0440\u0430\u043d\u044c\u0448\u0435\u00bb).<\/p>\n<p>  <\/p>\n<h2 id=\"skript-execstop\">\u0421\u043a\u0440\u0438\u043f\u0442 ExecStop<\/h2>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u044e\u043d\u0438\u0442 oneshot \u0432 <code>systemd<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043e\u0447\u0438\u0441\u0442\u043a\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c <code>ExecStop<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># \/etc\/systemd\/system\/clean.service [Unit] Description=Clean on shutdown After=multi-user.target  [Service] Type=oneshot RemainAfterExit=yes ExecStart=\/bin\/true ExecStop=\/usr\/local\/bin\/cleanup  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u044e\u043d\u0438\u0442 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442\u0441\u044f <code>multi-user.target<\/code>, \u043d\u043e \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 <code>After=multi-user.target<\/code> \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u0437\u0434\u043d\u043e. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0435 (ordered) \u044e\u043d\u0438\u0442\u044b \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u044e\u043d\u0438\u0442 <code>clean<\/code> \u0434\u043e\u043b\u0436\u0435\u043d <em>\u043d\u0430\u0447\u0430\u0442\u044c<\/em> \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u043d\u044c\u0448\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u044e\u043d\u0438\u0442\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0410\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c <code>clean.service<\/code>. \u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u043c, \u0447\u0442\u043e \u043e\u043d <code>active<\/code> (\u0445\u043e\u0442\u044f \u043c\u044b \u0438 \u0432\u044b\u0448\u043b\u0438 \u0438\u0437 \u043d\u0435\u0433\u043e).<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">\u25cf .service - Clean on shutdown      Loaded: loaded (\/etc\/systemd\/system\/clean.service; enabled; vendor preset: disabled)      Active: active (exited) since Thu 2022-09-29 20:21:17 UTC; 2min 49s ago     Process: 1383 ExecStart=\/bin\/true (code=exited, status=0\/SUCCESS)    Main PID: 1383 (code=exited, status=0\/SUCCESS)         CPU: 2ms  Sep 29 20:21:17 ip-10-0-13-150 systemd[1]: Starting clean.service - Clean on shutdown... Sep 29 20:21:17 ip-10-0-13-150 systemd[1]: Finished clean.service - Clean on shutdown.<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 Boot ID \u0432 \u0436\u0443\u0440\u043d\u0430\u043b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 <code>systemctl reboot<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">... -- Boot 0e40d519972b4cd7bc09374b3072788d -- Sep 28 20:18:24 ip-10-0-13-150 systemd[1]: Starting clean.service - Clean on shutdown... Sep 28 20:18:24 ip-10-0-13-150 systemd[1]: Finished clean.service - Clean on shutdown.<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0436\u0443\u0440\u043d\u0430\u043b \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u041a\u043e\u0433\u0434\u0430 \u0431\u044b\u043b\u0430 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u0430 <code>systemctl reboot<\/code>, \u044f \u0443\u043a\u0430\u0437\u0430\u043b \u043f\u043e\u043c\u0435\u0442\u043a\u043e\u0439 ?.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">... Sep 28 20:18:24 ip-10-0-13-150 systemd[1]: Finished clean.service - Clean on shutdown. ? Sep 29 20:20:38 ip-10-0-13-150 systemd[1]: Stopping clean.service - Clean on shutdown... Sep 29 20:20:38 ip-10-0-13-150 cleanup[367051]: cleaning... Sep 29 20:20:43 ip-10-0-13-150 cleanup[367077]: waiting... Sep 29 20:20:48 ip-10-0-13-150 cleanup[367080]: waiting... Sep 29 20:20:53 ip-10-0-13-150 cleanup[367132]: waiting... Sep 29 20:20:53 ip-10-0-13-150 cleanup[367134]: done Sep 29 20:20:53 ip-10-0-13-150 systemd[1]: clean.service: Deactivated successfully. Sep 29 20:20:53 ip-10-0-13-150 systemd[1]: Stopped clean.service - Clean on shutdown. -- Boot 8e97b43271024c64b0775c43dc519c5b -- Sep 29 20:21:17 ip-10-0-13-150 systemd[1]: Starting clean.service - Clean on shutdown... Sep 29 20:21:17 ip-10-0-13-150 systemd[1]: Finished clean.service - Clean on shutdown.<\/code><\/pre>\n<p>  <\/p>\n<p>\u042e\u043d\u0438\u0442 \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443, \u043d\u043e \u0441\u043a\u0440\u0438\u043f\u0442 <code>cleanup<\/code> \u0432 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043e \u043f\u043e\u0431\u0435\u0434\u043d\u043e\u0433\u043e, \u0447\u0442\u043e \u0437\u0430\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430. \u041f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u044e\u043d\u0438\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 (<code>\/bin\/true<\/code>), \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043a\u0430\u043a \u0438 \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c, \u043d\u043e \u0441 \u043e\u0434\u043d\u043e\u0439 \u043e\u0433\u043e\u0432\u043e\u0440\u043a\u043e\u0439. \u0420\u0430\u0431\u043e\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u044e\u043d\u0438\u0442\u043e\u0432 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u0418 \u0432\u043e\u0442 \u0442\u0443\u0442 \u0441\u0442\u043e\u0438\u0442 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0435\u0434\u0438\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u041d\u0430\u0448 \u0441\u043a\u0440\u0438\u043f\u0442 <code>cleanup<\/code> \u043d\u0435 \u0434\u0430\u0451\u0442 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0439, \u0447\u0442\u043e \u0442\u0435 \u0438\u043b\u0438 \u0438\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0432 <code>ExecStop<\/code>. \u0421\u0430\u043c \u0436\u0435 <code>cleanup<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0415\u0441\u043b\u0438 \u0431\u044b \u043e\u043d, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u0432\u0438\u0441\u0435\u043b \u043e\u0442 \u0441\u0435\u0442\u0438, \u043d\u0430\u043c \u0431\u044b \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <code>After=network.target<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0430\u0441\u044c \u0440\u0430\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u0437\u0430\u0434\u0430\u0447\u0435 \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u043d\u0430\u0448\u0438 \u0434\u043d\u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u0434\u0435\u043b\u043e\u043c.<\/p>\n<p>  <\/p>\n<h2 id=\"konteyner-execstop\">\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 ExecStop<\/h2>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0431\u043b\u043e\u043a <code>systemd<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432 <code>ExecStop<\/code> \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u0438\u0441\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0440\u0430\u043d\u0435\u0435, \u0437\u0430\u043f\u0443\u0441\u043a \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. <code>ExecStop<\/code> <em>\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f<\/em> \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u044e\u043d\u0438\u0442\u0430\u043c\u0438, \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0443. \u0423\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e \u043d\u0435 \u0441\u0443\u043b\u0438\u0442.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># \/etc\/systemd\/system\/clean.service [Unit] Description=Clean on shutdown After=multi-user.target  [Service] Type=oneshot RemainAfterExit=yes ExecStart=\/bin\/true ExecStopPre=-\/usr\/bin\/podman rm clean ExecStop=\/usr\/bin\/podman run \\   --name clean \\   --log-driver=k8s-file \\   --rm \\   -v \/usr\/local\/bin:\/scripts \\   --stop-timeout=60 \\   --entrypoint \/scripts\/cleanup \\   docker.io\/fedora:36  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c <code>clean.service<\/code>. \u041f\u0440\u0438 \u0440\u0443\u0447\u043d\u043e\u0439 \u0434\u0435\u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 <code>clean.service<\/code> <code>ExecStop<\/code> \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u043f\u0443\u0442\u044c <code>\/usr\/local\/bin<\/code> \u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u0442\u043e\u0442 \u0436\u0435 <code>cleanup<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">Sep 29 21:36:41 ip-10-0-13-150 systemd[1]: Starting clean.service - Clean on shutdown... Sep 29 21:36:41 ip-10-0-13-150 systemd[1]: Finished clean.service - Clean on shutdown. Sep 29 21:37:35 ip-10-0-13-150 systemd[1]: Stopping clean.service - Clean on shutdown... Sep 29 21:37:35 ip-10-0-13-150 podman[10701]: 2022-09-29 21:37:35.32232541 +0000 UTC m=+0.076846159 container create 2e0a21b085113ad6b5eab83a1f4b85081045727b711c89909dc7d204abb25e61 (image=docker.io\/library\/fedora:36, name=clean, health_status=, maintainer=Clement Verna &lt;cverna@fedoraproject.org>) Sep 29 21:37:35 ip-10-0-13-150 podman[10701]: 2022-09-29 21:37:35.292987568 +0000 UTC m=+0.047508358 image pull  docker.io\/fedora:36 Sep 29 21:37:35 ip-10-0-13-150 podman[10701]: 2022-09-29 21:37:35.516155501 +0000 UTC m=+0.270676209 container init 2e0a21b085113ad6b5eab83a1f4b85081045727b711c89909dc7d204abb25e61 (image=docker.io\/library\/fedora:36, name=clean, health_status=, maintainer=Clement Verna &lt;cverna@fedoraproject.org>) Sep 29 21:37:35 ip-10-0-13-150 podman[10701]: 2022-09-29 21:37:35.5276157 +0000 UTC m=+0.282136425 container start 2e0a21b085113ad6b5eab83a1f4b85081045727b711c89909dc7d204abb25e61 (image=docker.io\/library\/fedora:36, name=clean, health_status=, maintainer=Clement Verna &lt;cverna@fedoraproject.org>) Sep 29 21:37:35 ip-10-0-13-150 podman[10701]: 2022-09-29 21:37:35.527985526 +0000 UTC m=+0.282506267 container attach 2e0a21b085113ad6b5eab83a1f4b85081045727b711c89909dc7d204abb25e61 (image=docker.io\/library\/fedora:36, name=clean, health_status=, maintainer=Clement Verna &lt;cverna@fedoraproject.org>) Sep 29 21:37:35 ip-10-0-13-150 podman[10701]: cleaning... Sep 29 21:37:40 ip-10-0-13-150 podman[10701]: waiting... Sep 29 21:37:45 ip-10-0-13-150 podman[10701]: waiting... Sep 29 21:37:50 ip-10-0-13-150 podman[10701]: waiting... Sep 29 21:37:50 ip-10-0-13-150 podman[10701]: done Sep 29 21:37:50 ip-10-0-13-150 podman[10701]: 2022-09-29 21:37:50.536310798 +0000 UTC m=+15.290831522 container died 2e0a21b085113ad6b5eab83a1f4b85081045727b711c89909dc7d204abb25e61 (image=docker.io\/library\/fedora:36, name=clean, health_status=) Sep 29 21:37:50 ip-10-0-13-150 podman[10873]: 2022-09-29 21:37:50.707597051 +0000 UTC m=+0.115808702 container remove 2e0a21b085113ad6b5eab83a1f4b85081045727b711c89909dc7d204abb25e61 (image=docker.io\/library\/fedora:36, name=clean, health_status=, maintainer=Clement Verna &lt;cverna@fedoraproject.org>) Sep 29 21:37:50 ip-10-0-13-150 systemd[1]: clean.service: Deactivated successfully. Sep 29 21:37:50 ip-10-0-13-150 systemd[1]: Stopped clean.service - Clean on shutdown.<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u043e \u0432 \u0445\u043e\u0434\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b <code>ExecStop<\/code> \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">Sep 29 21:41:21 ip-10-0-13-150 systemd[1]: Stopping clean.service - Clean on shutdown... Sep 29 21:41:21 ip-10-0-13-150 podman[12002]: 2022-09-29 21:41:21.263765577 +0000 UTC m=+0.192250288 container create 214a91497691b33a2ee77a0ad6dc3b3894e102abf84d641f5df2abfc842d1cd0 (image=docker.io\/library\/fedora:36, name=clean, health_status=, maintainer=Clement Verna &lt;cverna@fedoraproject.org>) Sep 29 21:41:21 ip-10-0-13-150 podman[12002]: 2022-09-29 21:41:21.190543212 +0000 UTC m=+0.119027932 image pull  docker.io\/fedora:36 Sep 29 21:41:21 ip-10-0-13-150 podman[12002]: time=\"2022-09-29T21:41:21Z\" level=error msg=\"Unable to clean up network for container 214a91497691b33a2ee77a0ad6dc3b3894e102abf84d641f5df2abfc842d1cd0: \\\"error tearing down network namespace configuration for container 214a91497691b33a2ee77a0ad6dc3b3894e102abf84d641f5df2abfc842d1cd0: netavark: failed to delete if podman0: Received a netlink error message Operation not supported (os error 95)\\\"\" Sep 29 21:41:21 ip-10-0-13-150 podman[12072]: 2022-09-29 21:41:21.689689685 +0000 UTC m=+0.185177533 container remove 214a91497691b33a2ee77a0ad6dc3b3894e102abf84d641f5df2abfc842d1cd0 (image=docker.io\/library\/fedora:36, name=clean, health_status=, maintainer=Clement Verna &lt;cverna@fedoraproject.org>) Sep 29 21:41:21 ip-10-0-13-150 podman[12002]: Error: OCI runtime error: crun: sd-bus call: Transaction for libpod-214a91497691b33a2ee77a0ad6dc3b3894e102abf84d641f5df2abfc842d1cd0.scope\/start is destructive (shutdown.target has 'start' job queued, but 'stop' is included in transaction).: Resource deadlock avoided Sep 29 21:41:21 ip-10-0-13-150 systemd[1]: clean.service: Control process exited, code=exited, status=126\/n\/a Sep 29 21:41:21 ip-10-0-13-150 systemd[1]: clean.service: Failed with result 'exit-code'. Sep 29 21:41:21 ip-10-0-13-150 systemd[1]: Stopped clean.service - Clean on shutdown. -- Boot 332c28360e38479c91f5cab4898413b4 -- Sep 29 21:41:45 ip-10-0-13-150 systemd[1]: Starting clean.service - Clean on shutdown... Sep 29 21:41:45 ip-10-0-13-150 systemd[1]: Finished clean.service - Clean on shutdown.<\/code><\/pre>\n<p>  <\/p>\n<p>\u042f \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u043b \u044d\u0442\u0443 \u043e\u0448\u0438\u0431\u043a\u0443 \u0441\u0430\u043c \u0438 \u0432\u0438\u0434\u0435\u043b, \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0431\u043e\u0440\u044e\u0442\u0441\u044f \u0441 \u043d\u0435\u0439, \u043d\u0435 \u043e\u0441\u043e\u0437\u043d\u0430\u0432\u0430\u044f \u0435\u0451. \u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0431\u0435\u0437\u0434\u0435\u043c\u043e\u043d\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043d\u044b\u0445 \u0434\u0432\u0438\u0436\u043a\u0430\u0445 \u0442\u0440\u0443\u0434\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0447\u0442\u043e\u0431\u044b \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0434\u0451\u0436\u043d\u043e <em>\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c<\/em> \u0432 \u0445\u043e\u0434\u0435 <em>\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b<\/em>. \u042d\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0434\u0432\u0438\u0436\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432.<\/p>\n<p>  <\/p>\n<h2 id=\"execstop-dlya-suschestvuyuschego-konteynera\">ExecStop \u0434\u043b\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430<\/h2>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0441\u0442\u0430\u043b\u0438 \u0443\u043c\u043d\u0435\u0435. \u0415\u0441\u043b\u0438 \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u0432\u0437\u044f\u0442\u044c \u0438 \u0441\u0442\u0430\u0440\u0442\u0430\u043d\u0443\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043f\u0440\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b, \u043f\u0443\u0441\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u0441\u0438\u0433\u043d\u0430\u043b\u0430. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442, \u043e\u0442\u0440\u0430\u0436\u0430\u044e\u0449\u0438\u0439 \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434, \u0438 \u043d\u0430\u0437\u043e\u0432\u0451\u043c \u0435\u0433\u043e <code>await<\/code>. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438 \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043e\u043d \u0436\u0434\u0451\u0442, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e <code>Ctrl-C<\/code> \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/bash  cleanup() {   echo \"cleaning...\"   for i in {1..3}; do     sleep 5s     echo \"waiting...\"   done    echo \"done\" }  trap cleanup SIGINT SIGTERM  echo \"Awaiting signals\" sleep infinity &amp; wait $!<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u043c\u0441\u044f \u043e \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b bash-\u0441\u043a\u0440\u0438\u043f\u0442 <code>await<\/code> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043a\u0430\u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u21161 \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b \u0441\u0438\u0433\u043d\u0430\u043b\u044b. \u041d\u0435\u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, sleep) \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c <a href=\"https:\/\/www.gnu.org\/software\/bash\/manual\/html_node\/Signals.html#Signals\">\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432<\/a> \u0432 \u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430\u0445. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c sleep \u0444\u043e\u043d\u043e\u0432\u044b\u043c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e (\u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0435\u043c\u0443\u044e) \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>wait<\/code> \u0434\u043b\u044f \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b.<\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0451\u043c, \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u044e\u043d\u0438\u0442 <code>clean.service<\/code> \u0432 <code>systemd<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># \/etc\/systemd\/system\/clean.service [Unit] Description=Clean on shutdown After=multi-user.target  [Service] Type=simple ExecStartPre=-\/usr\/bin\/podman rm clean ExecStart=\/usr\/bin\/podman run \\   --name clean \\   --log-driver=k8s-file \\   --rm \\   -v \/usr\/local\/bin:\/scripts \\   --stop-timeout=60 \\   --entrypoint \/scripts\/await \\   docker.io\/fedora:36 ExecStop=\/usr\/bin\/podman stop clean TimeoutStopSec=180  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0439 \u044e\u043d\u0438\u0442 \u0441 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 <code>Type=simple<\/code>. Podman \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0438 \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0441\u0438\u0433\u043d\u0430\u043b\u044b (\u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <code>SIGTERM<\/code> \u043f\u0440\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b) \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. \u041f\u0440\u0438 \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u044e\u043d\u0438\u0442\u0430 podman \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b <code>SIGTERM<\/code> \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 (\u0438 <code>SIGKILL<\/code> \u043f\u043e\u0441\u043b\u0435 <code>--stop-timeout<\/code>, \u0447\u0442\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 10 \u0441\u0435\u043a\u0443\u043d\u0434).<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0438 \u0440\u0430\u043d\u0435\u0435, \u044e\u043d\u0438\u0442 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442\u0441\u044f <code>multi-user.target<\/code>, \u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a <code>After<\/code> (\u043f\u043e\u0441\u043b\u0435) <code>multi-user.target<\/code>, \u043d\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u0437\u0434\u043d\u0435\u0439 \u0441\u0442\u0430\u0434\u0438\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430. \u041a\u043e\u043c\u0430\u043d\u0434\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0435 (ordered) \u044e\u043d\u0438\u0442\u044b \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u043b\u044f <code>clean<\/code> <em>\u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f<\/em> \u0440\u0430\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u044e\u043d\u0438\u0442\u043e\u0432. \u0421\u0435\u0440\u0432\u0438\u0441 <code>TimeoutStopSec<\/code> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043a\u0430\u043a \u0434\u043e\u043b\u0433\u043e <code>systemd<\/code> \u0434\u043e\u043b\u0436\u043d\u0430 \u0436\u0434\u0430\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f <code>ExecStop<\/code> \u0434\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f <code>SIGKILL<\/code>.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u043c \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u044e\u043d\u0438\u0442\u0430, \u0434\u043e\u0436\u0438\u0434\u0430\u0435\u043c\u0441\u044f \u0441\u0438\u0433\u043d\u0430\u043b\u0430.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">systemctl status clean.service \u25cf clean.service - Clean on shutdown      Loaded: loaded (\/etc\/systemd\/system\/clean.service; enabled; vendor preset: disabled)      Active: active (running) since Fri 2022-10-21 16:34:41 UTC; 1min 12s ago    Main PID: 239609 (podman)       Tasks: 9 (limit: 4427)      Memory: 18.6M         CPU: 275ms      CGroup: \/system.slice\/clean.service              \u251c\u2500 239609 \/usr\/bin\/podman run --name clean --log-driver=k8s-file --rm -v \/usr\/local\/bin:\/scripts --stop-timeout=60 --entrypoint \/scripts\/await docker.io\/fedora:36              \u2514\u2500 239680 \/usr\/bin\/conmon --api-version 1 -c 21009bcf34c2fbd3810f7301d1693dba084d9d098cdcbd9e3b15d5dc22e3bd70 -u 21009bcf34c2fbd3810f7301d1693dba084d9d098cdcbd9e3b15d5dc22e3bd70 -r \/usr\/bin\/crun -b \/var\/lib\/containers\/storage\/overlay-containers\/21009bcf34c2fbd3810f7301d1693dba084d9d098cdcbd9e3b15d5dc22e3bd70\/userdata -p \/run\/containers\/storage\/overlay-containers\/21009bcf34c2fbd3810f7301d1693dba084d9d098cdcbd9e3b15d5dc22e3bd70\/userdata\/pidfile -n clean --exit-dir \/run\/libpod\/exits --full-attach -s -l k8s-file:\/var\/lib\/containers\/storage\/overlay-containers\/21009bcf34c2fbd3810f7301d1693dba084d9d098cdcbd9e3b15d5dc22e3bd70\/userdata\/ctr.log --log-level warning --runtime-arg --log-format=json --runtime-arg --log --runtime-arg=\/run\/containers\/storage\/overlay-containers\/21009bcf34c2fbd3810f7301d1693dba084d9d098cdcbd9e3b15d5dc22e3bd70\/userdata\/oci-log --conmon-pidfile \/run\/containers\/storage\/overlay-containers\/21009bcf34c2fbd3810f7301d1693dba084d9d098cdcbd9e3b15d5dc22e3bd70\/userdata\/conmon.pid --exit-command \/usr\/bin\/podman --exit-command-arg --root --exit-command-arg \/var\/lib\/containers\/storage --exit-command-arg --runroot --exit-command-arg \/run\/containers\/storage --exit-command-arg --log-level --exit-command-arg warning --exit-command-arg --cgroup-manager --exit-command-arg systemd --exit-command-arg --tmpdir --exit-command-arg \/run\/libpod --exit-command-arg --network-config-dir --exit-command-arg \"\" --exit-command-arg --network-backend --exit-command-arg netavark --exit-command-arg --volumepath --exit-command-arg \/var\/lib\/containers\/storage\/volumes --exit-command-arg --runtime --exit-command-arg crun --exit-command-arg --storage-driver --exit-command-arg overlay --exit-command-arg --storage-opt --exit-command-arg overlay.mountopt=nodev,metacopy=on --exit-command-arg --events-backend --exit-command-arg journald --exit-command-arg container --exit-command-arg cleanup --exit-command-arg --rm --exit-command-arg 21009bcf34c2fbd3810f7301d1693dba084d9d098cdcbd9e3b15d5dc22e3bd70  Sep 29 16:34:41 ip-10-0-0-27 systemd[1]: Started clean.service - Clean on shutdown. Sep 29 16:34:42 ip-10-0-0-27 podman[239609]: 2022-10-21 16:34:42.02827346 +0000 UTC m=+0.073162795 container create 21009bcf34c2fbd3810f7301d1693dba084d9d098cdcbd9e3b15d5dc22e3bd70 (image=docker.io\/library\/fedora:36, name=clean, health_status=, maintainer=Clement Verna &lt;cverna@fedoraproject.org>) Sep 29 16:34:42 ip-10-0-0-27 podman[239609]: 2022-10-21 16:34:41.999309821 +0000 UTC m=+0.044199164 image pull  docker.io\/fedora:36 Sep 29 16:34:42 ip-10-0-0-27 podman[239609]: 2022-10-21 16:34:42.253726035 +0000 UTC m=+0.298615370 container init 21009bcf34c2fbd3810f7301d1693dba084d9d098cdcbd9e3b15d5dc22e3bd70 (image=docker.io\/library\/fedora:36, name=clean, health_status=, maintainer=Clement Verna &lt;cverna@fedoraproject.org>) Sep 29 16:34:42 ip-10-0-0-27 podman[239609]: 2022-10-21 16:34:42.263454996 +0000 UTC m=+0.308344331 container start 21009bcf34c2fbd3810f7301d1693dba084d9d098cdcbd9e3b15d5dc22e3bd70 (image=docker.io\/library\/fedora:36, name=clean, health_status=, maintainer=Clement Verna &lt;cverna@fedoraproject.org>) Sep 29 16:34:42 ip-10-0-0-27 podman[239609]: 2022-10-21 16:34:42.263872042 +0000 UTC m=+0.308761624 container attach 21009bcf34c2fbd3810f7301d1693dba084d9d098cdcbd9e3b15d5dc22e3bd70 (image=docker.io\/library\/fedora:36, name=clean, health_status=, maintainer=Clement Verna &lt;cverna@fedoraproject.org>) Sep 29 16:34:42 ip-10-0-0-27 podman[239609]: Awaiting signals<\/code><\/pre>\n<p>  <\/p>\n<blockquote><p>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0437\u0430 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435, \u0430 \u043d\u0435 \u043f\u0440\u0438 \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d.<\/p><\/blockquote>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 <code>systemctl reboot<\/code> (\u0441 \u043f\u043e\u043c\u0435\u0442\u043a\u043e\u0439 ?). \u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0436\u0443\u0440\u043d\u0430\u043b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">Sep 29 16:34:42 ip-10-0-0-27 podman[239609]: Awaiting signals ? Sep 29 16:42:06 ip-10-0-0-27 podman[239609]: cleaning... Sep 29 16:42:06 ip-10-0-0-27 podman[239609]: Terminated Sep 29 16:42:06 ip-10-0-0-27 systemd[1]: Stopping clean.service - Clean on shutdown... Sep 29 16:42:11 ip-10-0-0-27 podman[239609]: cleaning... Sep 29 16:42:16 ip-10-0-0-27 podman[239609]: waiting... Sep 29 16:42:21 ip-10-0-0-27 podman[239609]: waiting... Sep 29 16:42:26 ip-10-0-0-27 podman[239609]: waiting... Sep 29 16:42:26 ip-10-0-0-27 podman[239609]: done Sep 29 16:42:26 ip-10-0-0-27 podman[239609]: waiting... Sep 29 16:42:31 ip-10-0-0-27 podman[239609]: waiting... Sep 29 16:42:36 ip-10-0-0-27 podman[239609]: waiting... Sep 29 16:42:36 ip-10-0-0-27 podman[239609]: done Sep 29 16:42:36 ip-10-0-0-27 podman[239609]: 2022-10-21 16:42:36.44559863 +0000 UTC m=+474.490487974 container died 21009bcf34c2fbd3810f7301d1693dba084d9d098cdcbd9e3b15d5dc22e3bd70 (image=docker.io\/library\/fedora:36, name=clean, health_status=) Sep 29 16:42:36 ip-10-0-0-27 podman[241961]: 2022-10-21 16:42:36.80223871 +0000 UTC m=+30.342432111 container cleanup 21009bcf34c2fbd3810f7301d1693dba084d9d098cdcbd9e3b15d5dc22e3bd70 (image=docker.io\/library\/fedora:36, name=clean, health_status=, maintainer=Clement Verna &lt;cverna@fedoraproject.org>) Sep 29 16:42:36 ip-10-0-0-27 podman[241961]: clean Sep 29 16:42:36 ip-10-0-0-27 podman[239609]: 2022-10-21 16:42:36.907856847 +0000 UTC m=+474.952746174 container remove 21009bcf34c2fbd3810f7301d1693dba084d9d098cdcbd9e3b15d5dc22e3bd70 (image=docker.io\/library\/fedora:36, name=clean, health_status=, maintainer=Clement Verna &lt;cverna@fedoraproject.org>) Sep 29 16:42:36 ip-10-0-0-27 podman[239609]: time=\"2022-10-21T16:42:36Z\" level=error msg=\"forwarding signal 15 to container 21009bcf34c2fbd3810f7301d1693dba084d9d098cdcbd9e3b15d5dc22e3bd70: container has already been removed\" Sep 29 16:42:36 ip-10-0-0-27 systemd[1]: clean.service: Deactivated successfully. Sep 29 16:42:36 ip-10-0-0-27 systemd[1]: Stopped clean.service - Clean on shutdown. -- Boot d0b5eba20ebd452aae5dbffaee19eff8 --<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0438 \u0437\u0430\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b, \u043e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u0432\u0430\u0436\u0434\u044b. \u0417\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 <code>SIGTERM<\/code>, <em>\u0438<\/em> podman stop \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 <code>SIGTERM<\/code>. \u0412\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0451\u043c \u044d\u0442\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 <code>await<\/code> \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e. \u041d\u0430\u0436\u043c\u0451\u043c Ctrl-C \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437 \u2014 \u0438 \u0443\u0432\u0438\u0434\u0438\u043c \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 cleanup.<\/p>\n<p>  <\/p>\n<p>\u0418\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438. \u041f\u0435\u0440\u0432\u044b\u0439 \u2014 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 podman stop \u0438\u0437 <code>ExecStop<\/code>. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043c\u0435\u0445\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 systemctl \u0442\u0430\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u043a\u0430\u043a <code>systemctl stop clean.service<\/code>, \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443\u0442, \u0438 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443 <code>SIGTERM<\/code> \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0435.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043b\u0443\u0447\u0448\u0435 \u0437\u0430\u0447\u0438\u0441\u0442\u0438\u043c \u0438\u043b\u0438 \u0441\u0431\u0440\u043e\u0441\u0438\u043c (clear\/reset) \u044d\u0442\u0443 \u043b\u043e\u0432\u0443\u0448\u043a\u0443. \u041e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e, \u0432 Go \u0431\u044b\u043b\u043e \u0431\u044b \u043a\u0443\u0434\u0430 \u043b\u0443\u0447\u0448\u0435. \u041d\u043e \u043f\u043e\u043a\u0430 \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">cleanup() {   trap - SIGINT SIGTERM   echo \"cleaning...\"   ... } ...<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c <code>clean.service<\/code>. \u041e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 Boot ID \u0432 \u0436\u0443\u0440\u043d\u0430\u043b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u0437\u0430\u0442\u0435\u043c \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0441\u043d\u043e\u0432\u0430 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c <code>systemctl reboot<\/code> (\u0441 \u043f\u043e\u043c\u0435\u0442\u043a\u043e\u0439 ?).<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">Sep 29 17:01:04 ip-10-0-0-27 podman[3688]: Awaiting signals ? Sep 29 17:02:20 ip-10-0-0-27 podman[3688]: cleaning... Sep 29 17:02:20 ip-10-0-0-27 podman[3688]: Terminated Sep 29 17:02:20 ip-10-0-0-27 systemd[1]: Stopping clean.service - Clean on shutdown... Sep 29 17:02:25 ip-10-0-0-27 podman[3688]: waiting... Sep 29 17:02:30 ip-10-0-0-27 podman[3688]: waiting... Sep 29 17:02:35 ip-10-0-0-27 podman[3688]: waiting... Sep 29 17:02:35 ip-10-0-0-27 podman[3688]: done Sep 29 17:02:35 ip-10-0-0-27 podman[3688]: 2022-10-21 17:02:35.391304416 +0000 UTC m=+91.032365358 container died 75079c6a180f82d398bb33e1e22a45bf4b281e84912e780842dd167658e6179f (image=docker.io\/library\/fedora:36, name=clean, health_status=) Sep 29 17:02:35 ip-10-0-0-27 podman[4229]: 2022-10-21 17:02:35.740391215 +0000 UTC m=+0.325653570 container remove 75079c6a180f82d398bb33e1e22a45bf4b281e84912e780842dd167658e6179f (image=docker.io\/library\/fedora:36, name=clean, health_status=, maintainer=Clement Verna &lt;cverna@fedoraproject.org>) Sep 29 17:02:35 ip-10-0-0-27 podman[4090]: clean Sep 29 17:02:35 ip-10-0-0-27 systemd[1]: clean.service: Main process exited, code=exited, status=143\/n\/a Sep 29 17:02:35 ip-10-0-0-27 systemd[1]: clean.service: Failed with result 'exit-code'. Sep 29 17:02:35 ip-10-0-0-27 systemd[1]: Stopped clean.service - Clean on shutdown. -- Boot f8b835d07c7f497c83487bdf3bd3e319 --<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e <code>cleanup<\/code> \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0430 (3 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f <code>waiting...<\/code>), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0447\u0442\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0442\u0441\u0440\u043e\u0447\u0435\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435. \u041a\u043e\u0434 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f 143 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434 \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438\u0437-\u0437\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b <code>SIGTERM<\/code>; <code>systemd<\/code> \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u0442 \u044d\u0442\u043e \u043a\u0430\u043a \u043e\u0448\u0438\u0431\u043a\u0443, \u043c\u044b \u0436\u0435 \u0441\u043a\u043e\u0440\u0435\u0435 \u043d\u0430\u0437\u043e\u0432\u0451\u043c \u044d\u0442\u043e \u0443\u0441\u043f\u0435\u0445\u043e\u043c. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0441\u0442\u0430\u0442\u0443\u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 <a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.service.html#SuccessExitStatus=\">SuccessExitStatus<\/a>.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">SuccessExitStatus=143<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">Sep 29 17:09:56 ip-10-0-0-27 podman[4981]: Awaiting signals ? Sep 29 17:16:03 ip-10-0-0-27 podman[4981]: cleaning... Sep 29 17:16:03 ip-10-0-0-27 podman[4981]: Terminated Sep 29 17:16:03 ip-10-0-0-27 systemd[1]: Stopping clean.service - Clean on shutdown... Sep 29 17:16:08 ip-10-0-0-27 podman[4981]: waiting... Sep 29 17:16:13 ip-10-0-0-27 podman[4981]: waiting... Sep 29 17:16:18 ip-10-0-0-27 podman[4981]: waiting... Sep 29 17:16:18 ip-10-0-0-27 podman[4981]: done Sep 29 17:16:18 ip-10-0-0-27 podman[4981]: 2022-10-21 17:16:18.636792684 +0000 UTC m=+382.160266981 container died 91888ef150ea54a9831736a966302d1811028ce3216afb4368bf0a266e61ee52 (image=docker.io\/library\/fedora:36, name=clean, health_status=) Sep 29 17:16:18 ip-10-0-0-27 podman[7028]: 2022-10-21 17:16:18.968155309 +0000 UTC m=+15.157225407 container cleanup 91888ef150ea54a9831736a966302d1811028ce3216afb4368bf0a266e61ee52 (image=docker.io\/library\/fedora:36, name=clean, health_status=, maintainer=Clement Verna &lt;cverna@fedoraproject.org>) Sep 29 17:16:18 ip-10-0-0-27 podman[7028]: clean Sep 29 17:16:19 ip-10-0-0-27 systemd[1]: clean.service: Deactivated successfully. Sep 29 17:16:19 ip-10-0-0-27 systemd[1]: Stopped clean.service - Clean on shutdown. -- Boot 3517a0a13b3e4885be9901666c0fd173 --<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"a-chto-dalshe\">\u0410 \u0447\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435?<\/h2>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043c\u044b \u0443\u0431\u0435\u0434\u0438\u043b\u0438\u0441\u044c, \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u044e\u043d\u0438\u0442\u0430 <code>systemd<\/code> \u2014 \u0434\u0435\u043b\u043e \u0442\u043e\u043d\u043a\u043e\u0435. \u0410 \u0432\u0435\u0434\u044c \u043c\u044b \u0443\u0434\u0435\u043b\u0438\u043b\u0438 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0437\u0435 \u0440\u0430\u043d\u043d\u0435\u0433\u043e \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u0430 \u043d\u0435 \u0442\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c (\u0438\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0437\u0434\u043d\u0435\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0436\u0443\u0440\u043d\u0430\u043b\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u0439). \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439.<\/p>\n<p>  <\/p>\n<p>\u0412 <a href=\"https:\/\/www.psdn.io\/posts\/kubelet-graceful-shutdown\/\">\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u043e\u0441\u0442\u0435<\/a> \u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u043a Kubernetes Kubelet. \u0421\u0435\u0440\u0432\u0438\u0441 Kubelet \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 Kubernetes \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0447\u0435\u0440\u0435\u0437 \u0441\u0440\u0435\u0434\u0443 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 (container runtime) \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438, \u043a\u0430\u043a \u0445\u0443\u043a\u0438 <code>preStop<\/code>, <code>terminationGracePeriod<\/code> \u0438 \u0431\u044e\u0434\u0436\u0435\u0442\u044b \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f (disruption budgets). \u041e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 Kubelet \u043d\u0435 \u043e\u043f\u043e\u0432\u0435\u0449\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0438 \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c (\u0434\u043e \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438) \u043d\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445 \u043d\u0435 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u043b\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u0425\u043e\u0442\u0438\u0442\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430?<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0421\u043b\u0435\u0434\u0438\u0442\u0435 \u0437\u0430 \u043d\u043e\u0432\u044b\u043c\u0438 \u0442\u0432\u0438\u0442\u0430\u043c\u0438 \u0432 \u0431\u043b\u043e\u0433\u0435 <a href=\"https:\/\/twitter.com\/poseidonlabs\">@poseidonlabs<\/a><\/li>\n<li>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u044b Poseidon \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u0441\u0442\u0430\u0432 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 <a href=\"https:\/\/github.com\/sponsors\/poseidon\">\u0441\u043f\u043e\u043d\u0441\u043e\u0440\u043e\u0432<\/a><\/li>\n<li>\u041f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u0441 \u043d\u0430\u043c\u0438 \u043f\u043e <code>email<\/code> <a href=\"mailto:tech@psdn.io\">tech@psdn.io<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"ishodnyy-kod\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/h2>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0435 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0430 <a href=\"https:\/\/github.com\/poseidon\/blog-bits\">blog-bits<\/a> \u043f\u043e \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0438 MPL 2.0. \u041e\u043d\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u043d\u0430 Fedora CoreOS 36.20221001.3.0 (systemd 250.8).<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">[Unit] Description=Clean on shutdown After=multi-user.target  [Service] Type=simple ExecStartPre=-\/usr\/bin\/podman rm clean ExecStart=\/usr\/bin\/podman run \\   --name clean \\   --log-driver=k8s-file \\   --rm \\   -v \/usr\/local\/bin:\/scripts \\   --stop-timeout=60 \\   --entrypoint \/scripts\/await \\   docker.io\/fedora:36 ExecStop=\/usr\/bin\/podman stop clean TimeoutStopSec=180 SuccessExitStatus=143  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/bash  cleanup() {   trap - SIGINT SIGTERM   echo \"cleaning...\"   for i in {1..3}; do     sleep 5s     echo \"waiting...\"   done    echo \"done\" }  trap cleanup SIGINT SIGTERM  echo \"Awaiting signals\" sleep infinity &amp; wait $!<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0430\u0448\u043b\u0438 \u0431\u0430\u0433, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u0440\u0438\u0448\u043b\u0438\u0442\u0435 \u0441\u0432\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0438 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u043e\u0434.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u044b<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<ul>\n<li>man <a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.html\">systemd<\/a> <a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.unit.html\">systemd.unit<\/a><\/li>\n<li>man <a href=\"http:\/\/ihttps:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.service.html\">systemd.service<\/a>, <a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.scope.html\">systemd.scope<\/a><\/li>\n<li>man <a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.kill.html\">systemd.kill<\/a> <a href=\"https:\/\/www.freedesktop.org\/software\/systemd\/man\/systemd.special.html\">systemd.special<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/containers\/podman\/issues\/105\">https:\/\/github.com\/containers\/podman\/issues\/105<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/containers\/podman\/issues\/7821\">https:\/\/github.com\/containers\/podman\/issues\/7821<\/a><\/li>\n<li><a href=\"http:\/\/mywiki.wooledge.org\/SignalTrap#When_is_the_signal_handled.3F\">http:\/\/mywiki.wooledge.org\/SignalTrap#When_is_the_signal_handled.3F<\/a><\/li>\n<\/ul>\n<\/div><\/div>\n<p>  <\/p>\n<p>\u0410 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c c Linux, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u00a0\u043f\u0440\u043e\u043a\u0430\u0447\u0430\u043b\u0438 \u043a\u0430\u0440\u044c\u0435\u0440\u0443 \u0438\u043b\u0438 \u0441\u0442\u0430\u043b\u0438 \u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u043d\u044b\u043c IT-\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u043c:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/devops-ingineer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_devops_031122&amp;utm_term=conc\">\u041a\u0443\u0440\u0441 \u043f\u043e\u00a0DevOps (6 \u043c\u0435\u0441\u044f\u0446\u0435\u0432)<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/data-scientist-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dspr_031122&amp;utm_term=conc\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Scientist (24 \u043c\u0435\u0441\u044f\u0446\u0430)<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0441\u0435 \u043a\u0443\u0440\u0441\u044b, \u043a\u043b\u0438\u043a\u043d\u0438\u0442\u0435 \u043f\u043e\u00a0\u0431\u0430\u043d\u043d\u0435\u0440\u0443:<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/skillfactory.ru\/catalogue?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=sf_allcourses_031122&amp;utm_term=banner\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/cq\/na\/88\/cqna880todtt287i6ffb12uzzwk.png\" data-src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/cq\/na\/88\/cqna880todtt287i6ffb12uzzwk.png\"\/><\/a><\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041a\u0440\u0430\u0442\u043a\u0438\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043a\u0443\u0440\u0441\u043e\u0432<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p><strong>Data Science \u0438\u00a0Machine Learning<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/data-scientist-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dspr_031122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Scientist<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/data-analyst-pro?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=analytics_dapr_031122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Analyst<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/matematika-dlya-data-science#syllabus?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_mat_031122&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0434\u043b\u044f Data Science\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/matematika-i-machine-learning-dlya-data-science?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_matml_031122&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0438\u00a0Machine Learning \u0434\u043b\u044f Data Science\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/data-engineer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_dea_031122&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e\u00a0Data Engineering<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/machine-learning-i-deep-learning?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_mldl_031122&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00abMachine Learning \u0438\u00a0Deep Learning\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/machine-learning?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=data-science_ml_031122&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e\u00a0Machine Learning<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>Python, \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/python-fullstack-web-developer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fpw_031122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Fullstack-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430\u00a0Python<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/python-for-web-developers?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_pws_031122&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00abPython \u0434\u043b\u044f \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/frontend-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_fr_031122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/webdev?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_webdev_031122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0412\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>\u041c\u043e\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/ios-razrabotchik-s-nulya?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_ios_031122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f iOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/android-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_andr_031122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>Java \u0438\u00a0C#<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/java-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_java_031122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Java-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/java-qa-engineer-testirovshik-po?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_qaja_031122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f QA-\u0438\u043d\u0436\u0435\u043d\u0435\u0440 \u043d\u0430\u00a0JAVA<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/c-sharp-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cdev_031122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C#-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/game-razrabotchik-na-unity-i-c-sharp?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_gamedev_031122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0433\u0440 \u043d\u0430\u00a0Unity<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>\u041e\u0442\u00a0\u043e\u0441\u043d\u043e\u0432\u00a0\u2014 \u0432\u00a0\u0433\u043b\u0443\u0431\u0438\u043d\u0443<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/algoritmy-i-struktury-dannyh?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_algo_031122&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u00ab\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0438\u00a0\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/c-plus-plus-razrabotchik?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_cplus_031122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C++ \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/cyber-security-etichnij-haker?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_hacker_031122&amp;utm_term=cat\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u00ab\u0411\u0435\u043b\u044b\u0439 \u0445\u0430\u043a\u0435\u0440\u00bb<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>\u0410\u00a0\u0442\u0430\u043a\u0436\u0435<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/devops-ingineer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_devops_031122&amp;utm_term=cat\">\u041a\u0443\u0440\u0441 \u043f\u043e\u00a0DevOps<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/catalogue?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=sf_allcourses_031122&amp;utm_term=cat\">\u0412\u0441\u0435 \u043a\u0443\u0440\u0441\u044b<\/a><\/li>\n<\/ul>\n<\/div><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/697152\/\"> https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/697152\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u044b\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u0439 \u0435\u0449\u0451 \u043f\u043b\u044f\u0441\u043a\u043e\u0439 \u0441 \u0431\u0443\u0431\u043d\u043e\u043c. \u0412 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0438\u0440\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u043b\u0441\u044f \u0431\u044b \u044e\u043d\u0438\u0442\u043e\u043c <code>systemd<\/code>. <code>ExecStart<\/code> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0430 \u0431\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0439 <code>SIGTERM<\/code>, \u0430 <code>ExecStop<\/code> \u043e\u043f\u043e\u0432\u0435\u0449\u0430\u043b\u043e \u0431\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u043b\u043e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u043b\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438 \u0435\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u044b.<\/p>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043c\u043d\u043e\u0433\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u0430 \u0442\u043e \u0438 \u0432\u043e\u0432\u0441\u0435 \u0441\u0431\u0438\u0432\u0430\u044e\u0442 \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0438. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 <code>systemd<\/code> \u043f\u0440\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044e\u043d\u0438\u0442\u043e\u0432 <code>systemd<\/code> \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u043e\u0439 \u043e\u0447\u0438\u0441\u0442\u043a\u0438 (custom cleanup) \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435\u043c. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u2014 \u043a <u><a href=\"https:\/\/skillfactory.ru\/devops-ingineer?utm_source=habr&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=coding_devops_031122&amp;utm_term=lead\">\u0441\u0442\u0430\u0440\u0442\u0443 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u0443\u0440\u0441\u0430 \u043f\u043e DevOps<\/a><\/u>.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-340692","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/340692","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=340692"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/340692\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=340692"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=340692"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=340692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}