Why can't I send a post request to my server after SSH logout?
up vote
2
down vote
favorite
I've created a .jar file which listens on port 8089 and receives post requests. I start it in the background on my linux machine with the following commands:
nohup java -jar myServer.jar &
[1] 19769
-bash-4.1$ nohup: ignoring input and appending output to `nohup.out'
jobs
[1]+ Running nohup java -jar myServer.jar &
disown
It may be redundant to use both nohup and disown, but my understanding is that this should work effectively to run the process in the background and detach it from the terminal. When I log out of my SSH and log back in, it is still listening:
tcp 0 0 0.0.0.0:8089 0.0.0.0:* LISTEN 19769/java
Now I log out and attempt to send a post request. I receive a no response error, and when I log back in, the process is not running anymore. Somehow sending the post request while not logged in causes the process to crash. What have I missed?
Edit: in response to the first comment by @vastlysuperiorman, it should be noted that my nohup.out file does not contain any errors, and that when I launch a post request from curl while logged into the server, it returns the data as expected.
ssh command-line terminal process background-process
New contributor
|
show 3 more comments
up vote
2
down vote
favorite
I've created a .jar file which listens on port 8089 and receives post requests. I start it in the background on my linux machine with the following commands:
nohup java -jar myServer.jar &
[1] 19769
-bash-4.1$ nohup: ignoring input and appending output to `nohup.out'
jobs
[1]+ Running nohup java -jar myServer.jar &
disown
It may be redundant to use both nohup and disown, but my understanding is that this should work effectively to run the process in the background and detach it from the terminal. When I log out of my SSH and log back in, it is still listening:
tcp 0 0 0.0.0.0:8089 0.0.0.0:* LISTEN 19769/java
Now I log out and attempt to send a post request. I receive a no response error, and when I log back in, the process is not running anymore. Somehow sending the post request while not logged in causes the process to crash. What have I missed?
Edit: in response to the first comment by @vastlysuperiorman, it should be noted that my nohup.out file does not contain any errors, and that when I launch a post request from curl while logged into the server, it returns the data as expected.
ssh command-line terminal process background-process
New contributor
1
I suspect that this has nothing to do with whether or not you're logged in. More likely, the code is having a fatal error upon receiving thePOST
. Have you looked atnohup.out
to see if the application logged any errors? Have you tried sending thePOST
withcurl
while still logged into the box? If you can update your question with the results of those actions, it might help us answer.
– vastlysuperiorman
Nov 16 at 22:10
@vastlysuperiorman thanks for the helpful questions. I've edited my question with what I've observed. Note that it is only when I run a post request while logged out that I experience the error, when logged in it works fine until I run one when I'm logged out.
– hayfreed
Nov 16 at 22:50
systemd
killing user processes on logout?
– roaima
Nov 16 at 22:53
@roaima don't think so. As noted above, if I log out and log back in the process still runs. It is only when I launch a post request to the server while logged out that the process stops.
– hayfreed
Nov 16 at 22:57
2
Thanks for updating your question. Ifstrace
isn't available, do you have the ability to modify the code? Can trace logging be enabled, and can you add more log messages in the application itself? As far as I can tell, you're properly backgrounding the application. The fact it's still running after you disconnect your session is evidence of that. Unless there's a significant difference in the requests themselves or the way the application responds to loopback, the problem isn't likely to be at the OS level.
– vastlysuperiorman
Nov 17 at 2:43
|
show 3 more comments
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I've created a .jar file which listens on port 8089 and receives post requests. I start it in the background on my linux machine with the following commands:
nohup java -jar myServer.jar &
[1] 19769
-bash-4.1$ nohup: ignoring input and appending output to `nohup.out'
jobs
[1]+ Running nohup java -jar myServer.jar &
disown
It may be redundant to use both nohup and disown, but my understanding is that this should work effectively to run the process in the background and detach it from the terminal. When I log out of my SSH and log back in, it is still listening:
tcp 0 0 0.0.0.0:8089 0.0.0.0:* LISTEN 19769/java
Now I log out and attempt to send a post request. I receive a no response error, and when I log back in, the process is not running anymore. Somehow sending the post request while not logged in causes the process to crash. What have I missed?
Edit: in response to the first comment by @vastlysuperiorman, it should be noted that my nohup.out file does not contain any errors, and that when I launch a post request from curl while logged into the server, it returns the data as expected.
ssh command-line terminal process background-process
New contributor
I've created a .jar file which listens on port 8089 and receives post requests. I start it in the background on my linux machine with the following commands:
nohup java -jar myServer.jar &
[1] 19769
-bash-4.1$ nohup: ignoring input and appending output to `nohup.out'
jobs
[1]+ Running nohup java -jar myServer.jar &
disown
It may be redundant to use both nohup and disown, but my understanding is that this should work effectively to run the process in the background and detach it from the terminal. When I log out of my SSH and log back in, it is still listening:
tcp 0 0 0.0.0.0:8089 0.0.0.0:* LISTEN 19769/java
Now I log out and attempt to send a post request. I receive a no response error, and when I log back in, the process is not running anymore. Somehow sending the post request while not logged in causes the process to crash. What have I missed?
Edit: in response to the first comment by @vastlysuperiorman, it should be noted that my nohup.out file does not contain any errors, and that when I launch a post request from curl while logged into the server, it returns the data as expected.
ssh command-line terminal process background-process
ssh command-line terminal process background-process
New contributor
New contributor
edited Nov 16 at 22:49
New contributor
asked Nov 16 at 21:53
hayfreed
112
112
New contributor
New contributor
1
I suspect that this has nothing to do with whether or not you're logged in. More likely, the code is having a fatal error upon receiving thePOST
. Have you looked atnohup.out
to see if the application logged any errors? Have you tried sending thePOST
withcurl
while still logged into the box? If you can update your question with the results of those actions, it might help us answer.
– vastlysuperiorman
Nov 16 at 22:10
@vastlysuperiorman thanks for the helpful questions. I've edited my question with what I've observed. Note that it is only when I run a post request while logged out that I experience the error, when logged in it works fine until I run one when I'm logged out.
– hayfreed
Nov 16 at 22:50
systemd
killing user processes on logout?
– roaima
Nov 16 at 22:53
@roaima don't think so. As noted above, if I log out and log back in the process still runs. It is only when I launch a post request to the server while logged out that the process stops.
– hayfreed
Nov 16 at 22:57
2
Thanks for updating your question. Ifstrace
isn't available, do you have the ability to modify the code? Can trace logging be enabled, and can you add more log messages in the application itself? As far as I can tell, you're properly backgrounding the application. The fact it's still running after you disconnect your session is evidence of that. Unless there's a significant difference in the requests themselves or the way the application responds to loopback, the problem isn't likely to be at the OS level.
– vastlysuperiorman
Nov 17 at 2:43
|
show 3 more comments
1
I suspect that this has nothing to do with whether or not you're logged in. More likely, the code is having a fatal error upon receiving thePOST
. Have you looked atnohup.out
to see if the application logged any errors? Have you tried sending thePOST
withcurl
while still logged into the box? If you can update your question with the results of those actions, it might help us answer.
– vastlysuperiorman
Nov 16 at 22:10
@vastlysuperiorman thanks for the helpful questions. I've edited my question with what I've observed. Note that it is only when I run a post request while logged out that I experience the error, when logged in it works fine until I run one when I'm logged out.
– hayfreed
Nov 16 at 22:50
systemd
killing user processes on logout?
– roaima
Nov 16 at 22:53
@roaima don't think so. As noted above, if I log out and log back in the process still runs. It is only when I launch a post request to the server while logged out that the process stops.
– hayfreed
Nov 16 at 22:57
2
Thanks for updating your question. Ifstrace
isn't available, do you have the ability to modify the code? Can trace logging be enabled, and can you add more log messages in the application itself? As far as I can tell, you're properly backgrounding the application. The fact it's still running after you disconnect your session is evidence of that. Unless there's a significant difference in the requests themselves or the way the application responds to loopback, the problem isn't likely to be at the OS level.
– vastlysuperiorman
Nov 17 at 2:43
1
1
I suspect that this has nothing to do with whether or not you're logged in. More likely, the code is having a fatal error upon receiving the
POST
. Have you looked at nohup.out
to see if the application logged any errors? Have you tried sending the POST
with curl
while still logged into the box? If you can update your question with the results of those actions, it might help us answer.– vastlysuperiorman
Nov 16 at 22:10
I suspect that this has nothing to do with whether or not you're logged in. More likely, the code is having a fatal error upon receiving the
POST
. Have you looked at nohup.out
to see if the application logged any errors? Have you tried sending the POST
with curl
while still logged into the box? If you can update your question with the results of those actions, it might help us answer.– vastlysuperiorman
Nov 16 at 22:10
@vastlysuperiorman thanks for the helpful questions. I've edited my question with what I've observed. Note that it is only when I run a post request while logged out that I experience the error, when logged in it works fine until I run one when I'm logged out.
– hayfreed
Nov 16 at 22:50
@vastlysuperiorman thanks for the helpful questions. I've edited my question with what I've observed. Note that it is only when I run a post request while logged out that I experience the error, when logged in it works fine until I run one when I'm logged out.
– hayfreed
Nov 16 at 22:50
systemd
killing user processes on logout?– roaima
Nov 16 at 22:53
systemd
killing user processes on logout?– roaima
Nov 16 at 22:53
@roaima don't think so. As noted above, if I log out and log back in the process still runs. It is only when I launch a post request to the server while logged out that the process stops.
– hayfreed
Nov 16 at 22:57
@roaima don't think so. As noted above, if I log out and log back in the process still runs. It is only when I launch a post request to the server while logged out that the process stops.
– hayfreed
Nov 16 at 22:57
2
2
Thanks for updating your question. If
strace
isn't available, do you have the ability to modify the code? Can trace logging be enabled, and can you add more log messages in the application itself? As far as I can tell, you're properly backgrounding the application. The fact it's still running after you disconnect your session is evidence of that. Unless there's a significant difference in the requests themselves or the way the application responds to loopback, the problem isn't likely to be at the OS level.– vastlysuperiorman
Nov 17 at 2:43
Thanks for updating your question. If
strace
isn't available, do you have the ability to modify the code? Can trace logging be enabled, and can you add more log messages in the application itself? As far as I can tell, you're properly backgrounding the application. The fact it's still running after you disconnect your session is evidence of that. Unless there's a significant difference in the requests themselves or the way the application responds to loopback, the problem isn't likely to be at the OS level.– vastlysuperiorman
Nov 17 at 2:43
|
show 3 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
hayfreed is a new contributor. Be nice, and check out our Code of Conduct.
hayfreed is a new contributor. Be nice, and check out our Code of Conduct.
hayfreed is a new contributor. Be nice, and check out our Code of Conduct.
hayfreed is a new contributor. Be nice, and check out our Code of Conduct.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f482252%2fwhy-cant-i-send-a-post-request-to-my-server-after-ssh-logout%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
I suspect that this has nothing to do with whether or not you're logged in. More likely, the code is having a fatal error upon receiving the
POST
. Have you looked atnohup.out
to see if the application logged any errors? Have you tried sending thePOST
withcurl
while still logged into the box? If you can update your question with the results of those actions, it might help us answer.– vastlysuperiorman
Nov 16 at 22:10
@vastlysuperiorman thanks for the helpful questions. I've edited my question with what I've observed. Note that it is only when I run a post request while logged out that I experience the error, when logged in it works fine until I run one when I'm logged out.
– hayfreed
Nov 16 at 22:50
systemd
killing user processes on logout?– roaima
Nov 16 at 22:53
@roaima don't think so. As noted above, if I log out and log back in the process still runs. It is only when I launch a post request to the server while logged out that the process stops.
– hayfreed
Nov 16 at 22:57
2
Thanks for updating your question. If
strace
isn't available, do you have the ability to modify the code? Can trace logging be enabled, and can you add more log messages in the application itself? As far as I can tell, you're properly backgrounding the application. The fact it's still running after you disconnect your session is evidence of that. Unless there's a significant difference in the requests themselves or the way the application responds to loopback, the problem isn't likely to be at the OS level.– vastlysuperiorman
Nov 17 at 2:43