Properly handle SIGTERM if daemon ran with -d #1060
No reviewers
Labels
No Label
bug
build
dependencies
developers
documentation
duplicate
enhancement
formatting
invalid
legal
mobile
obsolete
packaging
performance
protocol
question
refactoring
regression
security
test
translation
usability
wontfix
No Milestone
No project
No Assignees
1 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Bitmessage/PyBitmessage-2024-12-10#1060
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "daemon"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
There is a minor problem: if no
daemon
setting inkeys.dat
pybitmessage ignoresSIGTERM
. I suggest to checksingleistance.daemon
variable instead of config to determine daemon status.Looks ok but I have some other pending stuff to do first. Afterwards I'll ask you to rebase. You can also fix other places where daemon is checked since you're on it.(shutdown, tr, singlecleaner).
Good catch, and sorry for the regression that I've caused.
I think the "flake" commits belong in a separate PR as they are not relevant to this bugfix (SIGTERM handling). Other than that, it looks good.
Tested successfully on Linux and an ACK from me (for commit 2a94647 only).
Please separate flake8 commits to a different pull request.
There is also
shared.daemon
introduced in c89d86a: I'm unsure maybe it should be used instead ofshared.thisapp.daemon
?I wondered about this too. There is currently a bunch of runtime variables scattered between
shared
,state
andthisapp
which seem to be the result of several incomplete migrations.EDIT (sorry, misread your comment):
Based on my reading of the current code,
shared.daemon
is the legacy variable currently in use, whileshared.thisapp.daemon
should never be used outside ofmain
.Short-term, I suggest that
shared.daemon
is used across the board at this stage, instead ofshared.thisapp.daemon
. Long-term I think this should be migrated tostate.daemon
- as a separate PR./EDIT
FTR
shared.daemon
was not introduced inc89d86a
, it was just moved a few lines further down. I avoided changing too much of the status quo to keep the diff small, but it seems I did a pretty poor job at that.ad0119f tested OK on Linux with daemon=false and --daemon switch.
Actually I have a problem with desktop app in module
tr
with this code. Investigating...Is something wrong with this PR?
Please rebase, I'm ready to merge, looks ok to me.
If you want, you can also get rid of
shared.daemon
, or I can do it after merging this. This includes removing one line inbitmessagemain.py
and replacingshared.daemon
withshared.thisapp.daemon
inclass_singleCleaner.py
.I think I figured out how to merge without rebasing in a way that doesn't distrupt the workflow, tip4commit and gpg signatures. Should make it easier to merge in the future.
@g1itch let me know if you'll get rid of shared.daemon (in a separate PR) or want me to do that.