Process ownership automatically changes to init process on GCP Ubuntu 18.04LTS
We recently moved our development infrastructure from our own old machines running Ubuntu 12.04 to Google Cloud instances running Ubuntu 18.04.
Developers usually start some screens and run django servers within those screens.
For example, one may create a screen screen -S webserver_5552
and run its django development application within the screen python manage.py runserver 0.0.0.0:5552
On our previous machines, we could detach the screen (ctrl+a d
) and come back later (screen -r xxxx.webserver_5552
): the django server process would still be here, up and running, and owned by the bash process of the screen.
On the Google Cloud machine, this is, however, working differently and has been driving us crazy. We can still detach the screen, but if we come back later after a while, the django process is no longer owned by the bash process! Instead, it is owned by the init process (ppid set to 1 from ps).
Usually, we got a backtrace from the django process before it received some signals and got his ownership changed, but that's all we got and we can't figure out what's the root cause and how to prevent it:
Traceback (most recent call last):
File "manage.py", line 65, in <module>
execute_from_command_line(sys.argv)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 294, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 58, in execute
super(Command, self).execute(*args, **options)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 345, in execute
output = self.handle(*args, **options)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 97, in handle
self.run(**options)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 106, in run
autoreload.main(self.inner_run, None, options)
File "/home/testing/env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 333, in main
reloader(wrapped_main_func, args, kwargs)
File "/home/testing/env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 304, in python_reloader
exit_code = restart_with_reloader()
File "/home/testing/env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 290, in restart_with_reloader
exit_code = os.spawnve(os.P_WAIT, sys.executable, args, new_environ)
File "/home/testing/odesk_android/../env/lib/python2.7/os.py", line 575, in spawnve
return _spawnvef(mode, file, args, env, execve)
File "/home/testing/odesk_android/../env/lib/python2.7/os.py", line 548, in _spawnvef
wpid, sts = waitpid(pid, 0)
OSError: [Errno 4] Interrupted system call
This has been a particularly annoying behavior and we could not figure out the root cause (does it come from ubuntu, GCP, some misconfiguration, ...?).
ubuntu gnu-screen init google-cloud
New contributor
add a comment |
We recently moved our development infrastructure from our own old machines running Ubuntu 12.04 to Google Cloud instances running Ubuntu 18.04.
Developers usually start some screens and run django servers within those screens.
For example, one may create a screen screen -S webserver_5552
and run its django development application within the screen python manage.py runserver 0.0.0.0:5552
On our previous machines, we could detach the screen (ctrl+a d
) and come back later (screen -r xxxx.webserver_5552
): the django server process would still be here, up and running, and owned by the bash process of the screen.
On the Google Cloud machine, this is, however, working differently and has been driving us crazy. We can still detach the screen, but if we come back later after a while, the django process is no longer owned by the bash process! Instead, it is owned by the init process (ppid set to 1 from ps).
Usually, we got a backtrace from the django process before it received some signals and got his ownership changed, but that's all we got and we can't figure out what's the root cause and how to prevent it:
Traceback (most recent call last):
File "manage.py", line 65, in <module>
execute_from_command_line(sys.argv)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 294, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 58, in execute
super(Command, self).execute(*args, **options)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 345, in execute
output = self.handle(*args, **options)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 97, in handle
self.run(**options)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 106, in run
autoreload.main(self.inner_run, None, options)
File "/home/testing/env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 333, in main
reloader(wrapped_main_func, args, kwargs)
File "/home/testing/env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 304, in python_reloader
exit_code = restart_with_reloader()
File "/home/testing/env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 290, in restart_with_reloader
exit_code = os.spawnve(os.P_WAIT, sys.executable, args, new_environ)
File "/home/testing/odesk_android/../env/lib/python2.7/os.py", line 575, in spawnve
return _spawnvef(mode, file, args, env, execve)
File "/home/testing/odesk_android/../env/lib/python2.7/os.py", line 548, in _spawnvef
wpid, sts = waitpid(pid, 0)
OSError: [Errno 4] Interrupted system call
This has been a particularly annoying behavior and we could not figure out the root cause (does it come from ubuntu, GCP, some misconfiguration, ...?).
ubuntu gnu-screen init google-cloud
New contributor
When you attach to thescreen
session, does it still run the same shell process with the same PID?
– Bodo
3 mins ago
add a comment |
We recently moved our development infrastructure from our own old machines running Ubuntu 12.04 to Google Cloud instances running Ubuntu 18.04.
Developers usually start some screens and run django servers within those screens.
For example, one may create a screen screen -S webserver_5552
and run its django development application within the screen python manage.py runserver 0.0.0.0:5552
On our previous machines, we could detach the screen (ctrl+a d
) and come back later (screen -r xxxx.webserver_5552
): the django server process would still be here, up and running, and owned by the bash process of the screen.
On the Google Cloud machine, this is, however, working differently and has been driving us crazy. We can still detach the screen, but if we come back later after a while, the django process is no longer owned by the bash process! Instead, it is owned by the init process (ppid set to 1 from ps).
Usually, we got a backtrace from the django process before it received some signals and got his ownership changed, but that's all we got and we can't figure out what's the root cause and how to prevent it:
Traceback (most recent call last):
File "manage.py", line 65, in <module>
execute_from_command_line(sys.argv)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 294, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 58, in execute
super(Command, self).execute(*args, **options)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 345, in execute
output = self.handle(*args, **options)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 97, in handle
self.run(**options)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 106, in run
autoreload.main(self.inner_run, None, options)
File "/home/testing/env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 333, in main
reloader(wrapped_main_func, args, kwargs)
File "/home/testing/env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 304, in python_reloader
exit_code = restart_with_reloader()
File "/home/testing/env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 290, in restart_with_reloader
exit_code = os.spawnve(os.P_WAIT, sys.executable, args, new_environ)
File "/home/testing/odesk_android/../env/lib/python2.7/os.py", line 575, in spawnve
return _spawnvef(mode, file, args, env, execve)
File "/home/testing/odesk_android/../env/lib/python2.7/os.py", line 548, in _spawnvef
wpid, sts = waitpid(pid, 0)
OSError: [Errno 4] Interrupted system call
This has been a particularly annoying behavior and we could not figure out the root cause (does it come from ubuntu, GCP, some misconfiguration, ...?).
ubuntu gnu-screen init google-cloud
New contributor
We recently moved our development infrastructure from our own old machines running Ubuntu 12.04 to Google Cloud instances running Ubuntu 18.04.
Developers usually start some screens and run django servers within those screens.
For example, one may create a screen screen -S webserver_5552
and run its django development application within the screen python manage.py runserver 0.0.0.0:5552
On our previous machines, we could detach the screen (ctrl+a d
) and come back later (screen -r xxxx.webserver_5552
): the django server process would still be here, up and running, and owned by the bash process of the screen.
On the Google Cloud machine, this is, however, working differently and has been driving us crazy. We can still detach the screen, but if we come back later after a while, the django process is no longer owned by the bash process! Instead, it is owned by the init process (ppid set to 1 from ps).
Usually, we got a backtrace from the django process before it received some signals and got his ownership changed, but that's all we got and we can't figure out what's the root cause and how to prevent it:
Traceback (most recent call last):
File "manage.py", line 65, in <module>
execute_from_command_line(sys.argv)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 294, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 58, in execute
super(Command, self).execute(*args, **options)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 345, in execute
output = self.handle(*args, **options)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 97, in handle
self.run(**options)
File "/home/testing/env/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 106, in run
autoreload.main(self.inner_run, None, options)
File "/home/testing/env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 333, in main
reloader(wrapped_main_func, args, kwargs)
File "/home/testing/env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 304, in python_reloader
exit_code = restart_with_reloader()
File "/home/testing/env/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 290, in restart_with_reloader
exit_code = os.spawnve(os.P_WAIT, sys.executable, args, new_environ)
File "/home/testing/odesk_android/../env/lib/python2.7/os.py", line 575, in spawnve
return _spawnvef(mode, file, args, env, execve)
File "/home/testing/odesk_android/../env/lib/python2.7/os.py", line 548, in _spawnvef
wpid, sts = waitpid(pid, 0)
OSError: [Errno 4] Interrupted system call
This has been a particularly annoying behavior and we could not figure out the root cause (does it come from ubuntu, GCP, some misconfiguration, ...?).
ubuntu gnu-screen init google-cloud
ubuntu gnu-screen init google-cloud
New contributor
New contributor
edited 3 mins ago
Rui F Ribeiro
40.6k1479137
40.6k1479137
New contributor
asked 15 mins ago
Simon NinonSimon Ninon
101
101
New contributor
New contributor
When you attach to thescreen
session, does it still run the same shell process with the same PID?
– Bodo
3 mins ago
add a comment |
When you attach to thescreen
session, does it still run the same shell process with the same PID?
– Bodo
3 mins ago
When you attach to the
screen
session, does it still run the same shell process with the same PID?– Bodo
3 mins ago
When you attach to the
screen
session, does it still run the same shell process with the same PID?– Bodo
3 mins ago
add a comment |
0
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',
autoActivateHeartbeat: false,
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
});
}
});
Simon Ninon 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%2f503495%2fprocess-ownership-automatically-changes-to-init-process-on-gcp-ubuntu-18-04lts%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Simon Ninon is a new contributor. Be nice, and check out our Code of Conduct.
Simon Ninon is a new contributor. Be nice, and check out our Code of Conduct.
Simon Ninon is a new contributor. Be nice, and check out our Code of Conduct.
Simon Ninon is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2f503495%2fprocess-ownership-automatically-changes-to-init-process-on-gcp-ubuntu-18-04lts%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
When you attach to the
screen
session, does it still run the same shell process with the same PID?– Bodo
3 mins ago