Skip to content

SIGHUP handler for reloading config#316

Open
dvershinin wants to merge 2 commits intoTelegramMessenger:masterfrom
dvershinin:master
Open

SIGHUP handler for reloading config#316
dvershinin wants to merge 2 commits intoTelegramMessenger:masterfrom
dvershinin:master

Conversation

@dvershinin
Copy link
Copy Markdown

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