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

Add ExecReload option to pgcat.service for configuration reloads #760

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

dog-64
Copy link
Contributor

@dog-64 dog-64 commented Jun 23, 2024

This commit adds the ExecReload option to the pgcat.service file, allowing for reloading the PgCat service configuration without restarting the service. This update enables the use of sudo systemctl reload pgcat.service for applying configuration changes more efficiently.

Before the fix:

The service configuration did not support the reload command, necessitating a full restart to apply any configuration changes, which could cause downtime and interrupt active connections.

After the fix:

The service configuration now includes the ExecReload=/bin/kill -SIGHUP $MAINPID option, allowing for seamless configuration reloads:

[Unit]
Description=PgCat pooler
After=network.target
StartLimitIntervalSec=0

[Service]
User=pgcat
Type=simple
Restart=always
RestartSec=1
Environment=RUST_LOG=info
LimitNOFILE=65536
ExecStart=/usr/bin/pgcat /etc/pgcat.toml
ExecReload=/bin/kill -SIGHUP $MAINPID

[Install]
WantedBy=multi-user.target

@levkk
Copy link
Contributor

levkk commented Jun 24, 2024

There is also the option to just run pkill pgcat -HUP, so a restart isn't necessary, but yes, this is a good addition.

@levkk levkk merged commit 731aa04 into postgresml:main Jun 24, 2024
1 check passed
AndrewJackson2020 pushed a commit to AndrewJackson2020/pgcat that referenced this pull request Sep 3, 2024
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.

2 participants