{"id":5304,"date":"2022-10-05T20:42:13","date_gmt":"2022-10-05T20:42:13","guid":{"rendered":"https:\/\/tst-amo.net.ua\/blog\/?p=5304"},"modified":"2022-10-05T21:01:11","modified_gmt":"2022-10-05T21:01:11","slug":"systemctl-%d0%be%d1%81%d0%bd%d0%be%d0%b2%d0%bd%d1%8b%d0%b5-%d0%ba%d0%be%d0%bc%d0%b0%d0%bd%d0%b4%d1%8b","status":"publish","type":"post","link":"https:\/\/tst-amo.net.ua\/blog\/?p=5304","title":{"rendered":"systemctl \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b"},"content":{"rendered":"<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443, \u0443\u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c, \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e, \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441<\/p>\n<pre># systemctl status sshd\r\n# systemctl start sshd\r\n# systemctl enabled sshd\r\n# systemctl disabled sshd\r\n# systemctl stop sshd\r\n# systemctl reload sshd\r\n# systemctl restart sshd<\/pre>\n<p>\u041e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0432\u0441\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u044e\u043d\u0438\u0442\u044b:<\/p>\n<pre># systemctl list-units<\/pre>\n<ul>\n<li><strong>UNIT<\/strong>: The\u00a0<code>systemd<\/code>\u00a0unit name<\/li>\n<li><strong>LOAD<\/strong>: Whether the unit\u2019s configuration has been parsed by\u00a0<code>systemd<\/code>. The configuration of loaded units is kept in memory.<\/li>\n<li><strong>ACTIVE<\/strong>: A summary state about whether the unit is active. This is usually a fairly basic way to tell if the unit has started successfully or not.<\/li>\n<li><strong>SUB<\/strong>: This is a lower-level state that indicates more detailed information about the unit. This often varies by unit type, state, and the actual method in which the unit runs.<\/li>\n<li><strong>DESCRIPTION<\/strong>: A short textual description of what the unit is\/does.<\/li>\n<\/ul>\n<p>\u041e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b:<\/p>\n<pre># systemctl list-unit-files --state=enabled\r\nUNIT FILE            STATE\r\narpwatch.service     enabled\r\natop.service         enabled\r\nauditd.service       enabled\r\nautovt@.service      enabled\r\nchronyd.service      enabled\r\n...<\/pre>\n<p>&#8211;state={enabled,disabled,static}<\/p>\n<pre># systemctl list-units --all --state<span class=\"token operator\">=<\/span>inactive<\/pre>\n<p>&#8211;state={inactive,active}<\/p>\n<p>\u041e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e \u0442\u0438\u043f\u0443<\/p>\n<pre># systemctl list-units --type<span class=\"token operator\">=<\/span>service<\/pre>\n<p>&#8211;type={service,}<\/p>\n<pre># systemctl list-unit-files<\/pre>\n<p>\u041e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c Unit \u0444\u0430\u0439\u043b:<\/p>\n<pre># systemctl cat sshd.service\r\n# \/usr\/lib\/systemd\/system\/sshd.service\r\n[Unit]\r\nDescription=OpenSSH server daemon\r\nDocumentation=man:sshd(8) man:sshd_config(5)\r\nAfter=network.target sshd-keygen.service\r\nWants=sshd-keygen.service\r\n\r\n[Service]\r\nType=notify\r\nEnvironmentFile=\/etc\/sysconfig\/sshd\r\nExecStart=\/usr\/sbin\/sshd -D $OPTIONS\r\nExecReload=\/bin\/kill -HUP $MAINPID\r\nKillMode=process\r\nRestart=on-failure\r\nRestartSec=42s\r\n\r\n[Install]\r\nWantedBy=multi-user.target<\/pre>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441 \u0447\u0435\u043c \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0443\u0435\u0442:<\/p>\n<pre># systemctl show sshd -p Conflicts\r\nConflicts=shutdown.target<\/pre>\n<p>&nbsp;<\/p>\n<div class=\"pdfprnt-buttons pdfprnt-buttons-post pdfprnt-bottom-right\"><a href=\"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=wpv2posts5304&print=pdf\" class=\"pdfprnt-button pdfprnt-button-pdf\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/tst-amo.net.ua\/blog\/wp-content\/plugins\/pdf-print\/images\/pdf.png\" alt=\"image_pdf\" title=\"View PDF\" \/><\/a><a href=\"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=wpv2posts5304&print=print\" class=\"pdfprnt-button pdfprnt-button-print\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/tst-amo.net.ua\/blog\/wp-content\/plugins\/pdf-print\/images\/print.png\" alt=\"image_print\" title=\"Print Content\" \/><\/a><\/div>","protected":false},"excerpt":{"rendered":"<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443, \u0443\u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c, \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e, \u0440\u0435\u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 # systemctl status sshd # systemctl start sshd # systemctl enabled sshd # systemctl disabled sshd # systemctl stop sshd # systemctl reload sshd # systemctl restart sshd \u041e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0432\u0441\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u044e\u043d\u0438\u0442\u044b: # systemctl list-units UNIT: The\u00a0systemd\u00a0unit name LOAD: Whether the &#8230;<\/p>\n<p><a href=\"https:\/\/tst-amo.net.ua\/blog\/?p=5304\" class=\"more-link\">Continue reading &lsquo;systemctl \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b&rsquo; &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48,47,363],"tags":[],"class_list":["post-5304","post","type-post","status-publish","format-standard","hentry","category-centos","category-linux","category-systemctl"],"_links":{"self":[{"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5304"}],"collection":[{"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5304"}],"version-history":[{"count":4,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5304\/revisions"}],"predecessor-version":[{"id":5309,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5304\/revisions\/5309"}],"wp:attachment":[{"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tst-amo.net.ua\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}