systemd-eated-su.xhtml (4448B)
- <article xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" class="h-entry">
- <a class="u-url" href="/articles/systemd-eated-su"><h1 class="p-name">Lennart Poettering merged “su” command replacement into systemd: Test Drive on Fedora Rawhide</h1></a>
- <p><a href="https://tlhp.cf/lennart-poettering-su/">“Original” Article</a></p>
- <blockquote>Well, there have been long discussions about this, but the problem is that what "<code>su</code>" is supposed to do is very unclear. On one hand it's supposed to open a new session and change a number of execution context parameters (`<code>uid</code>`, `<code>gid</code>`, `<code>env</code>`, ...), and on the other it's supposed to inherit a lot concepts from the originating session (`<code>tty</code>`, `<code>cgroup</code>`, `<code>audit</code>`, ...). Since this is so weakly defined it's a really weird mix&match of old and new paramters.</blockquote>
- <p>Pretty clear, it ask for root or specified user password, launches a shell. If <code>-</code>, <code>-l</code>, <code>--login</code> is put it starts a new environement before starting the shell.</p>
- <blockquote>To keep this somewhat managable we decided to only switch the absolute minimum over, and that excludes `XDG_RUNTIME_DIR`, specifically because `XDG_RUNTIME_DIR` is actually bound to the `session/audit` runtime and those we do not transition. Instead we simply unset it.</blockquote>
- <p>Ah, of course desktop crap in the userland… And crappy explanation, maybe you should patent and copyreich that in case. ᕕ(ᐛ)ᕗ</p>
- <blockquote><pre><code>$ <kbd>cat /etc/os-release</kbd>
- <samp>NAME=Fedora VERSION="24 (Workstation Edition)"
- ID=fedora
- VERSION_ID=24
- PRETTY_NAME="Fedora 24 (Workstation Edition)"
- ANSI_COLOR="0;34"
- CPE_NAME="cpe:/o:fedoraproject:fedora:24"
- HOME_URL="https://fedoraproject.org/"
- BUG_REPORT_URL="https://bugzilla.redhat.com/"
- REDHAT_BUGZILLA_PRODUCT="Fedora"
- REDHAT_BUGZILLA_PRODUCT_VERSION=Rawhide
- REDHAT_SUPPORT_PRODUCT="Fedora"
- REDHAT_SUPPORT_PRODUCT_VERSION=Rawhide
- PRIVACY_POLICY_URL=https://fedoraproject.org/wiki/Legal:PrivacyPolicy
- VARIANT="Workstation Edition"
- VARIANT_ID=workstation
- </samp>$ <kbd>systemctl --version</kbd>
- <samp>systemd 225
- +PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN</samp></code></pre></blockquote>
- <p>Okay here’s the same shit from a non voided system. Let’s share. ;D</p>
- <pre><code>
- % <kbd>cat /etc/os-release</kbd>
- <samp>ID=gentoo
- PRETTY_NAME="Gentoo/Linux"
- ANSI_COLOR="1;32"
- HOME_URL="http://www.gentoo.org/"
- SUPPORT_URL="http://www.gentoo.org/main/en/support.xml"
- BUG_REPORT_URL="https://bugs.gentoo.org/"
- </samp>% <kbd>rc --version</kbd>
- <samp>rc (OpenRC) 0.17 (Gentoo Linux)
- </samp></code></pre>
- <p>Anyway, let’s continue</p>
- <blockquote>
- $ machinectl shell
- Connected to the local host. Press ^] three times within 1s to exit session.
- </blockquote>
- <p>Okay even worse binding than Escape-Meta-Alt-Control-Shift(EMACS), fuck stty eof(^D), fuck POSIX, fuck quick and intuitive commands(shell for login, hell yeah), yes rude mode is activated.</p>
- <blockquote>
- It works! We can work as superuser. And isn’t end: we can also set shell and host:
- <code>$ <kbd>machinectl shell root@.host /bin/bash</kbd></code>
- </blockquote>
- <p>Wait… ssh is crap too? Why is there a dot before the host(maybe fuck localhost too…)?</p>
- <blockquote>
- Login as non-root user and set variable of shell environment:
- <code>#1000 - UID of user `paul`
- #SYSTEMD_TEST - test variable of user environment
- $ <kbd>machinectl shell --uid 1000 --setenv="SYSTEMD_TEST=777"</kbd></code>
- </blockquote>
- <p>’Kay so starting another $SHELL and export VAR=VARIABLE too ?</p>
- <blockquote><code>$ <kbd>sudo systemd-run -p CPUQuota=50% -p PAMName=login -t /bin/bash -c '/usr/bin/stress -c 4'</kbd></code></blockquote>
- <p>Ah! So after saying cgroups is awesome… you goes with quota on the CPU… well maybe that’s called evolution… ? Why are you using login, you created machinectl for nothing? Why are you using -p options like a replacement to args… o_O<br />
- Well this command is full of fuck(not the very great program which among other thing uses… sudo with the last command :D)</p>
- <p>I wonder when you will eat Emacs(meta-OS), build your own kernel because fuck UNIX so we can 🖖“live long an prosper” with (GNU/)Linux and BSD and you with SystemDOS.</p>
- </article>