Hi Michael, all
First, this mail does not contain critique, I'm only trying to learn, if I'm wrong. But I think your remark about fixing hardware is not correct?
In my understanding, sync synchronizes the not-yet-written data currently in kernel managed cache memory (hence in volatile system memory) to permanent storage. Normally storage hardware also has its own cache, which I presume you are referring to, but I don't think sync cares or even knows about that and that is/should be handled within the hardware itself. As soon as storage hardware returns an ACK on a write operation, sync is happy. Not actually guaranteeing any physical write, only that all to-be-written data is actually delivered to the storage hardware.
I do agree that a (full) sync there is probably overkill. The content of the config will be available to the collectd daemon whether it is actually written on disk or still in cache, so no sync needed. If the server crashes/powercycles/... on that point, I think a possible commented line that should be uncommented in that config is then probably of the least concern. On the other hand, a sync that blocks forever, is probably more of an indicator that the hardware should be fixed, as this would mean sync doesn't get all the ACK's it expects.
Please correct me if I'm wrong.
Regards Robin
Michael Tremer schreef op di 30-01-2024 om 18:01 [+0000]:
Calling a global sync operation manually is generally a bad idea as it can block for forever. If people have storage that does not retain anything that is being written to it, they need to fix their hardware.
Signed-off-by: Michael Tremer michael.tremer@ipfire.org
src/initscripts/system/collectd | 3 --- 1 file changed, 3 deletions(-)
diff --git a/src/initscripts/system/collectd b/src/initscripts/system/collectd index bb8a2f54f..56b799d56 100644 --- a/src/initscripts/system/collectd +++ b/src/initscripts/system/collectd @@ -146,9 +146,6 @@ case "$1" in sed -i -e "s|^#LoadPlugin swap|LoadPlugin swap|g" /etc/collectd.conf fi
# sync after config update...
sync
if [ $(date +%Y) -gt 2011 ]; then boot_mesg "Starting Collection daemon..." /usr/sbin/collectd -C /etc/collectd.conf -- 2.39.2