<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nick-black.com/dankwiki/index.php?action=history&amp;feed=atom&amp;title=Screen_under_systemd</id>
	<title>Screen under systemd - revision history</title>
	<link rel="self" type="application/atom+xml" href="https://nick-black.com/dankwiki/index.php?action=history&amp;feed=atom&amp;title=Screen_under_systemd"/>
	<link rel="alternate" type="text/html" href="https://nick-black.com/dankwiki/index.php?title=Screen_under_systemd&amp;action=history"/>
	<updated>2026-10-22T01:52:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://nick-black.com/dankwiki/index.php?title=Screen_under_systemd&amp;diff=8843&amp;oldid=prev</id>
		<title>Dank: Created page with &quot;Sometimes I want to run a process in [https://www.gnu.org/software/screen/ GNU Screen] out of systemd, sometimes out of a user&#039;s session. This way, it gets started along with other services, I can monitor its status through standard systemd infrastructure, it gets restarted (or otherwise handled appropriately) on a crash or accidental kill/exit, but I can also come along at any time and monitor its (potentially tty-like) output and send it interactive input.  ==rtorr...&quot;</title>
		<link rel="alternate" type="text/html" href="https://nick-black.com/dankwiki/index.php?title=Screen_under_systemd&amp;diff=8843&amp;oldid=prev"/>
		<updated>2022-09-04T22:30:43Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Sometimes I want to run a process in [https://www.gnu.org/software/screen/ GNU Screen] out of &lt;a href=&quot;/dankwiki/index.php?title=Systemd&quot; title=&quot;Systemd&quot;&gt;systemd&lt;/a&gt;, sometimes out of a user&amp;#039;s session. This way, it gets started along with other services, I can monitor its status through standard systemd infrastructure, it gets restarted (or otherwise handled appropriately) on a crash or accidental kill/exit, but I can also come along at any time and monitor its (potentially tty-like) output and send it interactive input.  ==rtorr...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Sometimes I want to run a process in [https://www.gnu.org/software/screen/ GNU Screen] out of [[systemd]], sometimes out of a user&amp;#039;s session. This way, it gets started along with other services, I can monitor its status through standard systemd infrastructure, it gets restarted (or otherwise handled appropriately) on a crash or accidental kill/exit, but I can also come along at any time and monitor its (potentially tty-like) output and send it interactive input.&lt;br /&gt;
&lt;br /&gt;
==rtorrent under Screen==&lt;br /&gt;
Here&amp;#039;s my systemd unit for running [https://github.com/rakshasa/rtorrent rtorrent], a full-screen [[Ncurses]] application, under Screen in my user session:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# /home/dank/.config/systemd/user/rtorrent.service&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=rtorrent screen session&lt;br /&gt;
After=network.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
Type=simple&lt;br /&gt;
ExecStart=/usr/bin/screen -L -DmS rtorrent /usr/bin/rtorrent&lt;br /&gt;
ExecStop=/usr/bin/screen -S rtorrent -X quit&lt;br /&gt;
NoNewPrivileges=yes&lt;br /&gt;
ProtectKernelTunables=yes&lt;br /&gt;
ProtectControlGroups=yes&lt;br /&gt;
RestrictNamespaces=yes&lt;br /&gt;
WorkingDirectory=/home/dank/var/lib/rtorrent&lt;br /&gt;
#RestrictAddressFamilies=AF_INET AF_INET6&lt;br /&gt;
#ProtectSystem=yes&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=default.target&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dank</name></author>
	</entry>
</feed>