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

multiple sync in parallel #50

Closed kealthou closed 2 years ago

kealthou commented 7 years ago

systemctl start asd starts asd.service and asd-resync.service at the same time, which run anything-sync-daemon sync and anything-sync-daemon resync respectively, and causes 2 simultaneous sync.

When doing systemctl restart asd, anything-sync-daemon unsync, which also does sync before doing unsync, joins the group, so it leads to 3 sync in parallel.

john-x commented 4 years ago

I've noticed this too. When I stop asd.service, add a new entry to asd.conf, and restart it, it seems to lock up and never finish.

CGroup: /system.slice/asd.service
           ├─ 413 /bin/bash /usr/bin/anything-sync-daemon sync
           ├─2799 rsync -aogX --inplace --no-whole-file /home/username/.config/mpv/.watch_later-backup_asd/ /www/cache/asd-username/home/username/.config/mpv/watch_later/
           ├─2800 rsync -aogX --inplace --no-whole-file /home/username/.config/mpv/.watch_later-backup_asd/ /www/cache/asd-username/home/username/.config/mpv/watch_later/
           └─2801 rsync -aogX --inplace --no-whole-file /home/username/.config/mpv/.watch_later-backup_asd/ /www/cache/asd-username/home/username/.config/mpv/watch_later/

Is there any way to work around this?