title: Python script (which open Reverse SSH tunnel) called by service doesn't work
body: <p>Here is my python script:</p>
  
  <pre><code>#!/usr/bin/env python3
  import subprocess
  
  subprocess.run(['ssh', '-fNT','-o', 'ExitOnForwardFailure=yes', '-R', '2222:localhost:22', 'martin@192.168.11.111'])
  </code></pre>
  
  <p>called by my service:</p>
  
  <pre><code>[Unit]
  Description=reverse SSH
  After=multi-user.target
  Conflicts=getty@tty1.service
  
  [Service]
  Type=simple
  ExecStart=/usr/bin/python3 /home/pi/Public/OnPushButton_PULLUP.py
  User=pi
  Group=pi
  WorkingDirectory=/home/pi/Public/
  StandardInput=tty-force
  
  [Install]
  WantedBy=multi-user.target
  </code></pre>
  
  <p>This script exit 0/ Success if I trust systemctl, even if ssh tunnel connection doesn't work after .</p>
  
  <pre><code>● reverse_ssh.service - reverse SSH
     Loaded: loaded (/lib/systemd/system/reverse_ssh.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Thu 2019-08-01 10:01:21 CEST; 6min ago
    Process: 549 ExecStart=/usr/bin/python3 /home/pi/Public/OnPushButton_PULLUP.py (code=exited, status=0/SUCCESS)
   Main PID: 549 (code=exited, status=0/SUCCESS)
  
  août 01 10:01:19 raspberrypi systemd[1]: Started reverse SSH.
  </code></pre>
  
  <p>If I execute this script standalone (I mean like "./script.py") this script works.
  At the moment I use service to call it this issue occurs...Where did I do it wrong ??</p>
  
  <p>Thanks !</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Problem solved. The problem was on my service file.
  I had to change"Type:simple" to "Type=forking" because I need to call another process from my python script.
  I also have to wait until device get an @IP otherwise the script script trew "Host unreacheable"
  For this I used this service file at the end:</p>
  
  <pre><code>[Unit]
  Description=reverse SSH
  Wants=network-online.target
  After=network.target network-online.target
  
  [Service]
  Type=forking
  ExecStartPre=/bin/sleep 10
  ExecStart=/usr/bin/python3 /home/pi/Public/OnPushButton_PULLUP.py
  User=pi
  Group=pi
  WorkingDirectory=/home/pi/Public/
  TimeoutSec=infinity
  
  [Install]
  WantedBy=multi-user.target
  </code></pre>
  
  <p>Normally adding just this works:</p>
  
  <pre><code>Wants=network-online.target
  After=network.target network-online.target
  </code></pre>
  
  <p>But it didn't for me. That's why I put a :</p>
  
  <pre><code>ExecStartPre=/bin/sleep 10
  </code></pre>
  
  <p>This line mention to the service that he will wait 10s before trying to be executed. This will give time to device to get @IP from the dhcp.</p>