Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
b874c6f1
Unverified
Commit
b874c6f1
authored
Oct 08, 2021
by
Bjorn Svensson
Committed by
GitHub
Oct 07, 2021
Browse files
Move config logfile to generic config (#9592)
Move config `logfile` to generic configs
parent
54d01e36
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/config.c
View file @
b874c6f1
...
...
@@ -556,9 +556,6 @@ void loadServerConfigFromString(char *config) {
argv
[
1
],
strerror
(
errno
));
goto
loaderr
;
}
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"logfile"
)
&&
argc
==
2
)
{
zfree
(
server
.
logfile
);
server
.
logfile
=
zstrdup
(
argv
[
1
]);
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"include"
)
&&
argc
==
2
)
{
loadServerConfig
(
argv
[
1
],
0
,
NULL
);
}
else
if
((
!
strcasecmp
(
argv
[
0
],
"slaveof"
)
||
...
...
@@ -988,9 +985,6 @@ void configGetCommand(client *c) {
}
}
/* String values */
config_get_string_field
(
"logfile"
,
server
.
logfile
);
/* Numerical values */
config_get_numerical_field
(
"watchdog-period"
,
server
.
watchdog_period
);
...
...
@@ -1806,7 +1800,6 @@ int rewriteConfig(char *path, int force_write) {
rewriteConfigBindOption
(
state
);
rewriteConfigOctalOption
(
state
,
"unixsocketperm"
,
server
.
unixsocketperm
,
CONFIG_DEFAULT_UNIX_SOCKET_PERM
);
rewriteConfigStringOption
(
state
,
"logfile"
,
server
.
logfile
,
CONFIG_DEFAULT_LOGFILE
);
rewriteConfigSaveOption
(
state
);
rewriteConfigUserOption
(
state
);
rewriteConfigDirOption
(
state
);
...
...
@@ -2613,6 +2606,7 @@ standardConfig configs[] = {
createStringConfig
(
"ignore-warnings"
,
NULL
,
MODIFIABLE_CONFIG
,
ALLOW_EMPTY_STRING
,
server
.
ignore_warnings
,
""
,
NULL
,
NULL
),
createStringConfig
(
"proc-title-template"
,
NULL
,
MODIFIABLE_CONFIG
,
ALLOW_EMPTY_STRING
,
server
.
proc_title_template
,
CONFIG_DEFAULT_PROC_TITLE_TEMPLATE
,
isValidProcTitleTemplate
,
updateProcTitleTemplate
),
createStringConfig
(
"bind-source-addr"
,
NULL
,
MODIFIABLE_CONFIG
,
EMPTY_STRING_IS_NULL
,
server
.
bind_source_addr
,
NULL
,
NULL
,
NULL
),
createStringConfig
(
"logfile"
,
NULL
,
IMMUTABLE_CONFIG
,
ALLOW_EMPTY_STRING
,
server
.
logfile
,
""
,
NULL
,
NULL
),
/* SDS Configs */
createSDSConfig
(
"masterauth"
,
NULL
,
MODIFIABLE_CONFIG
|
SENSITIVE_CONFIG
,
EMPTY_STRING_IS_NULL
,
server
.
masterauth
,
NULL
,
NULL
,
NULL
),
...
...
src/server.c
View file @
b874c6f1
...
...
@@ -3150,6 +3150,7 @@ void initServerConfig(void) {
int
j
;
char
*
default_bindaddr
[
CONFIG_DEFAULT_BINDADDR_COUNT
]
=
CONFIG_DEFAULT_BINDADDR
;
initConfigValues
();
updateCachedTime
(
1
);
getRandomHexChars
(
server
.
runid
,
CONFIG_RUN_ID_SIZE
);
server
.
runid
[
CONFIG_RUN_ID_SIZE
]
=
'\0'
;
...
...
@@ -3166,7 +3167,6 @@ void initServerConfig(void) {
server
.
bindaddr_count
=
CONFIG_DEFAULT_BINDADDR_COUNT
;
for
(
j
=
0
;
j
<
CONFIG_DEFAULT_BINDADDR_COUNT
;
j
++
)
server
.
bindaddr
[
j
]
=
zstrdup
(
default_bindaddr
[
j
]);
server
.
bind_source_addr
=
NULL
;
server
.
unixsocketperm
=
CONFIG_DEFAULT_UNIX_SOCKET_PERM
;
server
.
ipfd
.
count
=
0
;
server
.
tlsfd
.
count
=
0
;
...
...
@@ -3176,7 +3176,6 @@ void initServerConfig(void) {
server
.
saveparams
=
NULL
;
server
.
loading
=
0
;
server
.
loading_rdb_used_mem
=
0
;
server
.
logfile
=
zstrdup
(
CONFIG_DEFAULT_LOGFILE
);
server
.
aof_state
=
AOF_OFF
;
server
.
aof_rewrite_base_size
=
0
;
server
.
aof_rewrite_scheduled
=
0
;
...
...
@@ -3190,7 +3189,6 @@ void initServerConfig(void) {
server
.
aof_fd
=
-
1
;
server
.
aof_selected_db
=
-
1
;
/* Make sure the first time will not match */
server
.
aof_flush_postponed_start
=
0
;
server
.
pidfile
=
NULL
;
server
.
active_defrag_running
=
0
;
server
.
notify_keyspace_events
=
0
;
server
.
blocked_clients
=
0
;
...
...
@@ -3213,7 +3211,6 @@ void initServerConfig(void) {
appendServerSaveParams
(
60
,
10000
);
/* save after 1 minute and 10000 changes */
/* Replication related */
server
.
masterauth
=
NULL
;
server
.
masterhost
=
NULL
;
server
.
masterport
=
6379
;
server
.
master
=
NULL
;
...
...
@@ -3264,14 +3261,6 @@ void initServerConfig(void) {
/* Debugging */
server
.
watchdog_period
=
0
;
/* By default we want scripts to be always replicated by effects
* (single commands executed by the script), and not by sending the
* script to the slave / AOF. This is the new way starting from
* Redis 5. However it is possible to revert it via redis.conf. */
server
.
lua_always_replicate_commands
=
1
;
initConfigValues
();
}
extern
char
**
environ
;
...
...
src/server.h
View file @
b874c6f1
...
...
@@ -113,7 +113,6 @@ typedef long long ustime_t; /* microsecond time type. */
#define CONFIG_BGSAVE_RETRY_DELAY 5
/* Wait a few secs before trying again. */
#define CONFIG_DEFAULT_PID_FILE "/var/run/redis.pid"
#define CONFIG_DEFAULT_UNIX_SOCKET_PERM 0
#define CONFIG_DEFAULT_LOGFILE ""
#define CONFIG_DEFAULT_BINDADDR_COUNT 2
#define CONFIG_DEFAULT_BINDADDR { "*", "-::*" }
#define NET_HOST_STR_LEN 256
/* Longest valid hostname */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment