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

SIGHUP handler for reloading config #316

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dvershinin
Copy link

Adds SIGHUP handler for on the fly config reload. Fixes #46.

To check, kill -s HUP <mtproxy-pid>.

Result:

[24061][2019-06-28 04:04:51.292265 local] configuration file /usr/share/mtproxy/proxy-multi.conf re-read successfully (68 bytes parsed), new configuration active
[24061][2019-06-28 04:04:51.292270 local] Creating NEW connection to x.x.x.x:8888

Then in e.g. SystemD service, add:

[Service]
...
ExecReload=/bin/kill -s HUP $MAINPID

Result is being able to reload config after updating proxy file via systemctl reload mtproxy.

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

Successfully merging this pull request may close these issues.

On-the-fly config file reload
1 participant