graysky2 / anything-sync-daemon

Symlinks and syncs user specified dirs to RAM thus reducing HDD/SDD calls and speeding-up the system.
https://wiki.archlinux.org/index.php/Anything-sync-daemon
MIT License
345 stars 45 forks source link

WHATTOSYNC /var/log syncs /var/log/log instead #52

Closed peterpepo closed 2 years ago

peterpepo commented 6 years ago

Hello, first of all, I would like to say HUGE thank you! I've started with raspberry pi just recently and was very please, finding this tool.

I'm having some problems though. I'm running raspbian stretch. To preserve my SD card, I did following:

/etc/fstab

proc                  /proc           proc    defaults          0       0
PARTUUID=206c7db9-01  /boot           vfat    defaults          0       2
PARTUUID=206c7db9-02  /               ext4    defaults,noatime  0       1
#Directories in ram
tmpfs                 /rdisk          tmpfs    nodev,nosuid,size=50M 0 0

/etc/asd.conf

WHATTOSYNC=('/var/log' '/var/tmp' '/home/pi/.homeassistant/database')
VOLATILE="/rdisk"

asd p

Anything-sync-daemon v5.85 on Raspbian GNU/Linux 9 (stretch)

 Systemd service is currently active.
 Systemd resync service is currently active.
 Overlayfs technology is currently inactive.

Asd will manage the following per /run/asd.conf settings:

 owner/group id:     root/0
 target to manage:   /var/log
 sync target:        /var/.log-backup_asd
 tmpfs target:       /rdisk/asd-root/var/log
 dir size:           2.4M
 recovery dirs:      5 <- delete with the c option
  dir path/size:     /var/.log-backup_asd-crashrecovery-20180120_123416 (1.5M)
  dir path/size:     /var/.log-backup_asd-crashrecovery-20180120_122307 (1.5M)
  dir path/size:     /var/.log-backup_asd-crashrecovery-20180120_122112 (1.5M)
  dir path/size:     /var/.log-backup_asd-crashrecovery-20180120_120742 (1.5M)
  dir path/size:     /var/.log-backup_asd-crashrecovery-20180120_120250 (1.5M)

 owner/group id:     root/0
 target to manage:   /var/tmp
 sync target:        /var/.tmp-backup_asd
 tmpfs target:       /rdisk/asd-root/var/tmp
 dir size:           0
 recovery dirs:      5 <- delete with the c option
  dir path/size:     /var/.log-backup_asd-crashrecovery-20180120_123416 (1.5M)
  dir path/size:     /var/.log-backup_asd-crashrecovery-20180120_122307 (1.5M)
  dir path/size:     /var/.log-backup_asd-crashrecovery-20180120_122112 (1.5M)
  dir path/size:     /var/.log-backup_asd-crashrecovery-20180120_120742 (1.5M)
  dir path/size:     /var/.log-backup_asd-crashrecovery-20180120_120250 (1.5M)

 owner/group id:     pi/1000
 target to manage:   /home/pi/.homeassistant/database
 sync target:        /home/pi/.homeassistant/.database-backup_asd
 tmpfs target:       /rdisk/asd-pi/home/pi/.homeassistant/database
 dir size:           328K
 recovery dirs:      none

The problem is, that symlink to /var/log isn't created. When I cd into /var

drwxr-xr-x  5 root root       4096 Jan 20 12:02 log
lrwxrwxrwx  1 root root         23 Jan 20 12:34 tmp -> /rdisk/asd-root/var/tmp

It works for /var/tmp, /home/pi/.homeassistant/database but not for the /var/log. There's symlink for /var/log/log instead /var/log

pi@raspberrypi:/var/log $ ls -l
lrwxrwxrwx 1 root      root          23 Jan 20 12:02 log -> /rdisk/asd-root/var/log

Please could you help me to find what the problem is, or is this a bug?

graysky2 commented 6 years ago

I haven't revisited syncing /var/log in a while... recommend you don't do it. Systemd needs access to that before other services including asd are started.

TheAntimist commented 6 years ago

I got the same issue on this, on the same platform i.e. Rasbian Stretch, any updates why?

EDIT: Mine seems to be related to profile-sync-daemon#178