{"id":4779,"date":"2022-12-20T18:36:52","date_gmt":"2022-12-20T21:36:52","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/user-service-man5\/"},"modified":"2022-12-20T18:36:52","modified_gmt":"2022-12-20T21:36:52","slug":"user-service-man5","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/user-service-man5\/","title":{"rendered":"USER@.SERVICE (man5)"},"content":{"rendered":"<h1 align=\"center\">USER@.SERVICE<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#CONTROLLING RESOURCES FOR LOGGED\u2212IN USERS\">CONTROLLING RESOURCES FOR LOGGED\u2212IN USERS<\/a><br \/> <a href=\"#EXAMPLES\">EXAMPLES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">user@.service, user-runtime-dir@.service, systemd-user-runtime-dir \u2212 System units to start the user manager<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">user@<i>UID<\/i>.service<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">user\u2212runtime\u2212dir@<i>UID<\/i>.service<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">\/usr\/lib\/systemd\/systemd\u2212user\u2212runtime\u2212dir<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">user\u2212<i>UID<\/i>.slice<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>systemd<\/b>(1) system manager (PID 1) starts user manager instances as user@<i>UID<\/i>.service, with the user&#8217;s numerical UID used as the instance identifier. These instances use the same executable as the system manager, but running in a mode where it starts a different set of units. Each <b>systemd \u2212\u2212user<\/b> instance manages a hierarchy of units specific to that user. See <b>systemd<\/b>(1) for a discussion of units and <b>systemd.special<\/b>(7) for a list of units that form the basis of the unit hierarchies of system and user units.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">user@<i>UID<\/i>.service is accompanied by the system unit user\u2212runtime\u2212dir@<i>UID<\/i>.service, which creates the user&#8217;s runtime directory \/run\/user\/<i>UID<\/i>, and then removes it when this unit is stopped. user\u2212runtime\u2212dir@<i>UID<\/i>.service executes the systemd\u2212user\u2212runtime\u2212dir binary to do the actual work.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">User processes may be started by the user@.service instance, in which case they will be part of that unit in the system hierarchy. They may also be started elsewhere, for example by <b>sshd<\/b>(8) or a display manager like <b>gdm<\/b>, in which case they form a .scope unit (see <b>systemd.scope<\/b>(5)). Both user@<i>UID<\/i>.service and the scope units are collected under the user\u2212<i>UID<\/i>.slice.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Individual user\u2212<i>UID<\/i>.slice slices are collected under user.slice, see <b>systemd.special<\/b>(7).<\/p>\n<h2>CONTROLLING RESOURCES FOR LOGGED\u2212IN USERS <a name=\"CONTROLLING RESOURCES FOR LOGGED\u2212IN USERS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Options that control resources available to logged\u2212in users can be configured at a few different levels. As described in the previous section, user.slice contains processes of all users, so any resource limits on that slice apply to all users together. The usual way to configure them would be through drop\u2212ins, e.g. \/etc\/systemd\/system\/user.slice.d\/resources.conf.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The processes of a single user are collected under user\u2212<i>UID<\/i>.slice. Resource limits for that user can be configured through drop\u2212ins for that unit, e.g. \/etc\/systemd\/system\/user\u22121000.slice.d\/resources.conf. If the limits should apply to all users instead, they may be configured through drop\u2212ins for the truncated unit name, user\u2212.slice. For example, configuration in \/etc\/systemd\/system\/user\u2212.slice.d\/resources.conf is included in all user\u2212<i>UID<\/i>.slice units, see <b>systemd.unit<\/b>(5) for a discussion of the drop\u2212in mechanism.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When a user logs in and a .scope unit is created for the session (see previous section), the creation of the scope may be managed through <b>pam_systemd<\/b>(8). This PAM module communicates with <b>systemd-logind<\/b>(8) to create the session scope and provide access to hardware resources. Resource limits for the scope may be configured through the PAM module configuration, see <b>pam_systemd<\/b>(8). Configuring them through the normal unit configuration is also possible, but since the name of the slice unit is generally unpredictable, this is less useful.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">In general any resources that apply to units may be set for user@<i>UID<\/i>.service and the slice units discussed above, see <b>systemd.resource-control<\/b>(5) for an overview.<\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Example\u00a01.\u00a0Hierarchy of control groups with two logged in users<\/b><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">$ systemd\u2212cgls <br \/> Control group \/: <br \/> \u2212.slice <br \/> \u00e2\u00e2user.slice <br \/> \u00e2 \u00e2\u00e2user\u22121000.slice <br \/> \u00e2 \u00e2 \u00e2\u00e2user@1000.service <br \/> \u00e2 \u00e2 \u00e2 \u00e2\u00e2pulseaudio.service <br \/> \u00e2 \u00e2 \u00e2 \u00e2 \u00e2\u00e22386 \/usr\/bin\/pulseaudio \u2212\u2212daemonize=no <br \/> \u00e2 \u00e2 \u00e2 \u00e2\u00e2gnome\u2212terminal\u2212server.service <br \/> \u00e2 \u00e2 \u00e2 \u00e2\u00e2init.scope <br \/> \u00e2 \u00e2 \u00e2 \u00e2\u00e2 4127 \/usr\/libexec\/gnome\u2212terminal\u2212server <br \/> \u00e2 \u00e2 \u00e2 \u00e2\u00e2 4198 zsh <br \/> \u00e2 \u00e2 &#8230; <br \/> \u00e2 \u00e2 \u00e2\u00e2session\u22124.scope <br \/> \u00e2 \u00e2 \u00e2\u00e2 1264 gdm\u2212session\u2212worker [pam\/gdm\u2212password] <br \/> \u00e2 \u00e2 \u00e2\u00e2 2339 \/usr\/bin\/gnome\u2212shell <br \/> \u00e2 \u00e2 &#8230; <br \/> \u00e2 \u00e2 \u00e2\u00e2session\u221219.scope <br \/> \u00e2 \u00e2 \u00e2\u00e26497 sshd: zbyszek [priv] <br \/> \u00e2 \u00e2 \u00e2\u00e26502 sshd: zbyszek@pts\/6 <br \/> \u00e2 \u00e2 \u00e2\u00e26509 \u2212zsh <br \/> \u00e2 \u00e2 \u00e2\u00e26602 systemd\u2212cgls \u2212\u2212no\u2212pager <br \/> \u00e2 &#8230; <br \/> \u00e2 \u00e2\u00e2user\u22121001.slice <br \/> \u00e2 \u00e2\u00e2session\u221220.scope <br \/> \u00e2 \u00e2 \u00e2\u00e26675 sshd: guest [priv] <br \/> \u00e2 \u00e2 \u00e2\u00e26708 sshd: guest@pts\/6 <br \/> \u00e2 \u00e2 \u00e2\u00e26717 \u2212bash <br \/> \u00e2 \u00e2\u00e2user@1001.service <br \/> \u00e2 \u00e2\u00e2init.scope <br \/> \u00e2 \u00e2 \u00e2\u00e26680 \/usr\/lib\/systemd\/systemd \u2212\u2212user <br \/> \u00e2 \u00e2 \u00e2\u00e26688 (sd\u2212pam) <br \/> \u00e2 \u00e2\u00e2sleep.service <br \/> \u00e2 \u00e2\u00e26706 \/usr\/bin\/sleep 30 <br \/> &#8230;<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">User with UID 1000 is logged in using <b>gdm<\/b> (session\u22124.scope) and <b>ssh<\/b>(1) (session\u221219.scope), and also has a user manager instance running (user@1000.service). User with UID 1001 is logged in using <b>ssh<\/b> (session\u221220.scope) and also has a user manager instance running (user@1001.service). Those are all (leaf) system units, and form part of the slice hierarchy, with user\u22121000.slice and user\u22121001.slice below user.slice. User units are visible below the user@.service instances (pulseaudio.service, gnome\u2212terminal\u2212server.service, init.scope, sleep.service).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Example\u00a02.\u00a0Default user resource limits<\/b><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">$ systemctl cat user\u22121000.slice <br \/> # \/usr\/lib\/systemd\/system\/user\u2212.slice.d\/10\u2212defaults.conf <br \/> # &#8230; <br \/> [Unit] <br \/> Description=User Slice of UID %j <br \/> After=systemd\u2212user\u2212sessions.service<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">[Slice] <br \/> TasksMax=33%<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The user\u2212<i>UID<\/i>.slice units by default don&#8217;t have a unit file. The resource limits are set through a drop\u2212in, which can be easily replaced or extended following standard drop\u2212in mechanisms discussed in the first section.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>systemd<\/b>(1), <b>systemd.service<\/b>(5), <b>systemd.slice<\/b>(5), <b>systemd.resource-control<\/b>(5), <b>systemd.exec<\/b>(5), <b>systemd.special<\/b>(7), <b>pam<\/b>(8)<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  user@.service, user-runtime-dir@.service, systemd-user-runtime-dir \u2212 System units to start the user manager <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[959],"tags":[961,1291,1695],"class_list":["post-4779","post","type-post","status-publish","format-standard","hentry","category-5-formatos-de-ficheros","tag-961","tag-man5","tag-user"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4779","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=4779"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4779\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=4779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=4779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=4779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}