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.










share|improve this question









New contributor




hayfreed is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 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












  • @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















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.










share|improve this question









New contributor




hayfreed is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 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












  • @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













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.










share|improve this question









New contributor




hayfreed is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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






share|improve this question









New contributor




hayfreed is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




hayfreed is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Nov 16 at 22:49





















New contributor




hayfreed is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 16 at 21:53









hayfreed

112




112




New contributor




hayfreed is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





hayfreed is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






hayfreed is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 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












  • @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














  • 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












  • @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








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















active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






hayfreed is a new contributor. Be nice, and check out our Code of Conduct.










 

draft saved


draft discarded


















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






























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.










 

draft saved


draft discarded


















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.















 


draft saved


draft discarded














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





















































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







Popular posts from this blog

Morgemoulin

Scott Moir

Souastre