title: Systemctl(?) killing detached screens
body: <p>I have a program written in Go that programmatically creates and manages screens. Here's an example:</p>
  <pre class="lang-golang prettyprint-override"><code>_, err := exec.Command(&quot;screen&quot;, &quot;-S&quot;, &quot;screen-&quot;+strings.ToLower(name), &quot;-X&quot;, &quot;stuff&quot;, command+&quot;\n&quot;).Output()
  </code></pre>
  <p>This works fine. When I Control+C the program, the screens created stay open (what I want!). However, I've converted it into a background service on Ubuntu. When I run <code>systemctl stop &lt;service&gt;</code>, it kills those screens without a warning. Attaching to a screen doesn't stop this either (instantly goes to <code>[screen terminated]</code>). It doesn't kill screens created externally, however.</p>
  <p>Here is my <code>.service</code>:</p>
  <pre><code>[Unit]
  Description=&gt;servicename&gt; background service
  After=network-online.target
  
  [Service]
  ExecStart=/usr/lib/&lt;servicename&gt;/service
  
  [Install]
  WantedBy=multi-user.target
  </code></pre>
  <p>My <code>rules</code>:</p>
  <pre><code>%:
      dh $@ --with systemd --parallel
  
  override_dh_auto_install:
      dh_auto_install
      dh_systemd_enable || true
      dh_systemd_start || true
  </code></pre>
  <p>My <code>control</code>:</p>
  <pre><code>Package: &lt;name&gt;
  Version: 0.2
  Architecture: amd64
  Priority: optional
  Maintainer: &lt;me&gt;
  Description: &lt;description&gt;
  Depends: screen, iptables
  Build-Depends: dh-systemd (&gt;=1.5)
  </code></pre>
  <p>I can't imagine what would cause these screens to kill. I'm pretty sure they're not being attached in the program because it runs fine as an executable. System logs don't mention anything outside of &quot;service stopped' and 'service started'. I've tried making screens under root, different users, running an empty screen vs running a program, etc. Nothing notable.</p>
  <p>Any ideas?</p>