From: Teemu Toivola Date: Mon, 13 May 2019 17:46:15 +0000 (+0300) Subject: rename configuration option WriteAheadLoggingDatabase -> DatabaseWriteAheadLogging... X-Git-Tag: v2.3~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f79f2a16f41e60c82d341d32b2671384dc8e563;p=vnstat rename configuration option WriteAheadLoggingDatabase -> DatabaseWriteAheadLogging in order to have a more consistent prefix with those options that control SQLite pragmas --- diff --git a/CHANGES b/CHANGES index 4e47643..87454de 100644 --- a/CHANGES +++ b/CHANGES @@ -7,7 +7,7 @@ if the used systemd version supported ProtectSystem=strict but didn't support StateDirectory (issue seen at least with systemd 232 in Debian 9) - New - - Add configuration option WriteAheadLoggingDatabase to enable SQLite + - Add configuration option DatabaseWriteAheadLogging to enable SQLite Write-Ahead Logging mode which may provide some disk i/o benefits, see https://www.sqlite.org/wal.html for more details and note that SQLite 3.22.0 or later is required to support read-only operations diff --git a/UPGRADE.md b/UPGRADE.md index c4448db..df3c373 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,7 +1,7 @@ # New configuration settings - * 2.3: WriteAheadLoggingDatabase, DatabaseSynchronous + * 2.3: DatabaseWriteAheadLogging, DatabaseSynchronous * 2.2: 64bitInterfaceCounters diff --git a/cfg/vnstat.conf b/cfg/vnstat.conf index 72bd8bc..224d715 100644 --- a/cfg/vnstat.conf +++ b/cfg/vnstat.conf @@ -149,7 +149,7 @@ PidFile "/var/run/vnstat/vnstat.pid" 64bitInterfaceCounters -2 # use SQLite Write-Ahead Logging mode (1 = enabled, 0 = disabled) -WriteAheadLoggingDatabase 0 +DatabaseWriteAheadLogging 0 # change the setting of the SQLite "synchronous" flag # (-1 = auto, 0 = off, 1, = normal, 2 = full, 3 = extra) diff --git a/man/vnstat.conf.5 b/man/vnstat.conf.5 index 50f5ec4..5f05985 100644 --- a/man/vnstat.conf.5 +++ b/man/vnstat.conf.5 @@ -220,10 +220,16 @@ the database before continuing other actions. Higher values take extra steps to ensure data safety at the cost of slower performance. A value of 0 will result in all handling being left to the filesystem itself. Set to -1 to select the default value according to database mode controlled by -.B WriteAheadLoggingDatabase +.B DatabaseWriteAheadLogging setting. See SQLite documentation for more details regarding values from 1 to 3. Value range: -1..3 +.TP +.B DatabaseWriteAheadLogging +Enable or disable SQLite Write-Ahead Logging mode for the database. See SQLite +documentation for more details and note that support for read-only operations +isn't available in older versions. 1 = enabled, 0 = disabled. + .TP .B HourlyDays Data retention duration for the one hour resolution entries. The configuration @@ -348,12 +354,6 @@ defines for how many past years entries will be stored. Set to -1 for unlimited entries or to 0 to disable the data collection of this resolution. -.TP -.B WriteAheadLoggingDatabase -Enable or disable SQLite Write-Ahead Logging mode for the database. See SQLite -documentation for more details and note that support for read-only operations -isn't available in older versions. 1 = enabled, 0 = disabled. - .SH IMAGE OUTPUT RELATED KEYWORDS .TP diff --git a/src/cfg.c b/src/cfg.c index 9a4d161..1a8ac16 100644 --- a/src/cfg.c +++ b/src/cfg.c @@ -64,7 +64,7 @@ int loadcfg(const char *cfgfile) {"LogFile", cfg.logfile, 0, 512, 0}, {"PidFile", cfg.pidfile, 0, 512, 0}, {"64bitInterfaceCounters", 0, &cfg.is64bit, 0, 0}, - {"WriteAheadLoggingDatabase", 0, &cfg.waldb, 0, 0}, + {"DatabaseWriteAheadLogging", 0, &cfg.waldb, 0, 0}, {"DatabaseSynchronous", 0, &cfg.dbsynchronous, 0, 0}, {"HeaderFormat", cfg.hformat, 0, 64, 0}, {"HourlyRate", 0, &cfg.hourlyrate, 0, 0}, @@ -192,7 +192,7 @@ void validatecfg(void) validateint("CreateDirs", &cfg.createdirs, CREATEDIRS, 0, 2); validateint("UpdateFileOwner", &cfg.updatefileowner, UPDATEFILEOWNER, 0, 2); validateint("64bitInterfaceCounters", &cfg.is64bit, IS64BIT, -2, 1); - validatebool("WriteAheadLoggingDatabase", &cfg.waldb, WALDB); + validatebool("DatabaseWriteAheadLogging", &cfg.waldb, WALDB); validateint("DatabaseSynchronous", &cfg.dbsynchronous, DBSYNCHRONOUS, -1, 3); validatebool("TransparentBg", &cfg.transbg, TRANSBG); validatebool("HourlyRate", &cfg.hourlyrate, HOURLYRATE); diff --git a/src/cfgoutput.c b/src/cfgoutput.c index e6dce2a..ad68225 100644 --- a/src/cfgoutput.c +++ b/src/cfgoutput.c @@ -164,7 +164,7 @@ void printcfgfile(void) printf("64bitInterfaceCounters %d\n\n", cfg.is64bit); printf("# use SQLite Write-Ahead Logging mode (1 = enabled, 0 = disabled)\n"); - printf("WriteAheadLoggingDatabase %d\n\n", cfg.waldb); + printf("DatabaseWriteAheadLogging %d\n\n", cfg.waldb); printf("# change the setting of the SQLite \"synchronous\" flag\n"); printf("# (-1 = auto, 0 = off, 1, = normal, 2 = full, 3 = extra)\n"); diff --git a/src/vnstatd.c b/src/vnstatd.c index b2451d5..cbf65da 100644 --- a/src/vnstatd.c +++ b/src/vnstatd.c @@ -208,7 +208,7 @@ int main(int argc, char *argv[]) #if !HAVE_DECL_SQLITE_CHECKPOINT_RESTART if (cfg.waldb) { - snprintf(errorstring, 1024, "WriteAheadLoggingDatabase is enabled but used libsqlite3 does not support it"); + snprintf(errorstring, 1024, "DatabaseWriteAheadLogging is enabled but used libsqlite3 does not support it"); printe(PT_Warning); } #endif