/var/log on tmpfs - openhab2 directory issue

I also faced with such problem and found the following solution:

When mounting ‘/var/log’ as ‘tmpfs’, you need to edit the below file, to add all the files/directories your current services need to find.

/usr/lib/tmpfiles.d/var.conf

For example, I added nginx, mosquitto, openhab2, etc log directories as below:

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

# See tmpfiles.d(5) for details

q /var 0755 - - -

L /var/run - - - - ../run

d /var/log 0755 - - -
f /var/log/wtmp 0664 root utmp -
f /var/log/btmp 0600 root utmp -

d /var/cache 0755 - - -

d /var/lib 0755 - - -

d /var/spool 0755 - - -

d /var/log/apt 0755 root root -
d /var/log/letsencrypt 0700 root root -
d /var/log/mosquitto 0757 root root -
d /var/log/nginx 0757 root root -
d /var/log/openhab2 0757 root root -
d /var/log/nginx 0757 root root -
d /var/log/samba 0750 root root -
1 Like