title: Jenkins with Publish over SSH plugin, -1 exit status
body: <p>I use Jenkins for build and plugin for deploy my artifacts to server. After deploying files I stopped service by calling eec in plugin</p>
  
  <pre><code>sudo service myservice stop
  </code></pre>
  
  <p>and I receive answer from Publish over SSH:</p>
  
  <pre><code>SSH: EXEC: channel open
  SSH: EXEC: STDOUT/STDERR from command [sudo service myservice stop]...
  SSH: EXEC: connected
  Stopping script myservice
  SSH: EXEC: completed after 200 ms
  SSH: Disconnecting configuration [172.29.19.2] ...
  ERROR: Exception when publishing, exception message [Exec exit status not zero. Status [-1]]
  Build step 'Send build artifacts over SSH' changed build result to UNSTABLE
  Finished: UNSTABLE
  </code></pre>
  
  <p>The build is failed but the service is stopped.</p>
  
  <p>My /etc/init.d/myservice</p>
  
  <pre><code>#! /bin/sh
  # /etc/init.d/myservice
  #
  # Some things that run always
  # touch /var/lock/myservice
  # Carry out specific functions when asked to by the system
  case "$1" in
    start)
        echo "Starting myservice"
        setsid /opt/myservice/bin/myservice --spring.config.location=/etc/ezd/application.properties --server.port=8082 &gt;&gt; /opt/myservice/app.log &amp;
    ;;
    stop)
        echo "Stopping script myservice"
        pkill -f myservice 
        #
    ;;
    *)
        echo "Usage: /etc/init.d/myservice {start|stop}"
        exit 1
    ;;
  esac
  exit 0
  </code></pre>
  
  <p>Please say me why I get -1 exit status?</p>