Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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
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