Hi, I think it's working as expected, you can actually see that the directory that you have would be a mountpoint actually and not a symlink, this change was made in asd with 6.0 version to make the user experience more transparent and help with the scenarios where asd crashes and restoration introduces a time gap that leads to the applications crashing.
Cheers!
]]>So, I’m using anything-sync-daemon (asd) and I’m just wondering if it’s working as it should.
When I “ask” it if everything is going according to plan, it seems to tell me “yes”:
$ asd p
Waiting for lock...
flock: getting lock took 0.000002 seconds
flock: executing /usr/bin/asd
Anything-sync-daemon v6.0.0 on Arch Linux
Systemd service is currently active.
Systemd resync service is currently active.
Overlayfs v23 is currently active.
Asd will manage the following per /run/asd.conf settings:
owner/group id: user/1000
target to manage: /home/user/.cache/chromium
sync target: /home/user/.cache/.chromium-backup_asd
tmpfs target: /tmp/asd-user/home/user/.cache/chromium
dir size: 421M
overlayfs size: 280K
recovery dirs: 5 <- delete with the c option
dir path/size: /home/user/.cache/.chromium-backup_asd-crashrecovery-20240210_204103.tar.zstd (267M)
dir path/size: /home/user/.cache/.chromium-backup_asd-crashrecovery-20240128_121006.tar.zstd (4,0K)
dir path/size: /home/user/.cache/.chromium-backup_asd-crashrecovery-20240128_114248.tar.zstd (8,6M)
dir path/size: /home/user/.cache/.chromium-backup_asd-crashrecovery-20240116_191014.tar.zstd (298M)
dir path/size: /home/user/.cache/.chromium-backup_asd-crashrecovery-20240111_141324.tar.zstd (312M)
But if I look at the “managed” folder ( /home/user/.cache/chromium) it is still a “regular” directory, shouldn’t it rather be a symbolic link to /tmp/asd-user/home/user/.cache/chromium ?
I’m using profile-sync-daemon (psd) to achieve the same behavior with my browsers' profiles, and, in that case, the managed directories are (became) indeed symlinks to the directories in tmpfs…
Have I done something wrong or is asd working as it should ?
I would be very grateful for any advice
Cheers !
]]>I have issues with ASD. I need to use environments like Eclipse and it worked a lot faster when putting both Eclipse, WorkSpace and such in RAM (any other suggestion? I was considering to put more things like the JVM too, but this error happened). But suddenly started to fail.
I also sent this message to AUR, ARCH BBS and as an issue at the GitHub project. I finally edited it with BBCode and converted to Markdown, to avoid wasting more time. Sorry for the redundant links.
#
# /etc/asd.conf
#
# For documentation, refer to the asd man page
## WARNING Do NOT edit anything in this file while asd is running!
## To protect data from corruption, in the event that you do make an edit
## while asd is active, any changes made will be applied the next time
## you start-up asd.
# Define the target(s) directories in the WHATTOSYNC array.
# Do NOT define a file! These MUST be directories with an absolute path.
#
# Note that the target DIRECTORIES and all subdirs under them will be included.
# In other words, this is recursive.
#
# Below is an example to whet your appetite.
#WHATTOSYNC=('/srv/http' '/var/lib/monitorix' '/foo/bar')
WHATTOSYNC=('/usr/lib/eclipse' '/home/timofonic/Documents/Estudios/DAM/PRO/EclipseWorkspace/')
# Define where data will reside in tmpfs.
# This location must be mounted to tmpfs and MUST be writable and executable.
#
# If using bleachbit, do NOT invoke it with the '--clean system.tmp' switch or
# you will remove a key dot file (.foo) from /tmp that asd needs to keep track
# of sync status.
#
# Note that using a value of '/dev/shm' can cause problems with systemd's
# NAMESPACE spawning only when users enable the overlayfs option.
#
VOLATILE="/tmp"
# Uncomment and set to yes to use an overlayfs instead of a full copy to reduce
# the memory costs and to improve sync/unsync operations.
#
# You must modprobe either the 'overlayfs' or 'overlay' module prior to running asd if
# you enable this option. Distros running the linux kernel version >=3.18.0 are likely
# using the 'overlay' module while some distros shipping older kernels, notably Ubuntu
# provide the older version of this technology which is provided in the 'overlayfs'
# module not 'overlay' module.
USE_OVERLAYFS="yes"
# Uncomment and set to no to completely disable the crash recovery feature of asd.
#
# The default is to create crash recovery backups if the system is ungracefully
# powered-down due to a kernel panic, hitting the reset switch, battery going
# dead, etc. Some users keep very diligent backups and don't care to have this
# feature enabled.
USE_BACKUPS="yes"
# Uncomment and set to an integer that is the maximum number of crash recovery
# snapshots to keep (the oldest ones are delete first).
#
# The default is to save the most recent 5 crash recovery snapshots.
BACKUP_LIMIT=20
First error:
Nov 09 12:56:33 timolaptop systemd[1]: asd.service: Main process exited, code=exited, status=1/FAILURE
Nov 09 12:56:33 timolaptop systemd[1]: asd.service: Failed with result 'exit-code'.
Nov 09 12:56:33 timolaptop systemd[1]: Failed to start Anything-sync-daemon.
Nov 09 12:56:33 timolaptop systemd[1]: anbox-container-manager.service: Main process exited, code=exited, status=127
/n/a
Nov 09 12:56:33 timolaptop systemd[1]: asd-resync.service: Main process exited, code=exited, status=1/FAILURE
Nov 09 12:56:33 timolaptop systemd[1]: asd-resync.service: Failed with result 'exit-code'.
Nov 09 12:56:33 timolaptop systemd[1]: Failed to start Timed resync.
Nov 09 12:56:37 timolaptop systemd[1]: tmp.mount: Directory /tmp to mount over is not empty, mounting anyway.
Then some days later...
● asd.service - Anything-sync-daemon
Loaded: loaded (/usr/lib/systemd/system/asd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2017-11-20 08:22:58 CET; 6min ago
Docs: man:asd(1)
man:anything-sync-daemon(1)
https://wiki.archlinux.org/index.php/Anything-sync-daemon
Process: 897 ExecStart=/usr/bin/anything-sync-daemon sync (code=exited, status=1/FAILURE)
Main PID: 897 (code=exited, status=1/FAILURE)
CPU: 11ms
Nov 20 08:22:56 timolaptop systemd[897]: asd.service: Executing: /usr/bin/anything-sync-daemon sync
Nov 20 08:22:57 timolaptop anything-sync-daemon[897]: /tmp is not tmpsfs so running asd is pointless. Aborting.
Nov 20 08:22:58 timolaptop systemd[1]: asd.service: Child 897 belongs to asd.service
Nov 20 08:22:58 timolaptop systemd[1]: asd.service: Main process exited, code=exited, status=1/FAILURE
Nov 20 08:22:58 timolaptop systemd[1]: asd.service: Failed with result 'exit-code'.
Nov 20 08:22:58 timolaptop systemd[1]: asd.service: Changed start -> failed
Nov 20 08:22:58 timolaptop systemd[1]: asd.service: Job asd.service/start finished, result=failed
Nov 20 08:22:58 timolaptop systemd[1]: Failed to start Anything-sync-daemon.
Nov 20 08:22:58 timolaptop systemd[1]: asd.service: Unit entered failed state.
Nov 20 08:22:58 timolaptop systemd[1]: asd.service: Consumed 11ms CPU time
Here is my entire mount output, tmp seems mounted as tmpfs...
mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,size=3780952k,nr_inodes=945238,mode=75
5)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relat
ime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmod
e=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (rw,mode=755)
cgroup on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,n
sdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xa
ttr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,rela
time)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,re
latime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpu
set)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,de
vices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,fr
eezer)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatim
e,cpu,cpuacct)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime
,perf_event)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blki
o)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,mem
ory)
/dev/sdb7 on / type ext4 (rw,relatime,data=ordered)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=40,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
systemd-1 on /mnt/windoze type autofs (rw,relatime,fd=44,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
systemd-1 on /mnt/peque type autofs (rw,relatime,fd=46,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
systemd-1 on /home type autofs (rw,relatime,fd=47,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
none on /sys/kernel/debug type debugfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
/dev/sdb2 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/sdb8 on /home type ext4 (rw,relatime,data=ordered,x-systemd.automount)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=758232k,mode=700,uid=1000,gid=100)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)
/dev/sda1 on /mnt/peque type ext4 (rw,relatime,data=ordered,x-systemd.automount)
ASD uses two daemons, one to sync. I didn't remember it. Here's the output of "systemctl status asd-resync" status log.
● asd-resync.service - Timed resync
Loaded: loaded (/usr/lib/systemd/system/asd-resync.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Wed 2017-11-22 08:30:06 CET; 4min 7s ago
Docs: man:asd(1)
man:anything-sync-daemon(1)
https://wiki.archlinux.org/index.php/Anything-sync-daemon
Process: 7312 ExecStart=/usr/bin/anything-sync-daemon resync (code=exited, status=0/SUCCESS)
Main PID: 7312 (code=exited, status=0/SUCCESS)
CPU: 3.994s
Nov 22 08:30:00 timolaptop systemd[1]: Starting Timed resync...
Nov 22 08:30:00 timolaptop systemd[7312]: asd-resync.service: Executing: /usr/bin/anything-sync-daemon resync
Nov 22 08:30:06 timolaptop anything-sync-daemon[7312]: Sync successful
Nov 22 08:30:06 timolaptop systemd[1]: asd-resync.service: cgroup is empty
Nov 22 08:30:06 timolaptop systemd[1]: asd-resync.service: Child 7312 belongs to asd-resync.service
Nov 22 08:30:06 timolaptop systemd[1]: asd-resync.service: Main process exited, code=exited, status=0/SUCCESS
Nov 22 08:30:06 timolaptop systemd[1]: asd-resync.service: Changed start -> dead
Nov 22 08:30:06 timolaptop systemd[1]: asd-resync.service: Job asd-resync.service/start finished, result=done
Nov 22 08:30:06 timolaptop systemd[1]: Started Timed resync.
Nov 22 08:30:06 timolaptop systemd[1]: asd-resync.service: Consumed 3.994s CPU time
I used "systemctl status asd" again and this is the output:
asd.service - Anything-sync-daemon
Loaded: loaded (/usr/lib/systemd/system/asd.service; enabled; vendor preset: disabled)
Active: active (exited) since Wed 2017-11-22 08:30:00 CET; 14min ago
Docs: man:asd(1)
man:anything-sync-daemon(1)
https://wiki.archlinux.org/index.php/Anything-sync-daemon
Process: 894 ExecStart=/usr/bin/anything-sync-daemon sync (code=exited, status=0/SUCCESS)
Main PID: 894 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 4915)
Memory: 0B
CPU: 0
CGroup: /system.slice/asd.service
Nov 22 08:25:21 timolaptop systemd[894]: asd.service: Executing: /usr/bin/anything-sync-daemon sync
Nov 22 08:26:11 timolaptop anything-sync-daemon[894]: Ungraceful state detected for /usr/lib/eclipse so fixing
Nov 22 08:26:42 timolaptop anything-sync-daemon[894]: Ungraceful state detected for /home/timofonic/Documents/Estudios/DAM/PRO/EclipseWorkspace s
Nov 22 08:26:51 timolaptop anything-sync-daemon[894]: Sync successful
Nov 22 08:30:00 timolaptop systemd[1]: asd.service: cgroup is empty
Nov 22 08:30:00 timolaptop systemd[1]: asd.service: Child 894 belongs to asd.service
Nov 22 08:30:00 timolaptop systemd[1]: asd.service: Main process exited, code=exited, status=0/SUCCESS
Nov 22 08:30:00 timolaptop systemd[1]: asd.service: Changed start -> exited
Nov 22 08:30:00 timolaptop systemd[1]: asd.service: Job asd.service/start finished, result=done
Nov 22 08:30:00 timolaptop systemd[1]: Started Anything-sync-daemon.
Mysteriously, now ASD works! But Eclipse gave me this error message...
As you can see in the following screenshot, Eclipse is aware of symlinks used in the environment. Might that be part of the issue?
What about using directory binding or any other way? I found some ASD forks and attempted to merge them (I found their features quite interesting), but I have yet not tested the code and not time for it due to exams.
Whats happening? I have no idea. Can someone help me?
Thanks in advance!
PS: I did a humble quick & dirty unfork from others of your great project. I'm sure it's full of faults (I'm struggling to learn computer programming), but some implemented ideas were interesting. I have no time to test it, just played a bit with the code. I'm sorry for the aberrations (too stupid errors, etc) in the code.
]]>For example:
File that is updated every minute: /var/log/syslog
asd.conf:
WHATTOSYNC=('/var/log')
VOLATILE="/dev/shm"
USE_OVERLAYFS="yes"
Output of `inotifywait -m -r -e modify,close_write /var` every minute:
/var/log/.log-backup_asd MODIFY syslog
PS: i am running debian 9 (with overlayfs and systemd)
]]>Before=getty@tty1.service getty@tty2.service getty@tty3.service getty@tty4.service getty@tty5.service getty@tty6.service
to asd.service would probably help, but is this the proper way to achieve this or am I overlooking something?
]]>I have some suggestions if they're not too hard to implement:
1. Add a user systemd service that can be run with systemctl --user start asd (a bit like psd)
2. Add an option to only start/stop specific mounts. ie: systemctl start asd@varlog
[Unit]
Description=Google-disk
Documentation=https://github.com/vitalif/grive2/
After=asd.service
[Service]
Type=simple
ExecStart=/usr/bin/grive -p /home/lpp/gdrive
[Install]
Alias=default.target
Is the After=asd.service enough to ensure that all symbolic links are set up and that are no race conditions in the system?
]]>Does asd copies everything from sync targets to tmpfs or only on first usage? I'm asking because I might mount ~8GB folder into asd and pulling everything would be trashing my own PC for no good reason. The folder in question is my google-drive-ocamlfuse and I'd like to be able to move fast on it and not wait too much for sync with google servers.
]]>error: failed to commit transaction (conflicting files)
roundcubemail: /var/log exists in filesystem
Errors occurred, no packages were upgraded.
stat ~/scratch
File: ‘/home/hoangngan/scratch’ -> ‘/tmp/asd-hoangngan/home/hoangngan/scratch’
Size: 41 Blocks: 0 IO Block: 4096 symbolic link
Device: 812h/2066d Inode: 18223630 Links: 1
Access: (0777/lrwxrwxrwx) Uid: ( 1000/hoangngan) Gid: ( 1000/hoangngan)
Access: 2015-11-14 10:09:12.199981254 -0800
Modify: 2015-11-14 10:09:12.196647921 -0800
Change: 2015-11-14 10:09:12.196647921 -0800
Birth: -
stat ~/scratch/
File: ‘.’
Size: 60 Blocks: 0 IO Block: 4096 directory
Device: 2ah/42d Inode: 339582 Links: 1
Access: (0755/drwxr-xr-x) Uid: ( 1000/hoangngan) Gid: ( 1000/hoangngan)
Access: 2015-11-14 10:09:43.606647636 -0800
Modify: 2015-11-14 10:09:12.193314587 -0800
Change: 2015-11-14 10:09:12.199981254 -0800
Birth: -
and
df -h
tmpfs 786M 151M 635M 20% /run/user/1000
overlaid 786M 151M 635M 20% /run/user/1000/hoangngan-firefox-4ze2rv7s.default
overlaid 3.9G 913M 3.0G 24% /tmp/asd-hoangngan/home/hoangngan/.config
overlaid 3.9G 913M 3.0G 24% /tmp/asd-hoangngan/home/hoangngan/scratch