Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

daemon with restart crash because of _check_sane_and_get_gpg_version #270

Open
liz367 opened this issue Jan 9, 2020 · 0 comments
Open

Comments

@liz367
Copy link

liz367 commented Jan 9, 2020

i am using python 3.7.0, gnupg 2.3.1 in centos 7.
i want to build a daemon for my service and add a function that monitors the sigchild signal, and restart my service whenever it crashes

i think the daemon code should be right.
when i add the monitor&restart function, it can work correctly with a simple service:

while True:
    print(1)
    time.sleep(5)

but something wrong when i use gnupg in my service code, even like this simple demo:

time.sleep(3)
print('start')
import gnupg
gnupg.GPG(homedir='/root/.gnupg')
while True:
    print(1)
    time.sleep(5)

the daemon catch so many sigchild signal, and the log show that maybe something go wrong in .../gunpg/_meta/_check_sane_and_get_gpg_version(func)/_read_data(func)/log.debug("Reading data from stream %r..." % stream.repr())

i try to seek for the reason, but i can't handle this question.
but i find if i cancel the function _check_sane_and_get_gpg_version call, the restart function will work.
so i think maybe my daemon code make the proc = self.open_subprocess(["--list-config", "--with-colons"])going wrong.

can anyone help me to figure out the cause?
thanks!
this is my daemon code
daemon.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant