mirror of
https://github.com/foo-dogsquared/wiki.git
synced 2025-01-31 01:57:54 +00:00
41 lines
16 KiB
HTML
41 lines
16 KiB
HTML
<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width"/><meta charSet="utf-8"/><title>systemd</title><script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script><script id="MathJax-script" async="" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script><script type="text/x-mathjax-config">
|
|
MathJax = {
|
|
tex: {
|
|
inlineMath: [ ['$','$'], ['\(','\)'] ],
|
|
displayMath: [ ['$$','$$'], ['[',']'] ]
|
|
},
|
|
options = {
|
|
processHtmlClass = "math"
|
|
}
|
|
}
|
|
</script><meta name="next-head-count" content="6"/><link rel="preload" href="/wiki/_next/static/css/52fc2ba29703df73922c.css" as="style"/><link rel="stylesheet" href="/wiki/_next/static/css/52fc2ba29703df73922c.css" data-n-g=""/><noscript data-n-css=""></noscript><link rel="preload" href="/wiki/_next/static/chunks/main-ae4733327bd95c4ac325.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/webpack-50bee04d1dc61f8adf5b.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/framework.9d524150d48315f49e80.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/commons.0e1c3f9aa780c2dfe9f0.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/pages/_app-8e3d0c58a60ec788aa69.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/940643274e605e7596ecea1f2ff8d83317a3fb76.4841a16762f602a59f00.js" as="script"/><link rel="preload" href="/wiki/_next/static/chunks/pages/%5B%5B...slug%5D%5D-1aa198f87ede1cd0e1dc.js" as="script"/></head><body><div id="__next"><main><h1>systemd</h1><section class="post-metadata"><span>Date: <!-- -->2021-05-20 22:37:22 +08:00</span><span>Date modified: <!-- -->2022-04-19 20:21:56 +08:00</span></section><nav class="toc"><ol class="toc-level toc-level-1"><li class="toc-item toc-item-h1"><a href="/wiki/linux.systemd#systemd-at-user-level" class="toc-link toc-link-h1">systemd at user-level</a></li><li class="toc-item toc-item-h1"><a href="/wiki/linux.systemd#extra-information" class="toc-link toc-link-h1">Extra information</a></li></ol></nav><p>systemd is a big tool for a big system.
|
|
Let's explore some of them from a perspective of a wannabe power user.
|
|
</p><p>Among other things, it has the following list of features.
|
|
</p><ul><li><p><a href="/wiki/linux.systemd.timers">systemd timers</a> which can replace cron for task scheduling.
|
|
</p></li><li><p><a href="/wiki/linux.systemd.services">systemd services</a> along with the usual antics of a service manager such as managing dependencies and commands to run when killed.
|
|
</p></li><li><p><a href="/wiki/linux.systemd.transient-units">systemd transient units</a> for quickly creating and scheduling one-off services.
|
|
</p></li><li><p><a href="/wiki/linux.systemd.unit-templates">systemd unit templates</a> is handy for managing units that have common structure, enabling to start them quickly and dynamically.
|
|
</p></li><li><p><a href="/wiki/linux.systemd.environment-directives">systemd environment directives</a> enable setting environment variables from a systemd-ful session.
|
|
</p></li><li><p><a href="/wiki/linux.systemd.network">systemd-networkd</a> is the network configuration manager in case you want to do <a href="/wiki/linux.network-configuration">Network configuration in Linux</a>.
|
|
</p></li><li><p><a href="/wiki/linux.systemd.bootloader">systemd-boot</a> is a bootloader mainly for UEFI-based systems.
|
|
</p></li><li><p><a href="/wiki/linux.systemd.journal">systemd-journald</a> is the system logging service providing a structured way to manage your logs from different units.
|
|
</p></li><li><p><a href="/wiki/linux.systemd.unit-hardening">systemd unit hardening</a> can help your services secure.
|
|
</p></li></ul><h1 id="systemd-at-user-level">systemd at user-level</h1><p>systemd has the ability to run at user-level empowering the user to manage their own system with their own settings.
|
|
It immensely helps separating user-specific settings from the system-wide settings.
|
|
</p><p>systemd looks for the units from certain paths.
|
|
You can look for them from the <code class="inline-verbatim">systemd.unit.5</code> manual page.
|
|
</p><p>To run systemd as a user instance, simply add a <code class="inline-verbatim">--user</code> flag beforehand for <code class="inline-verbatim">systemctl</code> and other systemd binaries, if applicable.
|
|
</p><pre class="src-block"><code class="language-shell"># See how different the output when run at user- and system-level.
|
|
systemctl --user show-units
|
|
systemctl show-units
|
|
|
|
systemctl --user show-environment
|
|
systemctl show-environment
|
|
|
|
systemctl --user start $SERVICE
|
|
</code></pre><h1 id="extra-information">Extra information</h1><ul><li><p><code class="inline-verbatim">systemd.directives.7</code> is an index of configuration directives including unit keys, environment variables, and command line options for systemd-related things.
|
|
Also contains the related manual pages for a deeper references.
|
|
</p></li><li><p>On a similar note, <code class="inline-verbatim">systemd.index.7</code> is an alphabetical index of the important keywords found in systemd.
|
|
</p></li><li><p><code class="inline-verbatim">systemd.mount</code> units require the filename to be the mountpoint.
|
|
Though, it has to be converted to what systemd accepts (e.g., <code class="inline-verbatim">systemd-escape --path $PATH</code>).
|
|
</p></li></ul><section><h2>Backlinks</h2><ul><li><a href="/wiki/cli.systemctl">Command line: systemctl</a></li><li><a href="/wiki/linux.all-distros-are-their-own">How all Linux distros are technically operating systems of their own</a></li><li><a href="/wiki/linux.systemd.environment-directives">systemd environment directives</a></li><li><a href="/wiki/linux.systemd.timers">systemd timers</a></li><li><a href="/wiki/linux.systemd.transient-units">systemd transient units</a></li><li><a href="/wiki/linux.why-a-unified-linux-distro-is-a-bad-idea">Why wishing a unified Linux distro is a pointless task</a></li></ul></section></main></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"metadata":{"date":"\"2021-05-20 22:37:22 +08:00\"","date_modified":"\"2022-04-19 20:21:56 +08:00\"","language":"en","source":""},"title":"systemd","hast":{"type":"root","children":[{"type":"element","tagName":"nav","properties":{"className":"toc"},"children":[{"type":"element","tagName":"ol","properties":{"className":"toc-level toc-level-1"},"children":[{"type":"element","tagName":"li","data":{"hookArgs":[{"type":"element","tagName":"h1","properties":{"id":"systemd-at-user-level"},"children":[{"type":"text","value":"systemd at user-level"}]}]},"properties":{"className":"toc-item toc-item-h1"},"children":[{"type":"element","tagName":"a","properties":{"className":"toc-link toc-link-h1","href":"/linux.systemd#systemd-at-user-level"},"children":[{"type":"text","value":"systemd at user-level"}]}]},{"type":"element","tagName":"li","data":{"hookArgs":[{"type":"element","tagName":"h1","properties":{"id":"extra-information"},"children":[{"type":"text","value":"Extra information"}]}]},"properties":{"className":"toc-item toc-item-h1"},"children":[{"type":"element","tagName":"a","properties":{"className":"toc-link toc-link-h1","href":"/linux.systemd#extra-information"},"children":[{"type":"text","value":"Extra information"}]}]}]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"systemd is a big tool for a big system.\nLet's explore some of them from a perspective of a wannabe power user.\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Among other things, it has the following list of features.\n"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"/linux.systemd.timers"},"children":[{"type":"text","value":"systemd timers"}]},{"type":"text","value":" which can replace cron for task scheduling.\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"/linux.systemd.services"},"children":[{"type":"text","value":"systemd services"}]},{"type":"text","value":" along with the usual antics of a service manager such as managing dependencies and commands to run when killed.\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"/linux.systemd.transient-units"},"children":[{"type":"text","value":"systemd transient units"}]},{"type":"text","value":" for quickly creating and scheduling one-off services.\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"/linux.systemd.unit-templates"},"children":[{"type":"text","value":"systemd unit templates"}]},{"type":"text","value":" is handy for managing units that have common structure, enabling to start them quickly and dynamically.\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"/linux.systemd.environment-directives"},"children":[{"type":"text","value":"systemd environment directives"}]},{"type":"text","value":" enable setting environment variables from a systemd-ful session.\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"/linux.systemd.network"},"children":[{"type":"text","value":"systemd-networkd"}]},{"type":"text","value":" is the network configuration manager in case you want to do "},{"type":"element","tagName":"a","properties":{"href":"/linux.network-configuration"},"children":[{"type":"text","value":"Network configuration in Linux"}]},{"type":"text","value":".\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"/linux.systemd.bootloader"},"children":[{"type":"text","value":"systemd-boot"}]},{"type":"text","value":" is a bootloader mainly for UEFI-based systems.\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"/linux.systemd.journal"},"children":[{"type":"text","value":"systemd-journald"}]},{"type":"text","value":" is the system logging service providing a structured way to manage your logs from different units.\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"a","properties":{"href":"/linux.systemd.unit-hardening"},"children":[{"type":"text","value":"systemd unit hardening"}]},{"type":"text","value":" can help your services secure.\n"}]}]}]},{"type":"element","tagName":"h1","properties":{"id":"systemd-at-user-level"},"children":[{"type":"text","value":"systemd at user-level"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"systemd has the ability to run at user-level empowering the user to manage their own system with their own settings.\nIt immensely helps separating user-specific settings from the system-wide settings.\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"systemd looks for the units from certain paths.\nYou can look for them from the "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"systemd.unit.5"}]},{"type":"text","value":" manual page.\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"To run systemd as a user instance, simply add a "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"--user"}]},{"type":"text","value":" flag beforehand for "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"systemctl"}]},{"type":"text","value":" and other systemd binaries, if applicable.\n"}]},{"type":"element","tagName":"pre","properties":{"className":["src-block"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-shell"]},"children":[{"type":"text","value":"# See how different the output when run at user- and system-level.\nsystemctl --user show-units\nsystemctl show-units\n\nsystemctl --user show-environment\nsystemctl show-environment\n\nsystemctl --user start $SERVICE\n"}]}]},{"type":"element","tagName":"h1","properties":{"id":"extra-information"},"children":[{"type":"text","value":"Extra information"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"systemd.directives.7"}]},{"type":"text","value":" is an index of configuration directives including unit keys, environment variables, and command line options for systemd-related things.\n Also contains the related manual pages for a deeper references.\n "}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"On a similar note, "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"systemd.index.7"}]},{"type":"text","value":" is an alphabetical index of the important keywords found in systemd.\n"}]}]},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"systemd.mount"}]},{"type":"text","value":" units require the filename to be the mountpoint.\n Though, it has to be converted to what systemd accepts (e.g., "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"systemd-escape --path $PATH"}]},{"type":"text","value":").\n"}]}]}]}]},"backlinks":[{"path":"/cli.systemctl","title":"Command line: systemctl"},{"path":"/linux.all-distros-are-their-own","title":"How all Linux distros are technically operating systems of their own"},{"path":"/linux.systemd.environment-directives","title":"systemd environment directives"},{"path":"/linux.systemd.timers","title":"systemd timers"},{"path":"/linux.systemd.transient-units","title":"systemd transient units"},{"path":"/linux.why-a-unified-linux-distro-is-a-bad-idea","title":"Why wishing a unified Linux distro is a pointless task"}]},"__N_SSG":true},"page":"/[[...slug]]","query":{"slug":["linux.systemd"]},"buildId":"Ie9t5zutrXP6Of75Cb5xF","assetPrefix":"/wiki","nextExport":false,"isFallback":false,"gsp":true}</script><script nomodule="" src="/wiki/_next/static/chunks/polyfills-99d808df29361cf7ffb1.js"></script><script src="/wiki/_next/static/chunks/main-ae4733327bd95c4ac325.js" async=""></script><script src="/wiki/_next/static/chunks/webpack-50bee04d1dc61f8adf5b.js" async=""></script><script src="/wiki/_next/static/chunks/framework.9d524150d48315f49e80.js" async=""></script><script src="/wiki/_next/static/chunks/commons.0e1c3f9aa780c2dfe9f0.js" async=""></script><script src="/wiki/_next/static/chunks/pages/_app-8e3d0c58a60ec788aa69.js" async=""></script><script src="/wiki/_next/static/chunks/940643274e605e7596ecea1f2ff8d83317a3fb76.4841a16762f602a59f00.js" async=""></script><script src="/wiki/_next/static/chunks/pages/%5B%5B...slug%5D%5D-1aa198f87ede1cd0e1dc.js" async=""></script><script src="/wiki/_next/static/Ie9t5zutrXP6Of75Cb5xF/_buildManifest.js" async=""></script><script src="/wiki/_next/static/Ie9t5zutrXP6Of75Cb5xF/_ssgManifest.js" async=""></script></body></html> |