0

When executing remote script with SSH:

ssh user@192.168.0.10 -t sudo /etc/init.d/wildfly start

WildFly not started. If I run

ssh user@192.168.0.10 -t /home/user/my.sh

my.sh:

!#/bin/bash
sudo /etc/init.d/wildfly start
sleep 10

WildFly starting and after 10 sec, when ssh connection closed WF stopped. If I connect "manually" with "ssh user@192.168.0.10" and then type in console "sudo /etc/init.d/wildfly start" - no problem.

init.d/wildfly: http://pastebin.com/UDxmEYRZ

How I can start WildFly without manually enter each command in console?

1

nohup could be what you want:

nohup - run a command immune to hangups, with output to a non-tty

sudo nohup /etc/init.d/wildfly start
0

Put your command in single quotation ' ' : ssh user@192.168.0.10 'sudo /etc/init.d/wildfly start' And also set timeout parameter more in sshd.conf

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.