Skip to content

Commit dfa3c97

Browse files
authored
Add support for systemd ExecReload option. (#623)
1 parent c79de59 commit dfa3c97

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/bin/pg_autoctl/systemd_config.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@
5353
make_int_option_default("Service", "StartLimitBurst", NULL, true, \
5454
&(config->StartLimitBurst), 20)
5555

56+
#define OPTION_SYSTEMD_EXECRELOAD(config) \
57+
make_strbuf_option_default("Service", "ExecReload", NULL, true, BUFSIZE, \
58+
config->ExecReload, "/usr/bin/pg_autoctl reload")
59+
5660
#define OPTION_SYSTEMD_WANTEDBY(config) \
5761
make_strbuf_option_default("Install", "WantedBy", NULL, true, BUFSIZE, \
5862
config->WantedBy, "multi-user.target")
@@ -66,6 +70,7 @@
6670
OPTION_SYSTEMD_EXECSTART(config), \
6771
OPTION_SYSTEMD_RESTART(config), \
6872
OPTION_SYSTEMD_STARTLIMITBURST(config), \
73+
OPTION_SYSTEMD_EXECRELOAD(config), \
6974
OPTION_SYSTEMD_WANTEDBY(config), \
7075
INI_OPTION_LAST \
7176
}
@@ -108,6 +113,7 @@ systemd_config_init(SystemdServiceConfig *config, const char *pgdata)
108113

109114
/* adjust the program to the current full path of argv[0] */
110115
sformat(config->ExecStart, BUFSIZE, "%s run", pg_autoctl_program);
116+
sformat(config->ExecReload, BUFSIZE, "%s reload", pg_autoctl_program);
111117

112118
if (!ini_validate_options(systemdOptions))
113119
{

src/bin/pg_autoctl/systemd_config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ typedef struct SystemdServiceConfig
2929
char ExecStart[BUFSIZE];
3030
char Restart[BUFSIZE];
3131
int StartLimitBurst;
32+
char ExecReload[BUFSIZE];
3233

3334
/* Install */
3435
char WantedBy[BUFSIZE];

0 commit comments

Comments
 (0)