Open mlazzarotto opened 1 month ago
yeah it seems the script is started well after a bunch of things that might be writing logs, probably the first one we can use to order the service is "systemd-journal-flush.service", which is the service that migrates journald's journal to disk after the startup phase where it's in RAM (as there is only RAM before disks are mounted).
This script was developed a few years ago and mostly for OpenMediaVault.
I'll have a look at this when I have some time, probably in a couple weeks. I do have a Proxmox home lab too.
If you want to try changing its startup order on your own, the systemd units starting and stopping folder2ram are
/lib/systemd/system/folder2ram_startup.service
/lib/systemd/system/folder2ram_shutdown.service
You can just edit the files with nano and add Before= or After= or whatever other systemd option to re-order the service you can find, (see the docs https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html ) and then reload the service with systemctl daemon-reload. And then you restart the Proxmox to see if it's working.
this is the current content of the startup, which as you see has a couple After= options to order it after some services (needed for openmediavault)
[Unit]
Description=folder2ram systemd service
After=local-fs.target
After=blk-availability.service
DefaultDependencies=no
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/folder2ram -mountall
$timeout_line
[Install]
WantedBy=basic.target
Hi, I've installed Folder2Ram on my Proxmox in an attempt to reduce writes on disk for some folders, including
/var/log
. My current configuration (excluding commented lines):The problem is that Folder2Ram starts and mounts the folder using tmpfs as expected, but Proxmox keeps writing logs inside
/var/folder2ram/var/log/
until the next logrotate rotates the logs. When that happens, the system switches to/var/log
.I think that the issue may be in the order of start of the systemd units. See my![systemd_plot](https://github.com/bobafetthotmail/folder2ram/assets/8932945/36087fb1-b025-4a33-89d9-67850776afd2)
systemd-analyze plot
picture.Some info:
Folder2Ram was first configured, then enabled by using
-enablesystemd
and then I rebooted the system.