{"id":473151,"date":"2025-09-02T15:38:39","date_gmt":"2025-09-02T15:38:39","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=473151"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=473151","title":{"rendered":"<span>Systemd: \u043f\u043e\u043b\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u0430\u0434\u043c\u0438\u043d\u043e\u0432 + \u043f\u0440\u0438\u043c\u0435\u0440\u044b<\/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-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! Systemd &#8212; \u0441\u043a\u0435\u043b\u0435\u0442 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e Linux. \u041e\u043d \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u0443\u0436\u0431\u0430\u043c\u0438, \u043d\u043e \u0438 \u0442\u0430\u0439\u043c\u0435\u0440\u0430\u043c\u0438, \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c&#8230; \u041f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0435\u0433\u043e = \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e &#8212; \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b: \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430, \u044e\u043d\u0438\u0442\u044b, cgroups, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0436\u0443\u0440\u043d\u0430\u043b\u0430\u043c\u0438. \u0422\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0438.<\/p>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u043c\u0438\u0440\u0435 Linux \u0438 Unix-\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438\u00a0SysVinit. \u0415\u0451 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0431\u044b\u043b \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c: \u043e\u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u044b (\u043e\u0431\u044b\u0447\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0432\u00a0<code>\/etc\/rc.d\/<\/code>\u00a0\u0438\u043b\u0438\u00a0<code>\/etc\/init.d\/<\/code>) \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443, \u0432 \u0441\u0442\u0440\u043e\u0433\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u043c \u0441\u0438\u043c\u043b\u0438\u043d\u043a\u0430\u043c\u0438 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u0445\u00a0<code>rcN.d<\/code>.<\/p>\n<p>\u041d\u043e \u0441 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435\u043c Linux \u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u0438\u0441\u0442\u0435\u043c &#8212; \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 SysVinit \u0441\u0442\u0430\u043b\u0438 \u0432\u043f\u043e\u043b\u043d\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b:<\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a: \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u043e\u0434\u0438\u043d \u0437\u0430 \u0434\u0440\u0443\u0433\u0438\u043c. \u0415\u0441\u043b\u0438 \u0441\u043b\u0443\u0436\u0431\u0430 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0435\u043b\u0430 \u043e\u0442 \u0434\u0440\u0443\u0433\u043e\u0439 &#8212; \u043e\u043d\u0430 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0436\u0434\u0430\u043b\u0430 \u0441\u0432\u043e\u0435\u0439 \u043e\u0447\u0435\u0440\u0435\u0434\u0438, \u0447\u0442\u043e \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u043b\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0437\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438. Init \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u043d\u043e \u043d\u0435 \u043c\u043e\u0433 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0441\u043b\u0443\u0436\u0431 (\u0443\u043f\u0430\u043b\u0430? \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438?).<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u0440\u043e\u0437\u043d\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041a\u0430\u0436\u0434\u0430\u044f \u0441\u043b\u0443\u0436\u0431\u0430 \u0432\u0435\u043b\u0430 \u043b\u043e\u0433\u0438 &#171;\u043f\u043e-\u0441\u0432\u043e\u0435\u043c\u0443&#187; (\u0432 <code>\/var\/log\/<\/code>), \u043d\u0435 \u0431\u044b\u043b\u043e \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u0435\u0434\u0438\u043d\u043e\u0433\u043e \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u043b\u043e\u0433\u043e\u0432.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e\u043b\u0430\u0433\u0430\u044e, \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u0440\u0438\u0432\u0435\u043b\u0438 \u043a \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432 (Upstart, OpenRC), \u043d\u043e \u0438\u043c\u0435\u043d\u043d\u043e systemd, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u041b\u0435\u043d\u043d\u0430\u0440\u0442\u043e\u043c \u041f\u043e\u0442\u0442\u0435\u0440\u043b\u0438\u043d\u0433\u043e\u043c \u0432 2010 \u0433\u043e\u0434\u0443, \u0441\u0442\u0430\u043b \u043d\u0435\u043a\u0438\u043c &#171;\u0434\u0435-\u0444\u0430\u043a\u0442\u043e&#187; \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u0434\u043b\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432 (Fedora, Debian, Ubuntu, Arch \u0438 \u0434\u0440.). \u041e\u043d \u0431\u044b\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u043a\u0430\u043a \u043a\u0430\u0440\u0434\u0438\u043d\u0430\u043b\u044c\u043d\u043e \u043d\u043e\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u043d\u0438\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439.<\/p>\n<h3>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b systemd<\/h3>\n<h4>1. \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b<\/h4>\n<p>Systemd &#8212; \u043d\u0435 \u0435\u0434\u0438\u043d\u0430\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u0430 \u043d\u0430\u0431\u043e\u0440 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0449\u0438\u0445 &#171;\u043a\u0430\u0440\u043a\u0430\u0441&#187; \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0415\u0433\u043e \u044f\u0434\u0440\u043e &#8212; \u0434\u0435\u043c\u043e\u043d\u00a0<code>systemd<\/code>\u00a0(PID 1), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u044f\u043c\u044b\u043c \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u043c \u044f\u0434\u0440\u0430 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0441\u0435\u043c\u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438.<\/p>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b:<\/p>\n<ul>\n<li>\n<p><code>systemd<\/code>\u00a0(PID 1):\u00a0\u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0434\u0435\u043c\u043e\u043d. \u041e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0437\u0430\u043f\u0443\u0441\u043a \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u044e\u043d\u0438\u0442\u043e\u0432, \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 (\u0447\u0435\u0440\u0435\u0437 cgroups), \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u043e\u0442 \u044f\u0434\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p><code>systemctl<\/code>:\u00a0\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 CLI-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0434\u0435\u043c\u043e\u043d\u043e\u043c. \u041d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 D-Bus-\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0434\u0435\u043c\u043e\u043d\u0443\u00a0<code>systemd<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><code>journald<\/code>:\u00a0\u0434\u0435\u043c\u043e\u043d \u0436\u0443\u0440\u043d\u0430\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0418\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0441 \u0434\u0435\u043c\u043e\u043d\u043e\u043c\u00a0<code>systemd<\/code>, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c stdout\/stderr \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0438 &#171;\u043e\u0431\u043e\u0433\u0430\u0449\u0430\u0442\u044c&#187; \u0437\u0430\u043f\u0438\u0441\u0438 \u043b\u043e\u0433\u0430 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<code><em>SYSTEMD<\/em>UNIT=ssh.service<\/code>).<\/p>\n<\/li>\n<li>\n<p><code>udev<\/code>\u00a0\u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432. \u0423\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0443\u0437\u043b\u0430\u043c\u0438 \u0432\u00a0<code>\/dev<\/code>, \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 firmware \u0438 \u043c\u043e\u0434\u0443\u043b\u0438 \u044f\u0434\u0440\u0430. \u0422\u0435\u0441\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0441 systemd \u0434\u043b\u044f \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432.<\/p>\n<\/li>\n<li>\n<p><code>networkd<\/code>,\u00a0<code>timedated<\/code>,\u00a0<code>logind<\/code>:\u00a0\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u0435\u043c\u043e\u043d\u044b \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u044c\u044e, \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0438 \u0441\u0435\u0430\u043d\u0441\u0430\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 (\u043b\u043e\u0433\u0438\u043d\u043e\u043c).<\/p>\n<\/li>\n<\/ul>\n<h4>2. \u042e\u043d\u0438\u0442\u044b <\/h4>\n<p>\u042e\u043d\u0438\u0442\u044b &#8212; \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u0418\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 (\u043e\u0431\u044b\u0447\u043d\u043e \u0432\u00a0<code>\/usr\/lib\/systemd\/system\/<\/code>, \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u00a0<code>\/etc\/systemd\/system\/<\/code>).<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u044e\u043d\u0438\u0442\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>Service (<code>.service<\/code>): c\u0430\u043c\u044b\u0439 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0439 \u0442\u0438\u043f. \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 (\u0434\u0435\u043c\u043e\u043d) \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043c (<code>ExecStart=<\/code>,\u00a0<code>ExecStop=<\/code>).<\/p>\n<\/li>\n<li>\n<p>Socket (<code>.socket<\/code>): \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u043a\u0435\u0442 (\u0441\u0435\u0442\u0435\u0432\u043e\u0439, IPC \u0438\u043b\u0438 FIFO).\u00a0\u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c &#171;socket-based activation&#187;\u00a0&#8212; \u043a\u043b\u044e\u0447\u0435\u0432\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c: \u0434\u0435\u043c\u043e\u043d\u00a0<code>systemd<\/code>\u00a0\u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u043a\u0435\u0442 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 (<code>.service<\/code>) \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0434\u043b\u044f \u0440\u0435\u0434\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0441\u043b\u0443\u0436\u0431.<\/p>\n<\/li>\n<li>\n<p>Timer (<code>.timer<\/code>): \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 cron. \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 (<code>OnCalendar=*-*-* 00:00:00<\/code>) \u0438\u043b\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 (<code>OnBootSec=<\/code>,\u00a0<code>OnUnitActiveSec=<\/code>). \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e &#8212; \u043f\u043e\u043b\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0438 \u0436\u0443\u0440\u043d\u0430\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043a\u0430\u043a \u0443 \u043b\u044e\u0431\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u044e\u043d\u0438\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p>Mount (<code>.mount<\/code>) \u0438 Automount (<code>.automount<\/code>): \u0442\u043e\u0447\u043a\u0438 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.\u00a0<code>Automount<\/code>\u00a0\u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0443.<\/p>\n<\/li>\n<li>\n<p>Path (<code>.path<\/code>): \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435). \u0410\u043d\u0430\u043b\u043e\u0433\u00a0<code>incron<\/code>.<\/p>\n<\/li>\n<li>\n<p>Target (<code>.target<\/code>): \u0430\u043d\u0430\u043b\u043e\u0433 runlevel \u0438\u0437 SysVinit, \u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u0438\u0439. \u042d\u0442\u043e \u0433\u0440\u0443\u043f\u043f\u0430 \u044e\u043d\u0438\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0438\u0447\u044c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<a href=\"http:\/\/multi-user.target\" rel=\"noopener noreferrer nofollow\"><code>multi-user.target<\/code><\/a>\u00a0\u2014 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0440\u0435\u0436\u0438\u043c \u0431\u0435\u0437 GUI).<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0444\u0430\u0439\u043b\u0430 \u044e\u043d\u0438\u0442\u0430:<br \/> \u041a\u0430\u0436\u0434\u044b\u0439 \u0444\u0430\u0439\u043b \u0440\u0430\u0437\u0431\u0438\u0442 \u043d\u0430 \u0441\u0435\u043a\u0446\u0438\u0438.\u00a0<code>[Unit]<\/code>\u00a0\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0431\u0449\u0438\u0435 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 (\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438), \u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0441\u0435\u043a\u0446\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<code>[Service]<\/code>\u00a0\u0438\u043b\u0438\u00a0<code>[Timer]<\/code>) \u2014 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430.<\/p>\n<pre><code># \u041f\u0440\u0438\u043c\u0435\u0440: \/etc\/systemd\/system\/app.service [Unit] Description=My Custom Application After=network.target # \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0441\u0435\u0442\u0438 Requires=postgresql.service # \u0416\u0451\u0441\u0442\u043a\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c Wants=redis.service # \u041c\u044f\u0433\u043a\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c  [Service] Type=simple ExecStart=\/usr\/bin\/myapp --serve Restart=on-failure # \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u0430\u0434\u0435\u043d\u0438\u0438 RestartSec=5 User=myappuser Group=myappgroup  [Install] WantedBy=multi-user.target  # |- \u0412 \u043a\u0430\u043a\u043e\u0439 \"\u0443\u0440\u043e\u0432\u0435\u043d\u044c\" \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u044e\u043d\u0438\u0442 \u043f\u0440\u0438 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 `systemctl enable`<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e Type<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0432\u0430\u0436\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0445, \u043a\u0430\u043a systemd \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u041d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u0442\u0438\u043f\u0430 &#8212; \u0447\u0430\u0441\u0442\u0430\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<ul>\n<li>\n<p><code>Type=simple<\/code> &#8212; \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435: \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432 <code>ExecStart<\/code>, \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0433\u043b\u0430\u0432\u043d\u044b\u043c. Systemd \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u043c (<code>active<\/code>) \u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u043c \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u043e\u0440\u043e\u0434\u0438\u043b (fork) \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u041e\u043d \u043d\u0435 \u0436\u0434\u0451\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439 \u043e\u0442 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c: \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0434\u0435\u043c\u043e\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0441\u0430\u043c\u0438 \u0432 \u0444\u043e\u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u041b\u0443\u0447\u0448\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u0438\u043f, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 &#171;\u0434\u0435\u043c\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f&#187; \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e &#8212; systemd \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0442\u0435\u0440\u044f\u0435\u0442 \u0435\u0433\u043e \u0438\u0437 \u0432\u0438\u0434\u0443.<\/p>\n<ul>\n<li>\n<p><code>Type=forking<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435:\u00a0\u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c &#171;\u0434\u0435\u043c\u043e\u043d\u0430&#187;. \u041f\u0440\u043e\u0446\u0435\u0441\u0441, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432\u00a0<code>ExecStart<\/code>, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f, \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u043e\u0442\u043e\u043c\u043a\u0430 (fork) \u0438 \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f. Systemd \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0438 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.<\/p>\n<p>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440: \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u044c <code>PIDFile=...<\/code> (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, <code>PIDFile=\/run\/<\/code><a href=\"http:\/\/nginx.pid\" rel=\"noopener noreferrer nofollow\"><code>nginx.pid<\/code><\/a>). \u042d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0447\u0442\u043e\u0431\u044b systemd \u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u043b, \u043a\u0430\u043a\u043e\u0439 PID (\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430) \u0443 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043c\u043e\u0433 \u0435\u0433\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438\u043b\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c: \u0434\u043b\u044f \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0434\u0435\u043c\u043e\u043d\u043e\u0432, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0434 SysV init (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, nginx, Apache, MySQL \u0438 \u043f\u0440\u043e\u0447\u0438\u0435), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0442 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430.<\/p>\n<ul>\n<li>\n<p><code>Type=oneshot<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435: \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c\u0441\u044f. Systemd \u0431\u0443\u0434\u0435\u0442 \u0442\u0435\u0440\u043f\u0435\u043b\u0438\u0432\u043e \u043e\u0436\u0438\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 <code>ExecStart<\/code>, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u0442 \u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u044e\u043d\u0438\u0442\u043e\u0432, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0445 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/p>\n<p>\u041a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f: \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441 <code>RemainAfterExit=yes<\/code>. \u042d\u0442\u0430 \u043e\u043f\u0446\u0438\u044f \u0433\u043e\u0432\u043e\u0440\u0438\u0442 systemd \u0441\u0447\u0438\u0442\u0430\u0442\u044c \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 \u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u042d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043c\u043e\u043d\u0442\u0438\u0440\u0443\u044e\u0442 \u0434\u0438\u0441\u043a\u0438 \u0438\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442 \u0441\u0435\u0442\u044c), \u043d\u043e \u0441\u0430\u043c\u0438 \u043f\u043e \u0441\u0435\u0431\u0435 \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c: \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0440\u0430\u0437\u043e\u0432\u044b\u0445 \u0437\u0430\u0434\u0430\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/p>\n<ul>\n<li>\n<p><code>Type=notify<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435: \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c systemd \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 (\u0441\u0438\u0433\u043d\u0430\u043b <code>sd_notify<\/code>), \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u0438 \u0433\u043e\u0442\u043e\u0432 \u043a \u0440\u0430\u0431\u043e\u0442\u0435. Systemd \u0431\u0443\u0434\u0435\u0442 \u0436\u0434\u0430\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0435 \u043e\u0442 \u043d\u0435\u0433\u043e \u044e\u043d\u0438\u0442\u044b.<\/p>\n<p>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f: \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 API systemd \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 (\u0447\u0435\u0440\u0435\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <code>libsystemd<\/code> \u0438\u043b\u0438 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0439 \u0441\u043e\u043a\u0435\u0442).<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c: \u0434\u043b\u044f \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0434\u0435\u043c\u043e\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u0434 systemd (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, systemd itself, sshd). \u042d\u0442\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u0447\u043d\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<ul>\n<li>\n<p><code>Type=dbus<\/code> &#8212; \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u0440\u0430\u0441\u043f\u043e\u0440\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0439<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435: \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0433\u043e\u0442\u043e\u0432\u044b\u043c, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 \u0448\u0438\u043d\u0435 D-Bus.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c: \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0447\u0435\u0440\u0435\u0437 D-Bus.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f forking-\u0434\u043e\u043c\u0435\u043d\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430):<\/p>\n<pre><code>[Unit] Description=My Forking Web Service  [Service] Type=forking PIDFile=\/run\/my-webservice.pid ExecStart=\/usr\/bin\/my-webservice --daemon --pid-file=\/run\/my-webservice.pid ExecReload=\/bin\/kill -HUP $MAINPID  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<\/div>\n<\/details>\n<h4>3. \u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430<\/h4>\n<p>Systemd \u0441\u0442\u0440\u043e\u0438\u0442 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u044e\u043d\u0438\u0442\u0430\u043c\u0438. \u0410\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b\u00a0<code>After<\/code>,\u00a0<code>Before<\/code>,\u00a0<code>Requires<\/code>,\u00a0<code>Wants<\/code>, \u043e\u043d \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u044e\u043d\u0438\u0442\u043e\u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e. \u041d\u0435 \u0441\u043b\u0435\u043f\u043e\u0439 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c, \u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0435 \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044f\u0432\u043d\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u0438\u043b.<\/p>\n<h4>4. Cgroups \u0438 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432<\/h4>\n<p>\u042d\u0442\u043e \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 SysVinit. Systemd \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0432 \u0441\u0432\u043e\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e\u00a0cgroup\u00a0(control group). \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442:<\/p>\n<ul>\n<li>\n<p>\u0422\u043e\u0447\u043d\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0441\u043b\u0443\u0436\u0431\u044b:\u00a0\u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 (<code>ExecStart<\/code>) \u043f\u043e\u0440\u043e\u0434\u0438\u043b \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 (fork), \u043e\u043d\u0438 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043d\u0443\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 cgroup. \u041a\u043e\u043c\u0430\u043d\u0434\u0430\u00a0<code>systemctl status<\/code>\u00a0\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0449\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0443.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b:\u00a0\u0447\u0435\u0440\u0435\u0437 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u044e\u043d\u0438\u0442\u0430 (<code>MemoryMax=<\/code>,\u00a0<code>CPUQuota=<\/code>) \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043b\u0438\u043c\u0438\u0442\u044b \u043d\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438, CPU, I\/O \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0441\u043b\u0443\u0436\u0431\u044b:\u00a0\u043f\u0440\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 systemd \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0432 \u0435\u0433\u043e cgroup, \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 &#171;\u0437\u043e\u043c\u0431\u0438&#187;-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0435\u043e\u0440\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0432\u0443\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 (<code>systemd-cgls<\/code> \u0438 <code>systemd-cgtop<\/code>), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 systemd \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0445 \u0433\u0440\u0443\u043f\u043f.<\/p>\n<p><strong> \u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435<\/strong>: \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b\u00a0<code>systemd-cgls<\/code>\u00a0\u0438\u00a0<code>systemd-cgtop<\/code>.<\/p>\n<ul>\n<li>\n<p><code>Systemd-cgls<\/code> &#8212; \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 cgroup \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0442\u043e\u043c\u0443, \u043a\u0430\u043a\u00a0<code>ls<\/code>\u00a0\u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b\u044b. \u042d\u0442\u043e \u043b\u0443\u0447\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431\u00a0\u043f\u043e\u043d\u044f\u0442\u044c \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c\u00a0\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u0451\u0442 systemd. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"bash\"># \u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0451 \u0434\u0440\u0435\u0432\u043e cgroup \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 nginx  systemd-cgls \/system.slice\/nginx.service  # \u0411\u0443\u0434\u0443\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 cgroup: # |-1234 \/usr\/sbin\/nginx -g daemon off: # |-1235 nginx: worker process # |-1236 nginx: cache loader process<\/code><\/pre>\n<ul>\n<li>\n<p><code>systemd-cgtop<\/code> &#8212; \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 (CPU, \u043f\u0430\u043c\u044f\u0442\u044c, \u0432\u0432\u043e\u0434\/\u0432\u044b\u0432\u043e\u0434) \u0432\u0441\u0435\u043c\u0438 cgroup \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0442\u043e\u043c\u0443, \u043a\u0430\u043a <code>top<\/code> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u044d\u0442\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430:<\/p>\n<\/li>\n<\/ul>\n<pre><code>Control Group               Tasks   %CPU   Memory  Input\/s Output\/s \/                            257    15.8     3.9G       0B     0B \/system.slice\/nginx.service    3     0.1    30.0M       0B     0B \/system.slice\/mysql.service   45    12.5     1.1G       0B     0B \/user.slice\/user-1000.slice  120     3.2   800.0M       0B     0B<\/code><\/pre>\n<h4>5. \u0416\u0443\u0440\u043d\u0430\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (journald)<\/h4>\n<ul>\n<li>\n<p>\u0411\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u043b\u043e\u0433\u043e\u0432:\u00a0\u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432\u00a0<code>syslog<\/code>,\u00a0<code>journald<\/code>\u00a0\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u043e\u0432 (\u043e\u0431\u044b\u0447\u043d\u043e \u0432\u00a0<code>\/var\/log\/journal\/<\/code>). \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438 \u043f\u043e \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c.<\/p>\n<\/li>\n<li>\n<p>\u041c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435:\u00a0\u043a\u0430\u0436\u0434\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0436\u0443\u0440\u043d\u0430\u043b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043d\u043e \u0438 \u043c\u0430\u0441\u0441\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438:\u00a0<code><em>PID<\/em><\/code><em>,\u00a0<\/em><code>UID<\/code>,\u00a0<code><em>SYSTEMD<\/em>UNIT<\/code>,\u00a0<code><em>EXE<\/em><\/code><em>,\u00a0<\/em><code>CMDLINE<\/code>,\u00a0<code>_HOSTNAME<\/code>\u00a0\u0438 \u0442.\u0434.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0440\u043e\u0441\u044b:\u00a0\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u00a0<code>journalctl<\/code>\u00a0\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u044d\u0442\u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u0430\u043a \u043f\u043e\u043b\u044f \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438:<\/p>\n<\/li>\n<\/ul>\n<pre><code># \u041b\u043e\u0433\u0438 \u0434\u043b\u044f nginx \u0441 PID 1234 \u0438 \u043b\u043e\u0433\u0438 \u0434\u043b\u044f php-fpm journalctl _SYSTEMD_UNIT=nginx.service _PID=1234 + _SYSTEMD_UNIT=php-fpm.service <\/code><\/pre>\n<h4>6. D-Bus<\/h4>\n<p>\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u0435\u0436\u0434\u0443\u00a0<code>systemctl<\/code>, \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u043c\u0438 (<code>journalctl<\/code>,\u00a0<code>hostnamectl<\/code>) \u0438 \u0434\u0435\u043c\u043e\u043d\u043e\u043c\u00a0<code>systemd<\/code>\u00a0\u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437\u00a0D-Bus\u00a0(\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0443\u044e \u0448\u0438\u043d\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439). \u042d\u0442\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439, \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u0438 \u0433\u0438\u0431\u043a\u0438\u0439 IPC-\u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0435\u00a0<code>systemctl start nginx<\/code>,\u00a0<code>systemctl<\/code>\u00a0\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 D-Bus-\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0443\u00a0<code>StartUnit<\/code>\u00a0\u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0443\u044e \u0448\u0438\u043d\u0443, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0434\u0435\u043c\u043e\u043d\u00a0<code>systemd<\/code>.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e D-Bus<\/summary>\n<div class=\"spoiler__content\">\n<p>D-Bus \u0438\u043b\u0438 Desktop Bus &#8212; \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043e\u0431\u043c\u0435\u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u043c\u0438 \u0432 LInux, \u043d\u0435\u043a\u0438\u0439 &#171;\u043f\u043e\u0441\u0440\u0435\u0434\u043d\u0438\u043a&#187; \u0434\u043b\u044f \u043e\u0431\u0449\u0435\u043d\u0438\u044f. <\/p>\n<p>\u041f\u043e\u043d\u0438\u043c\u0430\u044e, \u0447\u0442\u043e \u043a\u043e\u043c\u0443-\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e (\u043a\u043e\u0433\u0434\u0430-\u0442\u043e \u0432 \u043f\u043e\u043f\u044b\u0442\u043a\u0430\u0445 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f &#8212; \u0447\u0443\u0442\u043e\u043a \u0443\u0442\u043e\u043d\u0443\u043b \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c Wiki), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u043e\u0441\u0442\u0443\u044e <strong>\u0430\u043d\u0430\u043b\u043e\u0433\u0438\u044e<\/strong>:<\/p>\n<p>D-Bsu &#8212; \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440 \u0432 \u0442\u0430\u043a\u0441\u0438. \u0427\u0435\u043b\u043e\u0432\u0435\u043a (<code>systemctl<\/code>) \u0437\u0432\u043e\u043d\u0438\u0442 \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0443 \u0441\u043e \u0441\u043b\u043e\u0432\u0430\u043c\u0438: &#171;\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u043b\u0443\u0436\u0431\u0443 nginx&#187;. \u0414\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440 (D-Bus) \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044e (<code>systemd<\/code>), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0435\u0451 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442.<\/p>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c, \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435:<\/p>\n<pre><code># \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 systemctl start nginx  # systemctl \u0447\u0435\u0440\u0435\u0437 D-Bus \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435: \"\u0417\u0430\u043f\u0443\u0441\u0442\u0438 nginx\" # systemd \u0447\u0435\u0440\u0435\u0437 D-Bus \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u044d\u0442\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 # systemd \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0441\u043b\u0443\u0436\u0431\u0443 \u0438 \u0447\u0435\u0440\u0435\u0437 D-Bus \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0443\u0441<\/code><\/pre>\n<\/div>\n<\/details>\n<h3>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0422\u0435\u043e\u0440\u0438\u044f &#8212; \u0432\u0441\u0435\u0433\u0434\u0430 \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u043a\u0443\u0434\u0430 \u0431\u0435\u0437 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438? \u0414\u0430\u043b\u0435\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f &#171;\u0432\u0441\u0435\u0433\u043e \u0438 \u0432\u0441\u044f&#187;.<\/p>\n<h4>1. \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0441\u043b\u0443\u0436\u0431\u044b: \u0437\u0430\u043f\u0443\u0441\u043a, \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430, \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430<\/h4>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u043c, \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0441\u043b\u0443\u0436\u0431\u044b. \u0414\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e, \u043d\u0435 \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435.<\/p>\n<pre><code class=\"bash\"># \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0441\u043b\u0443\u0436\u0431\u0443 \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e systemctl start &lt;service_name&gt; # \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: sudo systemctl start nginx<\/code><\/pre>\n<pre><code class=\"bash\"># \u041e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0441\u043b\u0443\u0436\u0431\u0443 \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e systemclt stop &lt;service_name&gt; # \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: sudo systemctl stop sshd<\/code><\/pre>\n<pre><code class=\"bash\"># \u041f\u043e\u043b\u043d\u0430\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u043b\u0443\u0436\u0431\u044b. \u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 stop, \u0437\u0430\u0442\u0435\u043c start # \u041f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441 \"\u0447\u0438\u0441\u0442\u043e\u0433\u043e\" \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f systemctl restart &lt;service_name&gt; # \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: sudo systemctl restart apache2<\/code><\/pre>\n<pre><code class=\"bash\"># \u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0441\u043b\u0443\u0436\u0431\u044b \u0431\u0435\u0437 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 # \u0412\u0430\u0436\u043d\u043e! \u042d\u0442\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u0441\u043b\u0443\u0436\u0431\u044b. \u0421\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043b\u0438\u0448\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044f \u0441\u0432\u043e\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 # \u041f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043d\u0435\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0444\u0438\u0433 \u0434\u043b\u044f \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0435\u0432 systemctl reload &lt;service_name&gt; # \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: sudo systemctl reload nginx # \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043a\u043e\u043d\u0444\u0438\u0433 \u0431\u0435\u0437 \u0440\u0430\u0437\u0440\u044b\u0432\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 <\/code><\/pre>\n<pre><code class=\"bash\"># \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0443\u0441 \u0441\u043b\u0443\u0436\u0431\u044b:  # \u0430\u043a\u0442\u0438\u0432\u0435\u043d\/\u043d\u0435\u0430\u043a\u0442\u0438\u0432\u0435\u043d, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u043b\u0438 \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043b\u043e\u0433, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u043d\u0444\u043e \u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435  systemctl status &lt;service_name&gt; \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: systemctl status cron<\/code><\/pre>\n<h4>2. \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439<\/h4>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442 \u0442\u0435\u043c, \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 \u0441\u043b\u0443\u0436\u0431\u0430 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438\u043b\u0438 \u043f\u0440\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0446\u0435\u043b\u0438 (<code>target<\/code>). \u041d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442 \u0438 \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442 \u0441\u043b\u0443\u0436\u0431\u0443 \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e.<\/p>\n<pre><code class=\"bash\"># \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0441\u043b\u0443\u0436\u0431\u044b \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b systemctl enable &lt;service_name&gt;<\/code><\/pre>\n<p>\u0427\u0442\u043e \u043e\u043d\u0430 \u0434\u0435\u043b\u0430\u0435\u0442? \u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 (\u0441\u0438\u043c\u043b\u0438\u043d\u043a\u0438) \u0438\u0437 \u044e\u043d\u0438\u0442-\u0444\u0430\u0439\u043b\u0430 \u0441\u043b\u0443\u0436\u0431\u044b (\u043e\u0431\u044b\u0447\u043d\u043e \u0432\u00a0<code>\/usr\/lib\/systemd\/system\/<\/code>) \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438\u00a0<code>.wants\/<\/code>\u00a0\u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<code>multi-user.target.wants\/<\/code>\u00a0\u0438\u043b\u0438\u00a0<code>graphical.target.wants<\/code>). \u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0446\u0435\u043b\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u0438\u0434\u0438\u0442 \u044d\u0442\u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0441\u043b\u0443\u0436\u0431\u044b.<\/p>\n<pre><code class=\"bash\"># \u041e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0441\u043b\u0443\u0436\u0431\u044b systemctl disable &lt;service_name&gt;<\/code><\/pre>\n<p>\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442? \u0423\u0434\u0430\u043b\u044f\u0435\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0441\u044b\u043b\u043a\u0438, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u044f \u0441\u0430\u043c\u0443 \u0441\u043b\u0443\u0436\u0431\u0443 \u0438\u0437 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<pre><code class=\"bash\"># \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0443\u0441 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u043b\u0443\u0436\u0431\u044b # \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: enabled, disabled, static, masked systemctl is-enabled &lt;service_name&gt;<\/code><\/pre>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435, \u043a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440: <code>if ! systemctl is-enabled --quiet nginx; then sudo systemctl enable nginx; fi<\/code><\/p>\n<p>\u0422\u0430\u043a\u0436\u0435, \u0445\u043e\u0447\u0443 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c \u043f\u0440\u043e &#171;\u043c\u0430\u0441\u0438\u043a\u0440\u043e\u0432\u043a\u0443&#187;, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f &#171;\u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c \u0437\u0430\u043f\u0440\u0435\u0442\u043e\u043c&#187;. \u042d\u0442\u043e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430\u00a0<code>disable<\/code>.\u00a0<code>Disable<\/code>\u00a0\u043b\u0438\u0448\u044c \u0443\u0431\u0438\u0440\u0430\u0435\u0442 \u0441\u0438\u043c\u043b\u0438\u043d\u043a\u0438, \u043d\u043e \u0441\u0435\u0440\u0432\u0438\u0441 \u0432\u0441\u0435 \u0435\u0449\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0447\u0435\u0440\u0435\u0437\u00a0<code>start<\/code>.\u00a0<code>Mask<\/code>\u00a0\u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0438\u043c\u043b\u0438\u043d\u043a \u043d\u0430\u00a0<code>\/dev\/null<\/code>, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435. \u042d\u0442\u043e \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0443\u044e\u0442 \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b\u00a0<code>NetworkManager<\/code>\u00a0\u0438\u00a0<code>systemd-networkd<\/code>).<\/p>\n<pre><code class=\"bash\"># \u041f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u043b\u0443\u0436\u0431\u044b (\u043b\u044e\u0431\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c) sudo systemctl mask &lt;service_name&gt; # \u0420\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u043b\u0443\u0436\u0431\u044b (\u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435) sudo systemctl unmask &lt;service_name&gt; # \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: \u0435\u0441\u043b\u0438 \u0412\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 networkd, \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c NetworkManager sudo systemctl mask NetworkManager.service<\/code><\/pre>\n<h4>3. \u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u0441\u043b\u0443\u0436\u0431<\/h4>\n<p>\u042d\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0431\u0449\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443 \u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0436\u0431 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.<\/p>\n<pre><code class=\"bash\"># \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u043e\u0431\u0437\u043e\u0440 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b:  # \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u044e\u043d\u0438\u0442\u043e\u0432, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0436\u0443\u0440\u043d\u0430\u043b\u044b... systemctl status # \u0431\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/code><\/pre>\n<pre><code class=\"bash\"># \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u043b\u0443\u0436\u0431\u044b (active, inactive, activating, failed) # \u0412\u044b\u0432\u043e\u0434 \u043a\u0440\u0430\u0442\u043a\u0438\u0439, \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 systemctl is-active &lt;service_name&gt; # \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: systemctl is-active docker # \u0432\u0435\u0440\u043d\u0435\u0442 active \u0438\u043b\u0438 inactive<\/code><\/pre>\n<pre><code class=\"bash\"># \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043b\u0438 \u0441\u043b\u0443\u0436\u044e\u0430 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0441\u0431\u043e\u044f # \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 failed (\u0435\u0441\u043b\u0438 \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0430\u0441\u044c) \u0438\u043b\u0438 active\/inactive \u0438\u043d\u0430\u0447\u0435 # \u041f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u044f systemctl is-failed &lt;service_name&gt;<\/code><\/pre>\n<pre><code class=\"bash\"># \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u044b # \u041f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 systemctl list-units --type=service --state=running \u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441: systemctl --type=service --state=running<\/code><\/pre>\n<pre><code class=\"bash\"># \u041f\u043e\u043a\u0430\u0436\u0435\u0442 \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0438 \u0441\u0442\u0430\u0442\u0443\u0441 \u0438\u0445 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 (enabled, disabled, static, masked) # \u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u0430 \u0441\u043b\u0443\u0436\u0431\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435, \u0430 \u043d\u0435 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 systemclt list-unit-files --type=service \u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441: systemctl --type=service --all<\/code><\/pre>\n<p>\u0421\u0442\u0430\u0442\u0443\u0441 <code>static<\/code> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u044e\u043d\u0438\u0442-\u0444\u0430\u0439\u043b \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u0435\u043a\u0446\u0438\u0438 <code>[Install]<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0433\u043e \u043d\u0435\u043b\u044c\u0437\u044f &#171;<code>enable<\/code>&#171;. \u041e\u0431\u044b\u0447\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0432 \u044d\u0442\u043e\u043c \u0436\u0435 \u0431\u043b\u043e\u043a\u0435, \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439:<\/p>\n<pre><code class=\"bash\"># \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043e\u0442 \u043a\u0430\u043a\u0438\u0445 \u044e\u043d\u0438\u0442\u043e\u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 systemctl list-dependencies &lt;service_name&gt;  # \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a\u0438\u0435 \u044e\u043d\u0438\u0442\u044b \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 (\u043a\u0442\u043e \u0435\u0433\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442) systemctl list-dependencies --reverse &lt;service_name&gt;  # \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0434\u0435\u0440\u0435\u0432\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u0432\u0438\u0434\u0435 \u0434\u0440\u0435\u0432\u043e\u0432\u0438\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b systemctl list-dependencies --tree &lt;service_name&gt; # \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: systemctl list-dependencies graphical.target --tree | head -20  # \u0410 \u0442\u0430\u043a\u0436\u0435: # --all - \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 (\u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435) # --reverse \u0438\u043b\u0438 -r - \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u044e\u043d\u0438\u0442\u044b \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e (\u043a\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044d\u0442\u0443 \u0441\u043b\u0443\u0436\u0431\u0443) # --before \/ --after - \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u044e\u043d\u0438\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \"\u0434\u043e \u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435\" \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e<\/code><\/pre>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0441\u043b\u0443\u0436\u0431\u044b \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430:<\/p>\n<pre><code class=\"bash\">systemctl list-dependencies --reverse NetworkManager.service<\/code><\/pre>\n<p>\u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0441\u043b\u0443\u0436\u0431\u044b \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u0435\u0441\u043b\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <code>NetworkManager<\/code>.<\/p>\n<h4>4. \u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u043b\u043e\u0433\u043e\u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0441\u043b\u0443\u0436\u0431\u044b<\/h4>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0436\u0443\u0440\u043d\u0430\u043b\u0430\u043c\u0438 \u0432 systemd &#8212; <code>journalctl<\/code>. \u0412\u0441\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043e\u0431\u044b\u0447\u043d\u043e \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u00a0<code>sudo<\/code>\u00a0\u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u043b\u043e\u0433\u0430.<\/p>\n<pre><code class=\"bash\"># \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0436\u0443\u0440\u043d\u0430\u043b\u0435 (\u043b\u043e\u0433\u0438) \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0441\u043b\u0443\u0436\u0431\u044b \u0437\u0430 \u0432\u0441\u0451 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f journalclt -u &lt;service_name&gt;<\/code><\/pre>\n<pre><code class=\"bash\"># \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043b\u043e\u0433\u0438 \u0441\u043b\u0443\u0436\u0431\u044b \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 journalctl -u &lt;service_name&gt; --since today # \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:  sudo journalctl -u sshd --since \"1 hour ago\" # \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u043e \u0441 SSH \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0447\u0430\u0441?<\/code><\/pre>\n<p>\u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0443\u0437\u0438\u0442\u044c \u0432\u0432\u043e\u0434, \u0434\u0430\u0431\u044b \u043d\u0435 \u043b\u0438\u0441\u0442\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0436\u0443\u0440\u043d\u0430\u043b\u043e\u0432. \u0412\u043c\u0435\u0441\u0442\u043e <code>today<\/code> \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>yesterday<\/code>, <code>\"2025-01-01 00:00:00\"<\/code> \u0438 \u0442\u0434.<\/p>\n<pre><code class=\"bash\"># \"\u0420\u0435\u0436\u0438\u043c\" \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (follow). \u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u043b\u043e\u0433\u0438 # \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u043e \u043c\u0435\u0440\u0435 \u0438\u0445 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f journalctl -u &lt;service_name&gt; -f # \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:  sudo journalctl -u apache2 -f # \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0437\u0430 \u043b\u043e\u0433\u0430\u043c\u0438 Apache \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/code><\/pre>\n<h4>5. \u041f\u043e\u0438\u0441\u043a \u043f\u0440\u0438\u0447\u0438\u043d \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439<\/h4>\n<p>\u042d\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0439\u0442\u0438 \u0441\u043b\u0443\u0436\u0431\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0441\u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f, \u0438 \u043f\u043e\u043d\u044f\u0442\u044c \u043e\u0431\u0449\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443 \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<pre><code class=\"bash\"># \u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0432\u0441\u0435\u0445 \u044e\u043d\u0438\u0442\u043e\u0432 (\u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u0443\u0436\u0431), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 failed systemctl --failed<\/code><\/pre>\n<pre><code class=\"bash\"># \u041f\u043e\u043a\u0430\u0436\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u0441 \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \"\u043e\u0448\u0438\u0431\u043a\u0430\" \u0438 \u0432\u044b\u0448\u0435 (crit, alert...) journalctl -p err..alert<\/code><\/pre>\n<pre><code class=\"bash\"># \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u043b\u043e\u0433\u0438 \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b # \u041f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u043b\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0442\u0430\u0440\u0442\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b journalclt -b # \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: sudo journalctl -b -1 # \u0427\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u043f\u0430\u0434\u0435\u043d\u0438\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u043f\u0440\u043e\u0448\u043b\u044b\u0439 \u0440\u0430\u0437?<\/code><\/pre>\n<h4>6. \u0410\u043d\u0430\u043b\u0438\u0437 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/h4>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0431\u043b\u043e\u043a &#8212; \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u043e\u0438\u0441\u043a\u0430 &#171;\u0443\u0437\u043a\u0438\u0445 \u043c\u0435\u0441\u0442&#187; \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<pre><code class=\"bash\"># \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f, \u0437\u0430\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u043e\u0435 \u043d\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u044f\u0434\u0440\u0430 \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 # \u041f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u0449\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 systemd-analyze # \u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430: Startup finished in 4.567s (kernel) + 1min 12.345s (userspace) = 1min 16.912s<\/code><\/pre>\n<pre><code class=\"bash\"># \u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u043a\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0433\u0440\u0443\u0437\u0438\u043b\u0438\u0441\u044c # \u0421\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438\u0445 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 systemd-analyze blame<\/code><\/pre>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f, \u0442\u043a \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u0430\u043a\u0430\u044f \u0441\u043b\u0443\u0436\u0431\u0430 \u0437\u0430\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0430\u0440\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u044b (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0438\u043b\u0438 \u0430\u043d\u0442\u0438\u0432\u0438\u0440\u0443\u0441). \u041f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0432 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<pre><code class=\"bash\"># \u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 systemd-analyze critical-chain &lt;service_name&gt; # \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: systemd-analyze critical-chain graphical.targer # \u041f\u043e\u0447\u0435\u043c\u0443 \u0433\u0440\u0430\u0444. \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0442\u0430\u043a \u0434\u043e\u043b\u0433\u043e \u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044f?<\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438: \u043a\u0430\u043a\u0438\u0435 \u0441\u043b\u0443\u0436\u0431\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f \u0434\u043e \u043d\u0435\u0433\u043e, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0437\u0430\u043d\u044f\u043b \u043a\u0430\u0436\u0434\u044b\u0439 \u0448\u0430\u0433. \u0412\u044b\u0434\u0435\u043b\u044f\u0435\u0442 &#171;\u0443\u0437\u043a\u0438\u0435 \u043c\u0435\u0441\u0442\u0430&#187;, \u0437\u0430\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u0441\u0442\u0430\u0440\u0442 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0441\u043b\u0443\u0436\u0431\u044b.<\/p>\n<p><strong>\u041a\u0440\u0430\u0442\u043a\u0430\u044f \u0448\u043f\u0430\u0440\u0433\u0430\u043b\u043a\u0430 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430:<\/strong><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0417\u0430\u0434\u0430\u0447\u0430<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041a\u043e\u043c\u0430\u043d\u0434\u0430<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043b\u043e\u0433\u0438 \u0441\u043b\u0443\u0436\u0431\u044b<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>journalctl -u &lt;\u0438\u043c\u044f_\u0441\u043b\u0443\u0436\u0431\u044b&gt;<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u041b\u043e\u0433\u0438 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>journalctl -u &lt;\u0438\u043c\u044f_\u0441\u043b\u0443\u0436\u0431\u044b&gt; -f<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u041a\u0442\u043e \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f?<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>systemctl --failed<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u041a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>journalctl -p err..alert<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u041b\u043e\u0433\u0438 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>journalctl -b -1<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u0427\u0442\u043e \u0433\u0440\u0443\u0437\u0438\u043b\u043e\u0441\u044c \u0434\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0445?<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>systemd-analyze blame<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u041f\u043e\u0447\u0435\u043c\u0443 \u0433\u0440\u0443\u0437\u0438\u043b\u0441\u044f X?<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>systemd-analyze critical-chain <\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>\u0420\u0430\u0437\u0431\u043e\u0440 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432<\/h3>\n<h4>1. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/h4>\n<p>\u0418\u0442\u0430\u043a, \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f: \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043b\u0443\u0436\u0431\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u044d\u0445\u043e-\u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 Python \u0438 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0443 (\u0440\u0435\u0441\u0442\u0430\u0440\u0442\u0438\u0442 \u043f\u043e\u0441\u043b\u0435 \u043f\u0430\u0434\u0435\u043d\u0438\u044f).<\/p>\n<p><strong>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 (<\/strong><code><strong>\/usr\/local\/bin\/echo-server.py<\/strong><\/code><strong>):<\/strong><\/p>\n<pre><code class=\"python\">#!\/usr\/bin\/env python3 import socket  HOST = '0.0.0.0' PORT = 12345  with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:     s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)     s.bind((HOST, PORT))     s.listen()     print(f\"Echo server listening on {HOST}:{PORT}\")     while True:         conn, addr = s.accept()         with conn:             print(f\"Connected by {addr}\")             data = conn.recv(1024)             if not data:                 break             conn.sendall(data)<\/code><\/pre>\n<p><strong>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u044e\u043d\u0438\u0442-\u0444\u0430\u0439\u043b (<\/strong><code><strong>\/etc\/systemd\/system\/echo.service<\/strong><\/code><strong>):<\/strong><\/p>\n<pre><code>[Unit] Description=Simple Echo Server Documentation=https:\/\/example.com # \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0441\u0435\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u0430 After=network.target  [Service] Type=simple # \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0443 \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0443 ExecStart=\/usr\/bin\/python3 \/usr\/local\/bin\/echo-server.py # \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0432\u0441\u0435\u0433\u0434\u0430, \u0435\u0441\u043b\u0438 \u043e\u043d \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0441\u044f \u043d\u0435 \u0442\u0430\u043a, \u043a\u0430\u043a \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c Restart=on-failure # \u0416\u0434\u0430\u0442\u044c 5 \u0441\u0435\u043a\u0443\u043d\u0434 \u043f\u0435\u0440\u0435\u0434 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c RestartSec=5 # \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u043d\u0435\u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0434\u043b\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 User=nobody Group=nogroup  # \u0412\u0430\u0436\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 # \u0417\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u043c \u043b\u044e\u0431\u044b\u0435 \u043f\u0440\u0430\u0432\u0430 root NoNewPrivileges=yes # \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 CapabilityBoundingSet= # \u0417\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c ProtectSystem=strict ProtectHome=read-only PrivateTmp=yes  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c:<\/strong><\/p>\n<pre><code class=\"bash\"># \u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e systemd \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u044e\u043d\u0438\u0442\u0430 sudo systemctl daemon-reload  # \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 sudo systemctl enable echo.service  # \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 sudo systemctl start echo.service  # \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u0442\u0430\u0442\u0443\u0441 \u0438 \u043b\u043e\u0433\u0438 sudo systemctl status echo.service journalctl -u echo.service -f  # \u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u044d\u0445\u043e-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 echo \"Hello, Habr!\" | nc localhost 12345  # \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f. \u0421\u0438\u043c\u0443\u043b\u0438\u0440\u0443\u0435\u043c \u043f\u0430\u0434\u0435\u043d\u0438\u0435: sudo kill -TERM $(systemctl show echo.service --property=MainPID --value) # \u0427\u0435\u0440\u0435\u0437 5 \u0441\u0435\u043a\u0443\u043d\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u0442\u0430\u0442\u0443\u0441 \u0441\u043d\u043e\u0432\u0430 - \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0430\u043a\u0442\u0438\u0432\u0435\u043d sudo systemctl status echo.service<\/code><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044f \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0441 \u043d\u0443\u043b\u044f, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043f\u043e\u043b\u0438\u0442\u0438\u043a, \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<h4>2. \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e cgroups<\/h4>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430: \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u044d\u0445\u043e-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0434\u043e 50\u041c\u0411 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 CPU, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0434\u043e 50% \u043e\u0434\u043d\u043e\u0433\u043e \u044f\u0434\u0440\u0430.<\/p>\n<p>\u041c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u044e\u043d\u0438\u0442-\u0444\u0430\u0439\u043b \u0441\u0435\u0440\u0432\u0438\u0441\u0430 (<code>\/etc\/systemd\/system\/echo.service<\/code>), \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u0432 \u0441\u0435\u043a\u0446\u0438\u044e <code>[Service]<\/code>:<\/p>\n<pre><code>[Service] ... # Memory Limits # \u0416\u0435\u0441\u0442\u043a\u0438\u0439 \u043b\u0438\u043c\u0438\u0442 \u043f\u0430\u043c\u044f\u0442\u0438. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0431\u0443\u0434\u0435\u0442 \u0443\u0431\u0438\u0442 (OOM Killer), \u0435\u0441\u043b\u0438 \u043f\u0440\u0435\u0432\u044b\u0441\u0438\u0442 \u0435\u0433\u043e. MemoryMax=50M # \u041c\u044f\u0433\u043a\u0438\u0439 \u043b\u0438\u043c\u0438\u0442. Systemd \u043d\u0430\u0447\u043d\u0435\u0442 \u0430\u0433\u0440\u0435\u0441\u0441\u0438\u0432\u043d\u043e \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044f \u043a\u0435\u0448\u0438), # \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0440\u0435\u0432\u044b\u0441\u0438\u0442 \u044d\u0442\u043e\u0442 \u043b\u0438\u043c\u0438\u0442, \u043d\u043e \u043d\u0435 \u0443\u0431\u044c\u0435\u0442 \u0435\u0433\u043e \u0441\u0440\u0430\u0437\u0443. MemoryHigh=40M  # CPU Limits # \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 CPU \u0434\u043e 50% \u043e\u0434\u043d\u043e\u0433\u043e \u044f\u0434\u0440\u0430. CPUQuota=50% ...  # \u041f\u043e\u0441\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c sudo systemctl daemon-reload sudo systemctl restart echo.service<\/code><\/pre>\n<p><strong>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f:<\/strong><\/p>\n<pre><code class=\"bash\"># \u0421\u043c\u043e\u0442\u0440\u0438\u043c, \u0432 \u043a\u0430\u043a\u0443\u044e cgroup \u043f\u043e\u043c\u0435\u0449\u0435\u043d \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 systemd-cgls \/system.slice\/echo.service  # \u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u044d\u0442\u043e\u0439 cgroup \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 systemd-cgtop -p \/system.slice\/echo.service  # \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b cgroup \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e cat \/sys\/fs\/cgroup\/system.slice\/echo.service\/memory.max # \u0414\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c: 52428800 (50 \u041c\u0411 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445)<\/code><\/pre>\n<h4>3. \u041f\u043e\u0438\u0441\u043a \u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e journalctl<\/h4>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430: \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u0438\u0447\u0438\u043d\u0443 \u043f\u0430\u0434\u0435\u043d\u0438\u044f \u0441\u043b\u0443\u0436\u0431\u044b <code>my-app.service<\/code> (\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f, \u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043f\u0430\u0434\u0430\u0435\u0442).<\/p>\n<pre><code class=\"bash\"># 1. \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0442\u0430\u0442\u0443\u0441 - \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0441\u0435\u0440\u0432\u0438\u0441 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 failed sudo systemctl status my-app.service # \u0412 \u0432\u044b\u0432\u043e\u0434\u0435 \u0447\u0430\u0441\u0442\u043e \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u043e\u0448\u0438\u0431\u043a\u0438  # 2. \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043b\u043e\u0433\u0438 \u0441\u043b\u0443\u0436\u0431\u044b \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0437\u0430\u043f\u0443\u0441\u043a journalctl -u my-app.service -n 20 --no-pager  # 3. \u0415\u0441\u043b\u0438 \u043b\u043e\u0433\u0430 \u043d\u0435\u0442 \u0438\u043b\u0438 \u0435\u0433\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043b\u043e\u0433\u0438 \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u043c \u0432\u044b\u0432\u043e\u0434\u043e\u043c journalctl -u my-app.service --since \"10 min ago\" -o verbose # \u041a\u043b\u044e\u0447 `-o verbose` \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0432\u0441\u0435 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, UID, GID, \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443), # \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438  # 4. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0432 \u043b\u043e\u0433\u0430\u0445 \u0432\u0438\u0434\u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u043f\u043e\u0440\u0442\u0443 5432. # \u0418\u0449\u0435\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u043e \u0441 PostgreSQL (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u043e\u0440\u0442) \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f journalctl -u postgresql.service --since \"10 min ago\" | tail -20  # 5. \u0418\u043b\u0438 \u0438\u0449\u0435\u043c \u0432\u0441\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 (\u0443\u0440\u043e\u0432\u0435\u043d\u044c ERR \u0438 \u0432\u044b\u0448\u0435) \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0437\u0430 \u044d\u0442\u043e\u0442 \u043f\u0435\u0440\u0438\u043e\u0434 journalctl -p err..alert --since \"10 min ago\"  # 6. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043c\u0435\u0448\u0430\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0443 # \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 systemd \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 sudo systemctl status my-app.service -l --no-pager # \u0418\u043b\u0438 \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0441 \u0432\u044b\u0432\u043e\u0434\u043e\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c sudo systemctl start my-app.service<\/code><\/pre>\n<p><code>Journalctl<\/code> \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c\u0438 \u043a\u043b\u044e\u0447\u0430\u043c\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 (<code>-u<\/code>, <code>-p<\/code>, <code>-since<\/code>, <code>-o<\/code>) &#8212; \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0438 \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441\u043e \u0441\u043b\u0443\u0436\u0431\u0430\u043c\u0438.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>Systemd &#8212; \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u0430\u044f, \u0433\u043b\u0443\u0431\u043e\u043a\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0430\u043b\u0430 \u043d\u0435\u043e\u0442\u044a\u0435\u043c\u043b\u0435\u043c\u044b\u043c \u0441\u043a\u0435\u043b\u0435\u0442\u043e\u043c \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432 Linux. \u0415\u0451 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 \u044e\u043d\u0438\u0442\u043e\u0432, cgroups \u0438 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0436\u0443\u0440\u043d\u0430\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u0430\u0440\u0434\u0438\u043d\u0430\u043b\u044c\u043d\u043e \u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043e\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u0432\u0441\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0438 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u0438, \u0447\u0442\u043e \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043b\u0438\u0447\u043d\u043e \u044f\u0432\u043b\u044f\u043b\u043e\u0441\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043e\u043c, \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0451 \u0432\u043e\u0435\u0434\u0438\u043d\u043e, \u0431\u0435\u0437 \u0432\u043e\u0434\u044b. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435\u043c \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e <a href=\"https:\/\/habr.com\/ru\/articles\/933574\/\" rel=\"noopener noreferrer nofollow\"><code>cron<\/code><\/a>, \u0442\u0430\u043a \u043a\u0430\u043a systemd \u0431\u044b\u043b \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442, \u043d\u043e \u043d\u0435 \u0440\u0430\u0441\u043a\u0440\u044b\u0442.<\/p>\n<p><em>P.S. \u0412 \u043c\u043e\u0435\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 \u0432\u00a0<\/em><a href=\"https:\/\/t.me\/helcode\" rel=\"noopener noreferrer nofollow\"><em>\u0422\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u043c<\/em><\/a><em>\u00a0\u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u0435\u0439\u0441\u044b: \u0441\u043a\u0440\u0438\u043f\u0442\u044b (Python\/Bash\/PowerShell), \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438 \u041e\u0421 \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b.<\/em>  <\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/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\/articles\/942760\/\"> https:\/\/habr.com\/ru\/articles\/942760\/<\/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-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! Systemd &#8212; \u0441\u043a\u0435\u043b\u0435\u0442 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e Linux. \u041e\u043d \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u0443\u0436\u0431\u0430\u043c\u0438, \u043d\u043e \u0438 \u0442\u0430\u0439\u043c\u0435\u0440\u0430\u043c\u0438, \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c&#8230; \u041f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0435\u0433\u043e = \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e &#8212; \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b: \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430, \u044e\u043d\u0438\u0442\u044b, cgroups, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0436\u0443\u0440\u043d\u0430\u043b\u0430\u043c\u0438. \u0422\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0438.<\/p>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412 \u043c\u0438\u0440\u0435 Linux \u0438 Unix-\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438\u00a0SysVinit. \u0415\u0451 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0431\u044b\u043b \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c: \u043e\u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u044b (\u043e\u0431\u044b\u0447\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0432\u00a0<code>\/etc\/rc.d\/<\/code>\u00a0\u0438\u043b\u0438\u00a0<code>\/etc\/init.d\/<\/code>) \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443, \u0432 \u0441\u0442\u0440\u043e\u0433\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u043c \u0441\u0438\u043c\u043b\u0438\u043d\u043a\u0430\u043c\u0438 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u0445\u00a0<code>rcN.d<\/code>.<\/p>\n<p>\u041d\u043e \u0441 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435\u043c Linux \u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u0438\u0441\u0442\u0435\u043c &#8212; \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 SysVinit \u0441\u0442\u0430\u043b\u0438 \u0432\u043f\u043e\u043b\u043d\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b:<\/p>\n<ol>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a: \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u043e\u0434\u0438\u043d \u0437\u0430 \u0434\u0440\u0443\u0433\u0438\u043c. \u0415\u0441\u043b\u0438 \u0441\u043b\u0443\u0436\u0431\u0430 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0435\u043b\u0430 \u043e\u0442 \u0434\u0440\u0443\u0433\u043e\u0439 &#8212; \u043e\u043d\u0430 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0436\u0434\u0430\u043b\u0430 \u0441\u0432\u043e\u0435\u0439 \u043e\u0447\u0435\u0440\u0435\u0434\u0438, \u0447\u0442\u043e \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u043b\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0437\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438. Init \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u043d\u043e \u043d\u0435 \u043c\u043e\u0433 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0441\u043b\u0443\u0436\u0431 (\u0443\u043f\u0430\u043b\u0430? \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438?).<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u0440\u043e\u0437\u043d\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041a\u0430\u0436\u0434\u0430\u044f \u0441\u043b\u0443\u0436\u0431\u0430 \u0432\u0435\u043b\u0430 \u043b\u043e\u0433\u0438 &#171;\u043f\u043e-\u0441\u0432\u043e\u0435\u043c\u0443&#187; (\u0432 <code>\/var\/log\/<\/code>), \u043d\u0435 \u0431\u044b\u043b\u043e \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u0435\u0434\u0438\u043d\u043e\u0433\u043e \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u043b\u043e\u0433\u043e\u0432.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e\u043b\u0430\u0433\u0430\u044e, \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u0440\u0438\u0432\u0435\u043b\u0438 \u043a \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432 (Upstart, OpenRC), \u043d\u043e \u0438\u043c\u0435\u043d\u043d\u043e systemd, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u041b\u0435\u043d\u043d\u0430\u0440\u0442\u043e\u043c \u041f\u043e\u0442\u0442\u0435\u0440\u043b\u0438\u043d\u0433\u043e\u043c \u0432 2010 \u0433\u043e\u0434\u0443, \u0441\u0442\u0430\u043b \u043d\u0435\u043a\u0438\u043c &#171;\u0434\u0435-\u0444\u0430\u043a\u0442\u043e&#187; \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u0434\u043b\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043a\u0440\u0443\u043f\u043d\u044b\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u0432 (Fedora, Debian, Ubuntu, Arch \u0438 \u0434\u0440.). \u041e\u043d \u0431\u044b\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u043a\u0430\u043a \u043a\u0430\u0440\u0434\u0438\u043d\u0430\u043b\u044c\u043d\u043e \u043d\u043e\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u043d\u0438\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439.<\/p>\n<h3>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b systemd<\/h3>\n<h4>1. \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b<\/h4>\n<p>Systemd &#8212; \u043d\u0435 \u0435\u0434\u0438\u043d\u0430\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u0430 \u043d\u0430\u0431\u043e\u0440 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0449\u0438\u0445 &#171;\u043a\u0430\u0440\u043a\u0430\u0441&#187; \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0415\u0433\u043e \u044f\u0434\u0440\u043e &#8212; \u0434\u0435\u043c\u043e\u043d\u00a0<code>systemd<\/code>\u00a0(PID 1), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u044f\u043c\u044b\u043c \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u043c \u044f\u0434\u0440\u0430 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0441\u0435\u043c\u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438.<\/p>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b:<\/p>\n<ul>\n<li>\n<p><code>systemd<\/code>\u00a0(PID 1):\u00a0\u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0434\u0435\u043c\u043e\u043d. \u041e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0437\u0430\u043f\u0443\u0441\u043a \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u044e\u043d\u0438\u0442\u043e\u0432, \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 (\u0447\u0435\u0440\u0435\u0437 cgroups), \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u043e\u0442 \u044f\u0434\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p><code>systemctl<\/code>:\u00a0\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 CLI-\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0434\u0435\u043c\u043e\u043d\u043e\u043c. \u041d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 D-Bus-\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0434\u0435\u043c\u043e\u043d\u0443\u00a0<code>systemd<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0448\u0435\u043d\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p><code>journald<\/code>:\u00a0\u0434\u0435\u043c\u043e\u043d \u0436\u0443\u0440\u043d\u0430\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0418\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0441 \u0434\u0435\u043c\u043e\u043d\u043e\u043c\u00a0<code>systemd<\/code>, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c stdout\/stderr \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0438 &#171;\u043e\u0431\u043e\u0433\u0430\u0449\u0430\u0442\u044c&#187; \u0437\u0430\u043f\u0438\u0441\u0438 \u043b\u043e\u0433\u0430 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<code><em>SYSTEMD<\/em>UNIT=ssh.service<\/code>).<\/p>\n<\/li>\n<li>\n<p><code>udev<\/code>\u00a0\u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432. \u0423\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0443\u0437\u043b\u0430\u043c\u0438 \u0432\u00a0<code>\/dev<\/code>, \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 firmware \u0438 \u043c\u043e\u0434\u0443\u043b\u0438 \u044f\u0434\u0440\u0430. \u0422\u0435\u0441\u043d\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0441 systemd \u0434\u043b\u044f \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432.<\/p>\n<\/li>\n<li>\n<p><code>networkd<\/code>,\u00a0<code>timedated<\/code>,\u00a0<code>logind<\/code>:\u00a0\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u0435\u043c\u043e\u043d\u044b \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u044c\u044e, \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0438 \u0441\u0435\u0430\u043d\u0441\u0430\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 (\u043b\u043e\u0433\u0438\u043d\u043e\u043c).<\/p>\n<\/li>\n<\/ul>\n<h4>2. \u042e\u043d\u0438\u0442\u044b <\/h4>\n<p>\u042e\u043d\u0438\u0442\u044b &#8212; \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u0418\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 (\u043e\u0431\u044b\u0447\u043d\u043e \u0432\u00a0<code>\/usr\/lib\/systemd\/system\/<\/code>, \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u00a0<code>\/etc\/systemd\/system\/<\/code>).<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u044e\u043d\u0438\u0442\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>Service (<code>.service<\/code>): c\u0430\u043c\u044b\u0439 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0439 \u0442\u0438\u043f. \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 (\u0434\u0435\u043c\u043e\u043d) \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043c (<code>ExecStart=<\/code>,\u00a0<code>ExecStop=<\/code>).<\/p>\n<\/li>\n<li>\n<p>Socket (<code>.socket<\/code>): \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u043a\u0435\u0442 (\u0441\u0435\u0442\u0435\u0432\u043e\u0439, IPC \u0438\u043b\u0438 FIFO).\u00a0\u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c &#171;socket-based activation&#187;\u00a0&#8212; \u043a\u043b\u044e\u0447\u0435\u0432\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c: \u0434\u0435\u043c\u043e\u043d\u00a0<code>systemd<\/code>\u00a0\u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u043a\u0435\u0442 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 (<code>.service<\/code>) \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0434\u043b\u044f \u0440\u0435\u0434\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0441\u043b\u0443\u0436\u0431.<\/p>\n<\/li>\n<li>\n<p>Timer (<code>.timer<\/code>): \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 cron. \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 (<code>OnCalendar=*-*-* 00:00:00<\/code>) \u0438\u043b\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 (<code>OnBootSec=<\/code>,\u00a0<code>OnUnitActiveSec=<\/code>). \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e &#8212; \u043f\u043e\u043b\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0438 \u0436\u0443\u0440\u043d\u0430\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043a\u0430\u043a \u0443 \u043b\u044e\u0431\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u044e\u043d\u0438\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p>Mount (<code>.mount<\/code>) \u0438 Automount (<code>.automount<\/code>): \u0442\u043e\u0447\u043a\u0438 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.\u00a0<code>Automount<\/code>\u00a0\u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0443.<\/p>\n<\/li>\n<li>\n<p>Path (<code>.path<\/code>): \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435). \u0410\u043d\u0430\u043b\u043e\u0433\u00a0<code>incron<\/code>.<\/p>\n<\/li>\n<li>\n<p>Target (<code>.target<\/code>): \u0430\u043d\u0430\u043b\u043e\u0433 runlevel \u0438\u0437 SysVinit, \u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u0438\u0439. \u042d\u0442\u043e \u0433\u0440\u0443\u043f\u043f\u0430 \u044e\u043d\u0438\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0438\u0447\u044c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<a href=\"http:\/\/multi-user.target\" rel=\"noopener noreferrer nofollow\"><code>multi-user.target<\/code><\/a>\u00a0\u2014 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0440\u0435\u0436\u0438\u043c \u0431\u0435\u0437 GUI).<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0444\u0430\u0439\u043b\u0430 \u044e\u043d\u0438\u0442\u0430:<br \/> \u041a\u0430\u0436\u0434\u044b\u0439 \u0444\u0430\u0439\u043b \u0440\u0430\u0437\u0431\u0438\u0442 \u043d\u0430 \u0441\u0435\u043a\u0446\u0438\u0438.\u00a0<code>[Unit]<\/code>\u00a0\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0431\u0449\u0438\u0435 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 (\u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438), \u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0441\u0435\u043a\u0446\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<code>[Service]<\/code>\u00a0\u0438\u043b\u0438\u00a0<code>[Timer]<\/code>) \u2014 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430.<\/p>\n<pre><code># \u041f\u0440\u0438\u043c\u0435\u0440: \/etc\/systemd\/system\/app.service [Unit] Description=My Custom Application After=network.target # \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0441\u0435\u0442\u0438 Requires=postgresql.service # \u0416\u0451\u0441\u0442\u043a\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c Wants=redis.service # \u041c\u044f\u0433\u043a\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c  [Service] Type=simple ExecStart=\/usr\/bin\/myapp --serve Restart=on-failure # \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u0430\u0434\u0435\u043d\u0438\u0438 RestartSec=5 User=myappuser Group=myappgroup  [Install] WantedBy=multi-user.target  # |- \u0412 \u043a\u0430\u043a\u043e\u0439 \"\u0443\u0440\u043e\u0432\u0435\u043d\u044c\" \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u044e\u043d\u0438\u0442 \u043f\u0440\u0438 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 `systemctl enable`<\/code><\/pre>\n<details class=\"spoiler\">\n<summary>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e Type<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0432\u0430\u0436\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0445, \u043a\u0430\u043a systemd \u0431\u0443\u0434\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u041d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u0442\u0438\u043f\u0430 &#8212; \u0447\u0430\u0441\u0442\u0430\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<ul>\n<li>\n<p><code>Type=simple<\/code> &#8212; \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435: \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432 <code>ExecStart<\/code>, \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0433\u043b\u0430\u0432\u043d\u044b\u043c. Systemd \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u043c (<code>active<\/code>) \u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u043c \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u043e\u0440\u043e\u0434\u0438\u043b (fork) \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u041e\u043d \u043d\u0435 \u0436\u0434\u0451\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0439 \u043e\u0442 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c: \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0434\u0435\u043c\u043e\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0441\u0430\u043c\u0438 \u0432 \u0444\u043e\u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u041b\u0443\u0447\u0448\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u0438\u043f, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 &#171;\u0434\u0435\u043c\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f&#187; \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e &#8212; systemd \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0442\u0435\u0440\u044f\u0435\u0442 \u0435\u0433\u043e \u0438\u0437 \u0432\u0438\u0434\u0443.<\/p>\n<ul>\n<li>\n<p><code>Type=forking<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435:\u00a0\u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c &#171;\u0434\u0435\u043c\u043e\u043d\u0430&#187;. \u041f\u0440\u043e\u0446\u0435\u0441\u0441, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432\u00a0<code>ExecStart<\/code>, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f, \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u043e\u0442\u043e\u043c\u043a\u0430 (fork) \u0438 \u0441\u0440\u0430\u0437\u0443 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f. Systemd \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0438 \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.<\/p>\n<p>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440: \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u044c <code>PIDFile=...<\/code> (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, <code>PIDFile=\/run\/<\/code><a href=\"http:\/\/nginx.pid\" rel=\"noopener noreferrer nofollow\"><code>nginx.pid<\/code><\/a>). \u042d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0447\u0442\u043e\u0431\u044b systemd \u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u043b, \u043a\u0430\u043a\u043e\u0439 PID (\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430) \u0443 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043c\u043e\u0433 \u0435\u0433\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438\u043b\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c: \u0434\u043b\u044f \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0434\u0435\u043c\u043e\u043d\u043e\u0432, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0434 SysV init (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, nginx, Apache, MySQL \u0438 \u043f\u0440\u043e\u0447\u0438\u0435), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u043e\u0442 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430.<\/p>\n<ul>\n<li>\n<p><code>Type=oneshot<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435: \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044c\u0441\u044f. Systemd \u0431\u0443\u0434\u0435\u0442 \u0442\u0435\u0440\u043f\u0435\u043b\u0438\u0432\u043e \u043e\u0436\u0438\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 <code>ExecStart<\/code>, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u0442 \u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u044e\u043d\u0438\u0442\u043e\u0432, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0445 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/p>\n<p>\u041a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f: \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441 <code>RemainAfterExit=yes<\/code>. \u042d\u0442\u0430 \u043e\u043f\u0446\u0438\u044f \u0433\u043e\u0432\u043e\u0440\u0438\u0442 systemd \u0441\u0447\u0438\u0442\u0430\u0442\u044c \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 \u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u042d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043c\u043e\u043d\u0442\u0438\u0440\u0443\u044e\u0442 \u0434\u0438\u0441\u043a\u0438 \u0438\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0442 \u0441\u0435\u0442\u044c), \u043d\u043e \u0441\u0430\u043c\u0438 \u043f\u043e \u0441\u0435\u0431\u0435 \u043d\u0435 \u0438\u043c\u0435\u044e\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c: \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0440\u0430\u0437\u043e\u0432\u044b\u0445 \u0437\u0430\u0434\u0430\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/p>\n<ul>\n<li>\n<p><code>Type=notify<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435: \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c systemd \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 (\u0441\u0438\u0433\u043d\u0430\u043b <code>sd_notify<\/code>), \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u0438 \u0433\u043e\u0442\u043e\u0432 \u043a \u0440\u0430\u0431\u043e\u0442\u0435. Systemd \u0431\u0443\u0434\u0435\u0442 \u0436\u0434\u0430\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0435 \u043e\u0442 \u043d\u0435\u0433\u043e \u044e\u043d\u0438\u0442\u044b.<\/p>\n<p>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f: \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 API systemd \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 (\u0447\u0435\u0440\u0435\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <code>libsystemd<\/code> \u0438\u043b\u0438 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0439 \u0441\u043e\u043a\u0435\u0442).<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c: \u0434\u043b\u044f \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0434\u0435\u043c\u043e\u043d\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u0434 systemd (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, systemd itself, sshd). \u042d\u0442\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u0447\u043d\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<ul>\n<li>\n<p><code>Type=dbus<\/code> &#8212; \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u0440\u0430\u0441\u043f\u043e\u0440\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0439<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435: \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0433\u043e\u0442\u043e\u0432\u044b\u043c, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 \u0448\u0438\u043d\u0435 D-Bus.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c: \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0447\u0435\u0440\u0435\u0437 D-Bus.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f forking-\u0434\u043e\u043c\u0435\u043d\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430):<\/p>\n<pre><code>[Unit] Description=My Forking Web Service  [Service] Type=forking PIDFile=\/run\/my-webservice.pid ExecStart=\/usr\/bin\/my-webservice --daemon --pid-file=\/run\/my-webservice.pid ExecReload=\/bin\/kill -HUP $MAINPID  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<\/div>\n<\/details>\n<h4>3. \u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430<\/h4>\n<p>Systemd \u0441\u0442\u0440\u043e\u0438\u0442 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u044e\u043d\u0438\u0442\u0430\u043c\u0438. \u0410\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b\u00a0<code>After<\/code>,\u00a0<code>Before<\/code>,\u00a0<code>Requires<\/code>,\u00a0<code>Wants<\/code>, \u043e\u043d \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u044e\u043d\u0438\u0442\u043e\u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e. \u041d\u0435 \u0441\u043b\u0435\u043f\u043e\u0439 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c, \u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0435 \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044f\u0432\u043d\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0430\u0432\u0438\u043b.<\/p>\n<h4>4. Cgroups \u0438 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432<\/h4>\n<p>\u042d\u0442\u043e \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 SysVinit. Systemd \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0432 \u0441\u0432\u043e\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e\u00a0cgroup\u00a0(control group). \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442:<\/p>\n<ul>\n<li>\n<p>\u0422\u043e\u0447\u043d\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0441\u043b\u0443\u0436\u0431\u044b:\u00a0\u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 (<code>ExecStart<\/code>) \u043f\u043e\u0440\u043e\u0434\u0438\u043b \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 (fork), \u043e\u043d\u0438 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043d\u0443\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 cgroup. \u041a\u043e\u043c\u0430\u043d\u0434\u0430\u00a0<code>systemctl status<\/code>\u00a0\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0449\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0443.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b:\u00a0\u0447\u0435\u0440\u0435\u0437 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u044e\u043d\u0438\u0442\u0430 (<code>MemoryMax=<\/code>,\u00a0<code>CPUQuota=<\/code>) \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043b\u0438\u043c\u0438\u0442\u044b \u043d\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438, CPU, I\/O \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0413\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0441\u043b\u0443\u0436\u0431\u044b:\u00a0\u043f\u0440\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 systemd \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0432 \u0435\u0433\u043e cgroup, \u0443\u0441\u0442\u0440\u0430\u043d\u044f\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 &#171;\u0437\u043e\u043c\u0431\u0438&#187;-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0435\u043e\u0440\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0432\u0443\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 (<code>systemd-cgls<\/code> \u0438 <code>systemd-cgtop<\/code>), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 systemd \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0445 \u0433\u0440\u0443\u043f\u043f.<\/p>\n<p><strong> \u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435<\/strong>: \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b\u00a0<code>systemd-cgls<\/code>\u00a0\u0438\u00a0<code>systemd-cgtop<\/code>.<\/p>\n<ul>\n<li>\n<p><code>Systemd-cgls<\/code> &#8212; \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u0432\u0441\u0435\u0445 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 cgroup \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0442\u043e\u043c\u0443, \u043a\u0430\u043a\u00a0<code>ls<\/code>\u00a0\u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b\u044b. \u042d\u0442\u043e \u043b\u0443\u0447\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431\u00a0\u043f\u043e\u043d\u044f\u0442\u044c \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c\u00a0\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u0451\u0442 systemd. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435:<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"bash\"># \u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0451 \u0434\u0440\u0435\u0432\u043e cgroup \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 nginx  systemd-cgls \/system.slice\/nginx.service  # \u0411\u0443\u0434\u0443\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u0432\u0441\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 cgroup: # |-1234 \/usr\/sbin\/nginx -g daemon off: # |-1235 nginx: worker process # |-1236 nginx: cache loader process<\/code><\/pre>\n<ul>\n<li>\n<p><code>systemd-cgtop<\/code> &#8212; \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 (CPU, \u043f\u0430\u043c\u044f\u0442\u044c, \u0432\u0432\u043e\u0434\/\u0432\u044b\u0432\u043e\u0434) \u0432\u0441\u0435\u043c\u0438 cgroup \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0442\u043e\u043c\u0443, \u043a\u0430\u043a <code>top<\/code> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u044d\u0442\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430:<\/p>\n<\/li>\n<\/ul>\n<pre><code>Control Group               Tasks   %CPU   Memory  Input\/s Output\/s \/                            257    15.8     3.9G       0B     0B<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-473151","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/473151","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=473151"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/473151\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=473151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=473151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=473151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}