remote process run through ssh gets killed if UI is closed
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
0
down vote
favorite
I have written a script which essentially does 2 things:
- Runs a UI for listening to the actual program running on the server
- remotely run the program on the server
All goes well, the UI starts, then the program is run on the server. But as soon as I close the UI the remote process gets killed.
Relevant portions of the script:
ui_pid = subprocess.check_output('/home/user/git/sim_ui.sh', shell=True)
command = 'ssh user@server "bash -c 'cd program_dir/ && echo "running program >> log.out && ./program.sh >> log.out'"'
print command
os.system(command)
sim_ui.sh:
nohup ui_binary args > ui_out.txt &
I also am unable to find out what killed the process on the server i.e. signal which terminated the process and where it originated from.
Edit:
When I add screen -dm
before bash -c
it works perfectly.
ssh scripting python background-process nohup
add a comment |Â
up vote
0
down vote
favorite
I have written a script which essentially does 2 things:
- Runs a UI for listening to the actual program running on the server
- remotely run the program on the server
All goes well, the UI starts, then the program is run on the server. But as soon as I close the UI the remote process gets killed.
Relevant portions of the script:
ui_pid = subprocess.check_output('/home/user/git/sim_ui.sh', shell=True)
command = 'ssh user@server "bash -c 'cd program_dir/ && echo "running program >> log.out && ./program.sh >> log.out'"'
print command
os.system(command)
sim_ui.sh:
nohup ui_binary args > ui_out.txt &
I also am unable to find out what killed the process on the server i.e. signal which terminated the process and where it originated from.
Edit:
When I add screen -dm
before bash -c
it works perfectly.
ssh scripting python background-process nohup
I assume there is some kind of communication between the UI and the program running on the server?
â koalo
Jul 27 at 8:27
@koalo Yes. But not of the kind where the remote program terminates upon closing the UI. When I addscreen -dm
beforebash -c
everything works perfectly.
â user3286661
Jul 27 at 8:30
I could not understand, what did happen when runnohup ui_binary args > ui_out.txt &
?
â Hossein Vatani
Jul 27 at 10:39
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have written a script which essentially does 2 things:
- Runs a UI for listening to the actual program running on the server
- remotely run the program on the server
All goes well, the UI starts, then the program is run on the server. But as soon as I close the UI the remote process gets killed.
Relevant portions of the script:
ui_pid = subprocess.check_output('/home/user/git/sim_ui.sh', shell=True)
command = 'ssh user@server "bash -c 'cd program_dir/ && echo "running program >> log.out && ./program.sh >> log.out'"'
print command
os.system(command)
sim_ui.sh:
nohup ui_binary args > ui_out.txt &
I also am unable to find out what killed the process on the server i.e. signal which terminated the process and where it originated from.
Edit:
When I add screen -dm
before bash -c
it works perfectly.
ssh scripting python background-process nohup
I have written a script which essentially does 2 things:
- Runs a UI for listening to the actual program running on the server
- remotely run the program on the server
All goes well, the UI starts, then the program is run on the server. But as soon as I close the UI the remote process gets killed.
Relevant portions of the script:
ui_pid = subprocess.check_output('/home/user/git/sim_ui.sh', shell=True)
command = 'ssh user@server "bash -c 'cd program_dir/ && echo "running program >> log.out && ./program.sh >> log.out'"'
print command
os.system(command)
sim_ui.sh:
nohup ui_binary args > ui_out.txt &
I also am unable to find out what killed the process on the server i.e. signal which terminated the process and where it originated from.
Edit:
When I add screen -dm
before bash -c
it works perfectly.
ssh scripting python background-process nohup
edited Jul 27 at 8:31
asked Jul 27 at 8:17
user3286661
1011
1011
I assume there is some kind of communication between the UI and the program running on the server?
â koalo
Jul 27 at 8:27
@koalo Yes. But not of the kind where the remote program terminates upon closing the UI. When I addscreen -dm
beforebash -c
everything works perfectly.
â user3286661
Jul 27 at 8:30
I could not understand, what did happen when runnohup ui_binary args > ui_out.txt &
?
â Hossein Vatani
Jul 27 at 10:39
add a comment |Â
I assume there is some kind of communication between the UI and the program running on the server?
â koalo
Jul 27 at 8:27
@koalo Yes. But not of the kind where the remote program terminates upon closing the UI. When I addscreen -dm
beforebash -c
everything works perfectly.
â user3286661
Jul 27 at 8:30
I could not understand, what did happen when runnohup ui_binary args > ui_out.txt &
?
â Hossein Vatani
Jul 27 at 10:39
I assume there is some kind of communication between the UI and the program running on the server?
â koalo
Jul 27 at 8:27
I assume there is some kind of communication between the UI and the program running on the server?
â koalo
Jul 27 at 8:27
@koalo Yes. But not of the kind where the remote program terminates upon closing the UI. When I add
screen -dm
before bash -c
everything works perfectly.â user3286661
Jul 27 at 8:30
@koalo Yes. But not of the kind where the remote program terminates upon closing the UI. When I add
screen -dm
before bash -c
everything works perfectly.â user3286661
Jul 27 at 8:30
I could not understand, what did happen when run
nohup ui_binary args > ui_out.txt &
?â Hossein Vatani
Jul 27 at 10:39
I could not understand, what did happen when run
nohup ui_binary args > ui_out.txt &
?â Hossein Vatani
Jul 27 at 10:39
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f458777%2fremote-process-run-through-ssh-gets-killed-if-ui-is-closed%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
I assume there is some kind of communication between the UI and the program running on the server?
â koalo
Jul 27 at 8:27
@koalo Yes. But not of the kind where the remote program terminates upon closing the UI. When I add
screen -dm
beforebash -c
everything works perfectly.â user3286661
Jul 27 at 8:30
I could not understand, what did happen when run
nohup ui_binary args > ui_out.txt &
?â Hossein Vatani
Jul 27 at 10:39