[11:45] <Hamidreza> Hi guys, I'm runnig following command for rsync but it doesnt work:
[11:45] <Hamidreza> sudo rsync --daemon salam.txt test@192.168.200.18::/tmp/test --config=/etc/rsyncd.conf
[11:45] <Hamidreza> cat /etc/rsyncd.conf
[11:45] <Hamidreza> [share]
[11:45] <Hamidreza> path = /tmp/test
[11:45] <Hamidreza> #password-file=/root/secret
[11:45] <Hamidreza> secrets file = /root/secret
[12:16] <RoyK> why do you want rsync as a daemon? by default it uses ssh for transport and authentication
[12:31] <de-facto> Question: how can i find out why an NFS share as client (mounted via /etc/fstab) went offline? Its fixable wtih "mount -a"
[13:53] <de-facto> are there any logs about NFS errors anywhere on ubuntu?
[13:54] <RoyK> de-facto: check dmesg -T
[13:54] <de-facto> already did that
[13:54] <RoyK> don't know any other logs - nfs isn't very verbose - at least by default
[13:54] <de-facto> and journalctl
[13:55] <de-facto> yeah i noticed that, could not find any useful information about it failing yet
[13:55] <RoyK> which mount options did you use for the client? normally it should reconnect automatically
[13:56] <de-facto> in /etc/fstab "111.222.333.444:/media/DATA/web         /var/www/html/web         nfs    bg,rw,nfsvers=3,rsize=8192,wsize=8192      0 0"
[13:57] <de-facto> was not setup by me but i have to fix it
[13:58] <de-facto> server is a QNAP
[13:58] <RoyK> iirc those rsize/wsize flags aren't needed anymore, but it all looks normal to me
[13:58] <RoyK> perhaps apart from nfs3, but that's your choice ;)
[13:59] <de-facto> it just goes offline without any logs and a "mount -a" fixes that
[13:59] <RoyK> strange
[13:59] <RoyK> anything on the server?
[13:59] <de-facto> i could out that in a systemd timer but thats an ugly hack
[13:59] <de-facto> id rather find out the problem and fix that
[14:00] <RoyK> login to the qnap and check the logs
[14:00] <de-facto> i dont have any access to it
[14:00] <RoyK> oh
[14:01] <de-facto> yeah its a mess, i probably will migrate it to cifs and throw that qnap in the garbage, but for now it has to be fixed
[14:01] <de-facto> because a whole website goes offline if that happens again
[14:01] <RoyK> you haven't specified hard or soft, but hard is default, or at least here, which should reconnect automatically
[14:02] <de-facto> how does your fstab line for such a case look like?
[14:02] <RoyK> check /proc/mounts - it should list all the flags used
[14:02] <RoyK> just paste the nfs line, please
[14:02] <de-facto> one moment
[14:05] <de-facto> 111.222.333.444:/media/DATA/web /var/www/SAI/web nfs rw,relatime,vers=3,rsize=8192,wsize=8192,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=111.222.333.444,mountvers=3,mountport=892,mountproto=udp,local_lock=none,addr=111.222.333.444 0 0
[14:06] <RoyK> see man nfs for retrans - it should log somewhere
[14:06] <oerheks> i would mount nfs in /mnt/  and keep /media/ for autoremove devices
[14:07] <RoyK> good point
[14:07] <RoyK> but hey, it's /var/www/something - shouldn't matter
[14:08] <RoyK> it's a nice way to keep things tidy without having to symlink or anything
[14:08] <de-facto> yeah not my design there, i have to fix the problem though
[14:08] <RoyK> also - apache doesn't like symlinks unless you force it to
[14:08] <oerheks> use nfswatch on the host
[14:08] <RoyK> de-facto: I'd do it that way
[14:08] <shibboleth> +followsymlinks
[14:09] <RoyK> oerheks: he doesn't have access to the host
[14:09] <de-facto> RoyK, you mean that config is fine like this?
[14:09] <shibboleth> +followsymlinksifownermatches or something, even better
[14:09] <RoyK> shibboleth: sure, but mounting the fs in the right place is clean
[14:09] <RoyK> de-facto: looks fine to me, except rsize and wsize, which I don't think is needed anymore
[14:10] <shibboleth> oh, don't mind me, i just entered this clubhouse :P
[14:10] <de-facto> ok so even with the rsize and wsize it should not disconnect, is it supposed to autoreconnect like this?
[14:10] <shibboleth> "how about... irc, but vocal?" <--- insert "wow"-clip from bill and teds excellent adventure
[14:10] <de-facto> or should i really install a cronjob with "mount -a" in it?
[14:11] <RoyK> de-facto: rsize/wsize isn't really relevant here
[14:11] <de-facto> eah
[14:11] <RoyK> de-facto: probably find the error ;)
[14:11] <shibboleth> de-facto, or a... systemd unit?
[14:11] <RoyK> try to grep through /var/log for nfs errors
[14:11] <de-facto> yeah or that, its not a fix though it just raises the probability that my inbox keeps free of this :P
[14:11] <RoyK> shibboleth: nfs should handle that itself
[14:12] <de-facto> i already grep in dmesg syslog kernlog journalctl
[14:12] <de-facto> nothing about nfs there
[14:12] <RoyK> mount.nfs even has a flag for umounting locked nfs mounts, -l, --lazy
[14:13] <de-facto> not sure what you mean by that
[14:14] <RoyK> normally, if you have an nfs client mounting something on a host and the host dies, that share will stay dormant/defunct forever
[14:15] <RoyK> the only thing I've seen disconnecting such a thing is if some other machine steals that ip address and thus signals back with 'this isn't allowed'
[14:15] <RoyK> but that should most certainly be logged
[14:15] <de-facto> so you think the qnap got a hickup and locked the share?
[14:16] <de-facto> as i said "mount -a" immediately silently fixed it
[14:16] <de-facto> the mount point was just empty before that
[14:17] <RoyK> I doubt the qnap could do this, since nfs client normally just tries on forever, that is, unless the qnap was rebooted and didn't start nfs quickly enough for the client to reconnect
[14:17] <de-facto> i think it was offline for half an hour or such
[14:18] <de-facto> or the mount point empty at least, not sure about the qnap, i dont have any access to it
[14:18] <RoyK> then my guess is that it didn't manage to start the nfs server quickly enough or something, but again, then you should see it in dmesg
[14:19] <RoyK> that's a long downtime, though
[14:19] <de-facto> what would i be looking for in dmesg? i tried searching for "nfs" or "NFS" or that ip address or "mount"
[14:19] <RoyK> at least if it was daylight
[14:19] <RoyK> just run 'dmesg -T' as root and you'll get the latest stuff - it shouldn't be too much unless you have ufw or something similar spamming it
[14:22] <de-facto> yeah unfortunately its full of ufw spam
[14:23] <de-facto> dmesg -T | grep -v UFW | grep nfs only gives "FS-Cache: Netfs 'nfs' registered for caching" a day ago though
[14:23] <de-facto> thats what i mean NFS not providing any useful info
[14:24] <RoyK> ufw logging off ;)
[14:24] <RoyK> unlelss you really need them
[14:24] <RoyK> there was an attempt to have ufw do userspace logging, but I have no idea how that went
[14:25] <RoyK> that is - it's not ufw doing the logging, it's netfilter, kernel, which imho isn't a good idea for such large amounts of logs
[14:25] <de-facto> yeah if it was me i would not have installed ufw on there but oh well
[14:26] <de-facto> anhow i guess then the only option is to to a "mount -a" ever few minutes
[14:26] <de-facto> i dont see an opportunity where to get useful info from NFS about this
[14:27] <RoyK> or even better - create a script to check if it is mounted and if not, mount it
[14:28] <RoyK> something like "if $( cat /proc/mounts | grep /var/www/html/web > /dev/null 2>&1 ) ; then echo mounted ; else echo nope, not mounted ; fi"
[14:29] <RoyK> then just replace echo ... with something logging it was remounted (man logger) and then remounting it
[14:29] <de-facto> but "mount -a" would not hurt i guess since it only mounts stuff that is not already mounted right?
[14:30] <RoyK> it'll mask other potential problems and if you by chance should want to umount an fs to check it or otherwise, it'll remount it
[14:30] <de-facto> fair point
[14:31] <de-facto> maybe i put a list of automount filesystems in /etc/default/remount or such and use that from a systemd service with a timer
[14:31] <RoyK> should work
[14:32] <de-facto> i dont feel particularly good about it because it ignores the cause of that problem but i have to put something in place to mitigate it when i am not ehre
[14:33] <RoyK> without access to the qnap thing, well
[14:34] <de-facto> i will suggest to throw that in the garbage in the long term, it only causes a lot of problems (other than this)
[14:35] <RoyK> quite possibly a good idea ;)
[14:36] <RoyK> if you can afford something better, good, otherwise, if you have sufficient bandwidth, perhaps cloud storage, if you trust them, that is
[14:36] <de-facto> i was thinking about putting that website stuff on the active directory for them to update stuff and just mount it via cifs in the linux box
[14:38] <RoyK> AD is a catalog service, not storage, but good for use with accessing linux machines from windoze machines
[14:38] <de-facto> yeah windows and mac clients and the ad managing the credentials for an SMB share
[14:39] <RoyK> that works well
[14:39] <de-facto> yeah and someone else responsible for incremental backups :P
[14:52] <RoyK> de-facto: yes, make sure you have good backups. I guess we all have failed on that at some point