{"id":316349,"date":"2021-01-14T09:00:59","date_gmt":"2021-01-14T09:00:59","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=316349"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=316349","title":{"rendered":"Systemd \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e\u0449\u0438\u0445. Part 2 \u2014 \u0422\u0440\u0438\u0433\u0433\u0435\u0440\u044b \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e41\/7a5\/e73\/e417a5e736482e855846d3d9fbbbfbad.jpg\" width=\"1007\" height=\"675\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0446\u0438\u043a\u043b \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0431\u0430\u043b\u0435\u0442\u0430, \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u00abSystemd \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e\u0449\u0438\u0445\u00bb. \u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u044f\u0432\u043b\u044f\u044e\u0449\u0435\u0439\u0441\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439, \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0430\u0445 \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c.  \u042d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0442\u0430\u043a\u043e\u0439 \u043e\u0431\u044a\u0451\u043c\u043d\u043e\u0439, \u043d\u043e, \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439. \u0412\u043f\u0435\u0440\u0451\u0434!<\/p>\n<h2>Systemd.path \u2014 \u0442\u0440\u0438\u0433\u0433\u0435\u0440 \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435<\/h2>\n<p>\u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, linux \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432, \u0441\u0440\u0435\u0434\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 <code>inotify()<\/code> , \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0432\u0435\u0448\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u2014 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435, \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 etc, \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432.  \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u043c\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u043c\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u043c\u0438 <code>inotify()<\/code> \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u044b <code>inotifywait<\/code> \u0438 <code>inotifywatch<\/code> \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 <code>inotify-tools<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445, \u0430 \u0442\u0430\u043a-\u0436\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 <code>incron<\/code> \u2014 cron \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, <a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/528422\/\" rel=\"noopener noreferrer nofollow\">\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c<\/a> \u0443\u0436\u0435 <a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/529828\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0438\u0441\u0430\u043b\u0438<\/a> \u043d\u0430 \u0425\u0430\u0431\u0440\u0435. Systemd \u0442\u043e\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u044e\u043d\u0438\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0442\u044c \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b \u043f\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0443 (\u044f \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043f\u043e\u043a\u0430), \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 <code>incron<\/code> \u0438 \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0441 <code>inotify-tools<\/code> , \u043d\u043e \u0437\u0430\u0442\u043e \u0443\u043c\u0435\u044e\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u044e\u043d\u0438\u0442\u044b systemd.<\/p>\n<h3>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 systemd.path<\/h3>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0442\u0440\u0438\u0433\u0433\u0435\u0440 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0432\u0430\u044f\u0442\u044c \u043e\u0434\u043d\u043e\u043c\u0443 \u0442\u043e\u0432\u0430\u0440\u0438\u0449\u0443, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u0437\u0430\u0445\u043e\u0442\u0435\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0443, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439, \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0435 (\u043f\u0440\u0435\u0434\u0432\u0438\u0434\u044f \u0432\u043e\u043f\u0440\u043e\u0441&#8230; \u041d\u0435\u0442, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u044f\u0434\u0440\u0430 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0444\u0438\u0433\u0443\u0432\u0438\u043d\u044b \u043d\u0435\u0442):<\/p>\n<pre><code>$ cat \/etc\/systemd\/system\/enable-radeon.path [Unit] Description=Enable radeon path  [Path] PathExists=\/sys\/kernel\/debug\/vgaswitcheroo\/switch  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p>\u0412\u0441\u0451 \u0442\u043e-\u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043a\u0430\u043a \u0438 <a href=\"https:\/\/habr.com\/ru\/post\/535930\/\" rel=\"noopener noreferrer nofollow\">\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0442\u0430\u0439\u043c\u0435\u0440\u0430\u043c\u0438<\/a>. \u0415\u0441\u043b\u0438 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u0438, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>[Path]<\/code>, \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 <code>Unit=<\/code>, \u0438\u0449\u0435\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043e\u0434\u043d\u043e\u0438\u043c\u0451\u043d\u043d\u044b\u0439 <code>*.service<\/code>:<\/p>\n<pre><code>$ cat \/etc\/systemd\/system\/enable-radeon.service [Unit] Description=Enable radeon service  [Service] Type=oneshot RemainAfterExit=yes ExecStart=\/usr\/bin\/sh -c \"echo DDIS &gt; \/sys\/kernel\/debug\/vgaswitcheroo\/switch\"  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p>\u0418\u0442\u0430\u043a \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e. \u042d\u043d\u0435\u0439\u0431\u043b\u0438\u043c <code>*.path<\/code> \u2014 <code>sudo systemctl enable enable-radeon.path<\/code> \u0438, \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0434\u0435\u0440\u0435\u0432\u0435 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0430\u0439\u043b (<code>PathExists=<\/code>) <code>\/sys\/kernel\/debug\/vgaswitcheroo\/switch<\/code>, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u0435\u0440\u0432\u0438\u0441.<\/p>\n<h3>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u0441\u043b\u0435\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f systemd.path<\/h3>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u0438\u0445 \u043c\u0430\u043b\u043e, \u043d\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u0430 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u044e\u043d\u0438\u0442\u043e\u0432 \u043e\u043d\u0438, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442:<\/p>\n<ul>\n<li>\n<p><code>PathExists=<\/code> \u0422\u0440\u0438\u0433\u0433\u0435\u0440\u0438\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0438\u043b\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.<\/p>\n<\/li>\n<li>\n<p><code>PathExistsGlob=<\/code> \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0447\u0442\u043e \u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \/ \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438 \u043f\u043e \u043c\u0430\u0441\u043a\u0435.<\/p>\n<\/li>\n<li>\n<p><code>PathChanged=<\/code> \u0415\u0441\u043b\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 \u0438\u043b\u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u043d \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 <code>write()<\/code>, \u0430 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e <code>close()<\/code><\/p>\n<\/li>\n<li>\n<p> <code>PathModified=<\/code> \u041f\u043e\u0434\u043e\u0431\u043d\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443, \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u0436\u0434\u0451\u043c close(), \u0430 \u0441\u0440\u0430\u0437\u0443 \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u043c \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u043f\u0430\u0432\u0448\u0438\u0439\u0441\u044f write().<\/p>\n<\/li>\n<li>\n<p><code>DirectoryNotEmpty=<\/code> \u041a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u2014 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439, \u043a\u043e\u0433\u0434\u0430 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0445\u043e\u0442\u044f-\u0431\u044b \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u0435 \u044d\u0442\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u0432 \u043e\u0434\u043d\u043e\u043c \u044e\u043d\u0438\u0442\u0435, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u044e\u043d\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u043c\u0438. <strong>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435!<\/strong> \u0415\u0441\u043b\u0438 \u0432 \u043a\u0430\u043a\u043e\u043c-\u043b\u0438\u0431\u043e \u0438\u0437 \u044d\u0442\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u043f\u0443\u0441\u0442\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u0431\u0440\u043e\u0441\u044f\u0442\u0441\u044f \u0438 \u0432\u0430\u0448 <code>*.path<\/code> \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. <\/p>\n<h3>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/h3>\n<ul>\n<li>\n<p><code>Unit=<\/code> \u042e\u043d\u0438\u0442 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430. \u0412\u0430\u0436\u043d\u043e\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0437\u0430\u0431\u044b\u043b \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u0412 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 <code>Unit=<\/code> \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c <code>*.service<\/code>, \u043d\u043e \u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 (\u043a\u0440\u043e\u043c\u0435 <code>*.path<\/code>)  \u044e\u043d\u0438\u0442. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>*.mount<\/code>.<\/p>\n<\/li>\n<li>\n<p><code>MakeDirectory=<\/code> \u0411\u0443\u043b\u0435\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440. \u0421\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c-\u043b\u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438 \u0441\u043b\u0435\u0436\u0435\u043d\u0438\u044f. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u2014 <code>false<\/code>.<\/p>\n<\/li>\n<li>\n<p><code>DirectoryMode=<\/code> \u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0440\u0430\u0437\u0434\u0430\u0447\u0438 \u043f\u0440\u0430\u0432 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <code>0755<\/code>.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 systemd.path c incron \u0438 inotify-tools<\/h3>\n<p>\u0412 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043e \u043f\u0430\u0440\u043e\u0447\u043a\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0445 \u0434\u043b\u044f <code>incron<\/code> \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p><strong>\u0424\u0443\u043d\u043a\u0446\u0438\u044f<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\"><strong>systemd.path<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><strong>inotify-tools<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><strong>incron<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>read<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>access<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_ACCESS<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>write<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\"><code>PathModified=<\/code><\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>modify<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_MODIFY<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>attrib<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>attrib<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_ATTRIB<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>close &amp; write<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\"><code>PathChanged=<\/code><\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>close_write<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_CLOSE_WRITE<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>close<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>close_nowrite<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_CLOSE_NOWRITE<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>open<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>open<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_OPEN<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>moved to watched<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>moved_to<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_MOVED_TO<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>moved from watched<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>moved_from<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_MOVED_FROM<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>moved self<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>moved_self<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_MOVE_SELF<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>create<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\"><code>PathExist= PathExistGlob= DirectoryNotEmpty=<\/code><\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>create<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_CREATE<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>delete<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>delete<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_DELETE<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>delete self<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>delete_self<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_DELETE_SELF<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>unmount<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>unmount<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>systemd support<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\"><strong>yes<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0418 \u0434\u0430, \u0447\u0443\u0442\u044c \u043d\u0435 \u0437\u0430\u0431\u044b\u043b. \u0412\u0441\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 <code>inotify()<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 <strong>\u0442\u043e\u043b\u044c\u043a\u043e<\/strong> \u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e <strong>\u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445<\/strong>. \u0422\u043e-\u0435\u0441\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 SMB \/ NFS \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443\u0442, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 <code>\/run<\/code>, <code>\/sys<\/code>, <code>\/proc<\/code>!<\/p>\n<h2>Systemd.automount \u2014 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u044b \u0430\u0432\u0442\u043e\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0424\u0421<\/h2>\n<p>\u041e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u044e\u043d\u0438\u0442\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u043a\u0430\u043a \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0442\u0430\u043a \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0438\u0442\u044c \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 (\u043d\u0435 \u0432\u0441\u0435, \u0441 \u043a\u043e\u0440\u043d\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u0442\u0440\u044e\u043a \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0451\u0442) \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043e\u0442 \u043f\u043e\u0432\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u043f\u0438\u0442\u0430\u043d\u0438\u044f.<\/p>\n<h3>\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430<\/h3>\n<p>\u0421\u0440\u0430\u0437\u0443 \u0434\u0432\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430. \u0414\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0439 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0414\u0432\u0430 <code>*.automount<\/code> \u0438 \u0434\u0432\u0430 <code>*.mount<\/code> \u044e\u043d\u0438\u0442\u0430 \u043a \u043d\u0438\u043c \u0432 \u043f\u0430\u0440\u0443. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 <code>*.timer<\/code> \u0438 <code>*.path<\/code> \u044e\u043d\u0438\u0442\u043e\u0432 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0443\u043d\u0442\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 <code>Unit=<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043b\u0438 \u043e\u0434\u043d\u043e\u0438\u043c\u0451\u043d\u043d\u044b\u0439 \u00abpersistent\u00bb <code>*.mount<\/code>, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0435, \u043b\u0438\u0431\u043e <code>*.mount<\/code> \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0438\u0437 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e <code>\/etc\/fstab<\/code>.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440: \u041b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u0441\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432 <code>\/boot<\/code>. \u041f\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0441\u0447\u0451\u0442\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 <code>\/boot<\/code> \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u2014 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u044f\u0434\u0440\u0430 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 <code>initrd<\/code> \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430, \u0447\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442, \u043d\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0442\u043e-\u0431\u044b \u0447\u0430\u0441\u0442\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043c\u044b \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0441\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b <code>\/boot<\/code> \u0432 \u0430\u0432\u0442\u043e\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<pre><code>$ cat \/etc\/systemd\/system\/boot.automount [Unit] Description=Automount boot partition when needed.  [Automount] Where=\/boot ## Time to automatic umount of inactivity TimeoutIdleSec=120  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p>\u0418 \u0432 \u043f\u0430\u0440\u0443 \u043a \u043d\u0435\u043c\u0443 \u043e\u0434\u043d\u043e\u0438\u043c\u0451\u043d\u043d\u044b\u0439 <code>*.mount<\/code> \u0444\u0430\u0439\u043b:<\/p>\n<pre><code>$ cat \/etc\/systemd\/system\/boot.mount [Unit] Description=Boot partition (running by automount) \/dev\/sda1 Documentation=man:systemd.mount(5) After=blockdev@dev-disk-by\\x2duuid-ea65285a\\x2d01da\\x2d451c\\x2da93a\\x2d4b155c46aeeb.target  [Mount] Where=\/boot What=\/dev\/disk\/by-uuid\/ea65285a-01da-451c-a93a-4b155c46aeeb Type=ext4 Options=rw,relatime DirectoryMode=0755<\/code><\/pre>\n<p>\u0412\u0441\u0451 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u0430\u043a \u0432 <code>fstab<\/code>, \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0441\u043a\u0438\u0434\u0430\u043d\u043e \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u0441\u0442\u0440\u043e\u0447\u043a\u0430\u043c. \u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0443\u043d\u0442\u0435: \u041a\u043e\u0433\u0434\u0430 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c\/\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <code>\/boot<\/code> \u0438\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u043b\u0438\u0441\u0442\u0438\u043d\u0433, \u0430\u0432\u0442\u043e\u043c\u0430\u0443\u043d\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043e\u0434\u043d\u043e\u0438\u043c\u0451\u043d\u043d\u044b\u0439 \u044e\u043d\u0438\u0442 <code>*.mount<\/code> \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a <code>\/boot<\/code>. \u0427\u0435\u0440\u0435\u0437 2 \u043c\u0438\u043d\u0443\u0442\u044b \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f (<code>TimeoutIdleSec=<\/code>), \u0440\u0430\u0437\u0434\u0435\u043b \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0442\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d.  <\/p>\n<p>\u0418 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0432\u0441\u0451 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0441\u043e\u0431\u0435\u0440\u0443\u0441\u044c \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043d\u0430 rclone \u2014 \u0430\u0432\u0442\u043e\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u043b\u0430\u043a\u0430 \u044f\u043d\u0434\u0435\u043a\u0441\u0430, \u043a\u043e\u0433\u0434\u0430 \u044f \u043a \u043d\u0435\u043c\u0443 \u043e\u0431\u0440\u0430\u0449\u0430\u044e\u0441\u044c.<\/p>\n<pre><code>$ cat \/etc\/systemd\/system\/home-oxyd-Clouds-yadisk.automount [Unit] Description=Automount yandex disc when needed.  [Automount] Where=\/home\/oxyd\/Clouds\/yadisk DirectoryMode=0777 ## Time to automatic umount of inactivity TimeoutIdleSec=300  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p>\u0418 \u00ab\u043e\u0442\u0432\u0435\u0442\u043e\u0447\u043a\u0430\u00bb \u043a \u043d\u0435\u043c\u0443:<\/p>\n<pre><code>$ cat \/etc\/systemd\/system\/home-oxyd-Clouds-yadisk.mount [Unit] Description=Yandex disk automounted drive Documentation=man:systemd.mount(8)   [Mount] Where=\/home\/oxyd\/Clouds\/yadisk What=https:\/\/webdav.yandex.ru\/ Type=davfs Options=noauto,user<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0442\u043e\u0436\u0435 \u0432\u0441\u0451 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0440\u0430\u0437\u0434\u0430\u0447\u0438 \u043f\u0440\u0430\u0432 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0432\u043e\u0439 \u043d\u0435 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0430 \u0437\u0430\u043a\u043e\u043d\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435. \u0414\u0430 \u0443 \u0430\u0432\u0442\u043e\u043c\u0430\u0443\u043d\u0442\u0430 \u0440\u043e\u0432\u043d\u043e \u0442\u0440\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430:<\/p>\n<ul>\n<li>\n<p><code>Where=<\/code> \u041f\u0443\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043c.<\/p>\n<\/li>\n<li>\n<p><code>TimeoutIdleSec=<\/code> \u0422\u0430\u0439\u043c\u0430\u0443\u0442 \u043f\u0435\u0440\u0435\u0434 \u0430\u0432\u0442\u043e\u043e\u0442\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u0435\u0441\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442, \u0438\u043b\u0438 \u0440\u0430\u0432\u0435\u043d <code>0<\/code> (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e) \u0440\u0430\u0437\u0434\u0435\u043b \u043d\u0435 \u0430\u0432\u0442\u043e\u043e\u0442\u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p><code>DirectoryMode=<\/code> \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0434\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <code>0755<\/code>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u043e\u0442, \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u043a\u0430\u043a-\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a. \u0418, \u043a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430, \u043a\u0430\u043a\u0438\u0435 \u043c\u0430\u043d\u044b \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c:<\/p>\n<pre><code>man systemd.path man 7 inotify man inotifywait man inotifywatch man systemd.automount man systemd.mount man systemd-mount man 5 fstab man systemd.time<\/code><\/pre>\n<h2>\u0421\u043f\u0438\u0441\u043e\u043a \u0441\u0442\u0430\u0442\u0435\u0439 \u0441\u0435\u0440\u0438\u0438<\/h2>\n<ol>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/535872\/\" rel=\"noopener noreferrer nofollow\">\u041f\u043e\u0447\u0435\u043c\u0443 \u0445\u0430\u0431\u0440\u0430\u0436\u0438\u0442\u0435\u043b\u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u044b, \u0432\u043c\u0435\u0441\u0442\u043e \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439? \u0418\u043b\u0438 \u043e systemd, part 0<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/535930\/\" rel=\"noopener noreferrer nofollow\">Systemd \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e\u0449\u0438\u0445. Part 1 \u2014 \u0417\u0430\u043f\u0443\u0441\u043a \u044e\u043d\u0438\u0442\u043e\u0432 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/536040\/\" rel=\"noopener noreferrer nofollow\"><strong>Systemd \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e\u0449\u0438\u0445. Part 2 \u2014 \u0422\u0440\u0438\u0433\u0433\u0435\u0440\u044b \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f<\/strong><\/a><\/p>\n<\/li>\n<\/ol>\n<h2>\u0420\u0435\u0441\u0443\u0440\u0441\u044b<\/h2>\n<ul>\n<li>\n<p><a href=\"https:\/\/systemd.io\/\" rel=\"noopener noreferrer nofollow\">systemd.io&nbsp;<\/a>\u2014 \u0421\u0442\u0430\u0442\u044c\u0438 \u043f\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u043a\u0443\u0445\u043d\u0435 systemd. \u0427\u0430\u0441\u0442\u0435\u043d\u044c\u043a\u043e \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u0430\u043d\u0430\u0445.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.freedesktop.org\/wiki\/Software\/systemd\/\" rel=\"noopener noreferrer nofollow\">systemd @ freedesktop.org<\/a>&nbsp;\u2014 \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441 \u043c\u0430\u043d\u0430\u043c\u0438, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439, \u0432\u0438\u0434\u0435\u043e, \u0431\u043b\u043e\u0433\u0430\u043c\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u043c\u0438 \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438 \u043d\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u044b.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/t.me\/ru_systemd\" rel=\"noopener noreferrer nofollow\">@ru_systemd<\/a>&nbsp;\u2014 \u0420\u0443\u0441\u0441\u043a\u043e\u044f\u0437\u044b\u0447\u043d\u044b\u0439 \u0447\u0430\u0442 \u0432 Telegram. \u0423 \u043d\u0430\u0441 \u0442\u0435\u043f\u043b\u043e \u0438 \u043b\u0430\u043c\u043f\u043e\u0432\u043e.<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<p> \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\/post\/536040\/\"> https:\/\/habr.com\/ru\/post\/536040\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0446\u0438\u043a\u043b \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0431\u0430\u043b\u0435\u0442\u0430, \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u00abSystemd \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e\u0449\u0438\u0445\u00bb. \u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u044f\u0432\u043b\u044f\u044e\u0449\u0435\u0439\u0441\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439, \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0430\u0445 \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c.  \u042d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0442\u0430\u043a\u043e\u0439 \u043e\u0431\u044a\u0451\u043c\u043d\u043e\u0439, \u043d\u043e, \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439. \u0412\u043f\u0435\u0440\u0451\u0434!<\/p>\n<h2>Systemd.path \u2014 \u0442\u0440\u0438\u0433\u0433\u0435\u0440 \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435<\/h2>\n<p>\u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, linux \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432, \u0441\u0440\u0435\u0434\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 <code>inotify()<\/code> , \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0432\u0435\u0448\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u2014 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435, \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 etc, \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432.  \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u043c\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u043c\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u043c\u0438 <code>inotify()<\/code> \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u044b <code>inotifywait<\/code> \u0438 <code>inotifywatch<\/code> \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 <code>inotify-tools<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445, \u0430 \u0442\u0430\u043a-\u0436\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 <code>incron<\/code> \u2014 cron \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, <a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/528422\/\" rel=\"noopener noreferrer nofollow\">\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c<\/a> \u0443\u0436\u0435 <a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/529828\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0438\u0441\u0430\u043b\u0438<\/a> \u043d\u0430 \u0425\u0430\u0431\u0440\u0435. Systemd \u0442\u043e\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u044e\u043d\u0438\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0442\u044c \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b \u043f\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0443 (\u044f \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043f\u043e\u043a\u0430), \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 <code>incron<\/code> \u0438 \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0441 <code>inotify-tools<\/code> , \u043d\u043e \u0437\u0430\u0442\u043e \u0443\u043c\u0435\u044e\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u044e\u043d\u0438\u0442\u044b systemd.<\/p>\n<h3>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 systemd.path<\/h3>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0442\u0440\u0438\u0433\u0433\u0435\u0440 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0432\u0430\u044f\u0442\u044c \u043e\u0434\u043d\u043e\u043c\u0443 \u0442\u043e\u0432\u0430\u0440\u0438\u0449\u0443, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u0437\u0430\u0445\u043e\u0442\u0435\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0443, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439, \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0435 (\u043f\u0440\u0435\u0434\u0432\u0438\u0434\u044f \u0432\u043e\u043f\u0440\u043e\u0441&#8230; \u041d\u0435\u0442, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u044f\u0434\u0440\u0430 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0444\u0438\u0433\u0443\u0432\u0438\u043d\u044b \u043d\u0435\u0442):<\/p>\n<pre><code>$ cat \/etc\/systemd\/system\/enable-radeon.path [Unit] Description=Enable radeon path  [Path] PathExists=\/sys\/kernel\/debug\/vgaswitcheroo\/switch  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p>\u0412\u0441\u0451 \u0442\u043e-\u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043a\u0430\u043a \u0438 <a href=\"https:\/\/habr.com\/ru\/post\/535930\/\" rel=\"noopener noreferrer nofollow\">\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0442\u0430\u0439\u043c\u0435\u0440\u0430\u043c\u0438<\/a>. \u0415\u0441\u043b\u0438 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u0438, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>[Path]<\/code>, \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 <code>Unit=<\/code>, \u0438\u0449\u0435\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043e\u0434\u043d\u043e\u0438\u043c\u0451\u043d\u043d\u044b\u0439 <code>*.service<\/code>:<\/p>\n<pre><code>$ cat \/etc\/systemd\/system\/enable-radeon.service [Unit] Description=Enable radeon service  [Service] Type=oneshot RemainAfterExit=yes ExecStart=\/usr\/bin\/sh -c \"echo DDIS &gt; \/sys\/kernel\/debug\/vgaswitcheroo\/switch\"  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p>\u0418\u0442\u0430\u043a \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e. \u042d\u043d\u0435\u0439\u0431\u043b\u0438\u043c <code>*.path<\/code> \u2014 <code>sudo systemctl enable enable-radeon.path<\/code> \u0438, \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0434\u0435\u0440\u0435\u0432\u0435 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0430\u0439\u043b (<code>PathExists=<\/code>) <code>\/sys\/kernel\/debug\/vgaswitcheroo\/switch<\/code>, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u0435\u0440\u0432\u0438\u0441.<\/p>\n<h3>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u0441\u043b\u0435\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f systemd.path<\/h3>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u0438\u0445 \u043c\u0430\u043b\u043e, \u043d\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u0430 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u044e\u043d\u0438\u0442\u043e\u0432 \u043e\u043d\u0438, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442:<\/p>\n<ul>\n<li>\n<p><code>PathExists=<\/code> \u0422\u0440\u0438\u0433\u0433\u0435\u0440\u0438\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0438\u043b\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u0432 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.<\/p>\n<\/li>\n<li>\n<p><code>PathExistsGlob=<\/code> \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0447\u0442\u043e \u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \/ \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438 \u043f\u043e \u043c\u0430\u0441\u043a\u0435.<\/p>\n<\/li>\n<li>\n<p><code>PathChanged=<\/code> \u0415\u0441\u043b\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 \u0438\u043b\u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u043d \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 <code>write()<\/code>, \u0430 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e <code>close()<\/code><\/p>\n<\/li>\n<li>\n<p> <code>PathModified=<\/code> \u041f\u043e\u0434\u043e\u0431\u043d\u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443, \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u0436\u0434\u0451\u043c close(), \u0430 \u0441\u0440\u0430\u0437\u0443 \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u043c \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u043f\u0430\u0432\u0448\u0438\u0439\u0441\u044f write().<\/p>\n<\/li>\n<li>\n<p><code>DirectoryNotEmpty=<\/code> \u041a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u2014 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439, \u043a\u043e\u0433\u0434\u0430 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0445\u043e\u0442\u044f-\u0431\u044b \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u0435 \u044d\u0442\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u0432 \u043e\u0434\u043d\u043e\u043c \u044e\u043d\u0438\u0442\u0435, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u044e\u043d\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u043c\u0438. <strong>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435!<\/strong> \u0415\u0441\u043b\u0438 \u0432 \u043a\u0430\u043a\u043e\u043c-\u043b\u0438\u0431\u043e \u0438\u0437 \u044d\u0442\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u043f\u0443\u0441\u0442\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u0431\u0440\u043e\u0441\u044f\u0442\u0441\u044f \u0438 \u0432\u0430\u0448 <code>*.path<\/code> \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. <\/p>\n<h3>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/h3>\n<ul>\n<li>\n<p><code>Unit=<\/code> \u042e\u043d\u0438\u0442 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430. \u0412\u0430\u0436\u043d\u043e\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0437\u0430\u0431\u044b\u043b \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u0412 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 <code>Unit=<\/code> \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c <code>*.service<\/code>, \u043d\u043e \u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 (\u043a\u0440\u043e\u043c\u0435 <code>*.path<\/code>)  \u044e\u043d\u0438\u0442. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>*.mount<\/code>.<\/p>\n<\/li>\n<li>\n<p><code>MakeDirectory=<\/code> \u0411\u0443\u043b\u0435\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440. \u0421\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c-\u043b\u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438 \u0441\u043b\u0435\u0436\u0435\u043d\u0438\u044f. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u2014 <code>false<\/code>.<\/p>\n<\/li>\n<li>\n<p><code>DirectoryMode=<\/code> \u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0440\u0430\u0437\u0434\u0430\u0447\u0438 \u043f\u0440\u0430\u0432 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <code>0755<\/code>.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 systemd.path c incron \u0438 inotify-tools<\/h3>\n<p>\u0412 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043e \u043f\u0430\u0440\u043e\u0447\u043a\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0445 \u0434\u043b\u044f <code>incron<\/code> \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p><strong>\u0424\u0443\u043d\u043a\u0446\u0438\u044f<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\"><strong>systemd.path<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><strong>inotify-tools<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><strong>incron<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>read<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>access<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_ACCESS<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>write<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\"><code>PathModified=<\/code><\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>modify<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_MODIFY<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>attrib<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>attrib<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_ATTRIB<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>close &amp; write<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\"><code>PathChanged=<\/code><\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>close_write<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_CLOSE_WRITE<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>close<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>close_nowrite<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_CLOSE_NOWRITE<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>open<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>open<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_OPEN<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>moved to watched<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>moved_to<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_MOVED_TO<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>moved from watched<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>moved_from<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_MOVED_FROM<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>moved self<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>moved_self<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_MOVE_SELF<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>create<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\"><code>PathExist= PathExistGlob= DirectoryNotEmpty=<\/code><\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>create<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_CREATE<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>delete<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>delete<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_DELETE<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>delete self<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>delete_self<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\"><code>IN_DELETE_SELF<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>unmount<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\"><code>unmount<\/code><\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"114\" width=\"114\">\n<p>systemd support<\/p>\n<\/td>\n<td data-colwidth=\"161\" width=\"161\">\n<p align=\"center\"><strong>yes<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"157\" width=\"157\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<td data-colwidth=\"183\" width=\"183\">\n<p align=\"center\">\u00d7<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0418 \u0434\u0430, \u0447\u0443\u0442\u044c \u043d\u0435 \u0437\u0430\u0431\u044b\u043b. \u0412\u0441\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 <code>inotify()<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 <strong>\u0442\u043e\u043b\u044c\u043a\u043e<\/strong> \u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e <strong>\u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445<\/strong>. \u0422\u043e-\u0435\u0441\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 SMB \/ NFS \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443\u0442, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 <code>\/run<\/code>, <code>\/sys<\/code>, <code>\/proc<\/code>!<\/p>\n<h2>Systemd.automount \u2014 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u044b \u0430\u0432\u0442\u043e\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0424\u0421<\/h2>\n<p>\u041e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u044e\u043d\u0438\u0442\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u043a\u0430\u043a \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0442\u0430\u043a \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0438\u0442\u044c \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 (\u043d\u0435 \u0432\u0441\u0435, \u0441 \u043a\u043e\u0440\u043d\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u0442\u0440\u044e\u043a \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0451\u0442) \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043e\u0442 \u043f\u043e\u0432\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u043f\u0438\u0442\u0430\u043d\u0438\u044f.<\/p>\n<h3>\u041f\u0440\u0430\u043a\u0442\u0438\u043a\u0430<\/h3>\n<p>\u0421\u0440\u0430\u0437\u0443 \u0434\u0432\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430. \u0414\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0439 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0414\u0432\u0430 <code>*.automount<\/code> \u0438 \u0434\u0432\u0430 <code>*.mount<\/code> \u044e\u043d\u0438\u0442\u0430 \u043a \u043d\u0438\u043c \u0432 \u043f\u0430\u0440\u0443. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 <code>*.timer<\/code> \u0438 <code>*.path<\/code> \u044e\u043d\u0438\u0442\u043e\u0432 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0443\u043d\u0442\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 <code>Unit=<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043b\u0438 \u043e\u0434\u043d\u043e\u0438\u043c\u0451\u043d\u043d\u044b\u0439 \u00abpersistent\u00bb <code>*.mount<\/code>, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0435, \u043b\u0438\u0431\u043e <code>*.mount<\/code> \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0438\u0437 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e <code>\/etc\/fstab<\/code>.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440: \u041b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u0441\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432 <code>\/boot<\/code>. \u041f\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0441\u0447\u0451\u0442\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 <code>\/boot<\/code> \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u2014 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u044f\u0434\u0440\u0430 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 <code>initrd<\/code> \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430, \u0447\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442, \u043d\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0442\u043e-\u0431\u044b \u0447\u0430\u0441\u0442\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043c\u044b \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0441\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b <code>\/boot<\/code> \u0432 \u0430\u0432\u0442\u043e\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<pre><code>$ cat \/etc\/systemd\/system\/boot.automount [Unit] Description=Automount boot partition when needed.  [Automount] Where=\/boot ## Time to automatic umount of inactivity TimeoutIdleSec=120  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p>\u0418 \u0432 \u043f\u0430\u0440\u0443 \u043a \u043d\u0435\u043c\u0443 \u043e\u0434\u043d\u043e\u0438\u043c\u0451\u043d\u043d\u044b\u0439 <code>*.mount<\/code> \u0444\u0430\u0439\u043b:<\/p>\n<pre><code>$ cat \/etc\/systemd\/system\/boot.mount [Unit] Description=Boot partition (running by automount) \/dev\/sda1 Documentation=man:systemd.mount(5) After=blockdev@dev-disk-by\\x2duuid-ea65285a\\x2d01da\\x2d451c\\x2da93a\\x2d4b155c46aeeb.target  [Mount] Where=\/boot What=\/dev\/disk\/by-uuid\/ea65285a-01da-451c-a93a-4b155c46aeeb Type=ext4 Options=rw,relatime DirectoryMode=0755<\/code><\/pre>\n<p>\u0412\u0441\u0451 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u0430\u043a \u0432 <code>fstab<\/code>, \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0441\u043a\u0438\u0434\u0430\u043d\u043e \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u0441\u0442\u0440\u043e\u0447\u043a\u0430\u043c. \u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0443\u043d\u0442\u0435: \u041a\u043e\u0433\u0434\u0430 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c\/\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <code>\/boot<\/code> \u0438\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u043b\u0438\u0441\u0442\u0438\u043d\u0433, \u0430\u0432\u0442\u043e\u043c\u0430\u0443\u043d\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043e\u0434\u043d\u043e\u0438\u043c\u0451\u043d\u043d\u044b\u0439 \u044e\u043d\u0438\u0442 <code>*.mount<\/code> \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a <code>\/boot<\/code>. \u0427\u0435\u0440\u0435\u0437 2 \u043c\u0438\u043d\u0443\u0442\u044b \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f (<code>TimeoutIdleSec=<\/code>), \u0440\u0430\u0437\u0434\u0435\u043b \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0442\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d.  <\/p>\n<p>\u0418 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0432\u0441\u0451 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0441\u043e\u0431\u0435\u0440\u0443\u0441\u044c \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043d\u0430 rclone \u2014 \u0430\u0432\u0442\u043e\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u043b\u0430\u043a\u0430 \u044f\u043d\u0434\u0435\u043a\u0441\u0430, \u043a\u043e\u0433\u0434\u0430 \u044f \u043a \u043d\u0435\u043c\u0443 \u043e\u0431\u0440\u0430\u0449\u0430\u044e\u0441\u044c.<\/p>\n<pre><code>$ cat \/etc\/systemd\/system\/home-oxyd-Clouds-yadisk.automount [Unit] Description=Automount yandex disc when needed.  [Automount] Where=\/home\/oxyd\/Clouds\/yadisk DirectoryMode=0777 ## Time to automatic umount of inactivity TimeoutIdleSec=300  [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p>\u0418 \u00ab\u043e\u0442\u0432\u0435\u0442\u043e\u0447\u043a\u0430\u00bb \u043a \u043d\u0435\u043c\u0443:<\/p>\n<pre><code>$ cat \/etc\/systemd\/system\/home-oxyd-Clouds-yadisk.mount [Unit] Description=Yandex disk automounted drive Documentation=man:systemd.mount(8)   [Mount] Where=\/home\/oxyd\/Clouds\/yadisk What=https:\/\/webdav.yandex.ru\/ Type=davfs Options=noauto,user<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0442\u043e\u0436\u0435 \u0432\u0441\u0451 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0440\u0430\u0437\u0434\u0430\u0447\u0438 \u043f\u0440\u0430\u0432 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0432\u043e\u0439 \u043d\u0435 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0430 \u0437\u0430\u043a\u043e\u043d\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435. \u0414\u0430 \u0443 \u0430\u0432\u0442\u043e\u043c\u0430\u0443\u043d\u0442\u0430 \u0440\u043e\u0432\u043d\u043e \u0442\u0440\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430:<\/p>\n<ul>\n<li>\n<p><code>Where=<\/code> \u041f\u0443\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043c.<\/p>\n<\/li>\n<li>\n<p><code>TimeoutIdleSec=<\/code> \u0422\u0430\u0439\u043c\u0430\u0443\u0442 \u043f\u0435\u0440\u0435\u0434 \u0430\u0432\u0442\u043e\u043e\u0442\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u0435\u0441\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442, \u0438\u043b\u0438 \u0440\u0430\u0432\u0435\u043d <code>0<\/code> (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e) \u0440\u0430\u0437\u0434\u0435\u043b \u043d\u0435 \u0430\u0432\u0442\u043e\u043e\u0442\u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p><code>DirectoryMode=<\/code> \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0434\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <code>0755<\/code>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u043e\u0442, \u0432\u043a\u0440\u0430\u0442\u0446\u0435, \u043a\u0430\u043a-\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a. \u0418, \u043a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430, \u043a\u0430\u043a\u0438\u0435 \u043c\u0430\u043d\u044b \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c:<\/p>\n<pre><code>man systemd.path man 7 inotify man inotifywait man inotifywatch man systemd.automount man systemd.mount man systemd-mount man 5 fstab man systemd.time<\/code><\/pre>\n<h2>\u0421\u043f\u0438\u0441\u043e\u043a \u0441\u0442\u0430\u0442\u0435\u0439 \u0441\u0435\u0440\u0438\u0438<\/h2>\n<ol>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/535872\/\" rel=\"noopener noreferrer nofollow\">\u041f\u043e\u0447\u0435\u043c\u0443 \u0445\u0430\u0431\u0440\u0430\u0436\u0438\u0442\u0435\u043b\u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u044b, \u0432\u043c\u0435\u0441\u0442\u043e \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439? \u0418\u043b\u0438 \u043e systemd, part 0<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/535930\/\" rel=\"noopener noreferrer nofollow\">Systemd \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e\u0449\u0438\u0445. Part 1 \u2014 \u0417\u0430\u043f\u0443\u0441\u043a \u044e\u043d\u0438\u0442\u043e\u0432 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/post\/536040\/\" rel=\"noopener noreferrer nofollow\"><strong>Systemd \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e\u0449\u0438\u0445. Part 2 \u2014 \u0422\u0440\u0438\u0433\u0433\u0435\u0440\u044b \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f<\/strong><\/a><\/p>\n<\/li>\n<\/ol>\n<h2>\u0420\u0435\u0441\u0443\u0440\u0441\u044b<\/h2>\n<ul>\n<li>\n<p><a href=\"https:\/\/systemd.io\/\" rel=\"noopener noreferrer nofollow\">systemd.io&nbsp;<\/a>\u2014 \u0421\u0442\u0430\u0442\u044c\u0438 \u043f\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u043a\u0443\u0445\u043d\u0435 systemd. \u0427\u0430\u0441\u0442\u0435\u043d\u044c\u043a\u043e \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u0430\u043d\u0430\u0445.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.freedesktop.org\/wiki\/Software\/systemd\/\" rel=\"noopener noreferrer nofollow\">systemd @ freedesktop.org<\/a>&nbsp;\u2014 \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441 \u043c\u0430\u043d\u0430\u043c\u0438, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439, \u0432\u0438\u0434\u0435\u043e, \u0431\u043b\u043e\u0433\u0430\u043c\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u043c\u0438 \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438 \u043d\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u044b.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/t.me\/ru_systemd\" rel=\"noopener noreferrer nofollow\">@ru_systemd<\/a>&nbsp;\u2014 \u0420\u0443\u0441\u0441\u043a\u043e\u044f\u0437\u044b\u0447\u043d\u044b\u0439 \u0447\u0430\u0442 \u0432 Telegram. \u0423 \u043d\u0430\u0441 \u0442\u0435\u043f\u043b\u043e \u0438 \u043b\u0430\u043c\u043f\u043e\u0432\u043e.<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<p> \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\/post\/536040\/\"> https:\/\/habr.com\/ru\/post\/536040\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-316349","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/316349","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=316349"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/316349\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=316349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=316349"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=316349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}