/srv/irclogs.ubuntu.com/2021/03/02/#ubuntu-server.txt

=== vlm_ is now known as vlm
=== lotuspsychje_ is now known as lotuspsychje
HamidrezaHi guys, I'm runnig following command for rsync but it doesnt work:11:45
Hamidrezasudo rsync --daemon salam.txt test@192.168.200.18::/tmp/test --config=/etc/rsyncd.conf11:45
Hamidrezacat /etc/rsyncd.conf11:45
Hamidreza[share]11:45
Hamidrezapath = /tmp/test11:45
Hamidreza#password-file=/root/secret11:45
Hamidrezasecrets file = /root/secret11:45
RoyKwhy do you want rsync as a daemon? by default it uses ssh for transport and authentication12:16
de-factoQuestion: how can i find out why an NFS share as client (mounted via /etc/fstab) went offline? Its fixable wtih "mount -a"12:31
de-factoare there any logs about NFS errors anywhere on ubuntu?13:53
RoyKde-facto: check dmesg -T13:54
de-factoalready did that13:54
RoyKdon't know any other logs - nfs isn't very verbose - at least by default13:54
de-factoand journalctl13:54
de-factoyeah i noticed that, could not find any useful information about it failing yet13:55
RoyKwhich mount options did you use for the client? normally it should reconnect automatically13:55
de-factoin /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:56
de-factowas not setup by me but i have to fix it13:57
de-factoserver is a QNAP13:58
RoyKiirc those rsize/wsize flags aren't needed anymore, but it all looks normal to me13:58
RoyKperhaps apart from nfs3, but that's your choice ;)13:58
de-factoit just goes offline without any logs and a "mount -a" fixes that13:59
RoyKstrange13:59
RoyKanything on the server?13:59
de-factoi could out that in a systemd timer but thats an ugly hack13:59
de-factoid rather find out the problem and fix that13:59
RoyKlogin to the qnap and check the logs14:00
de-factoi dont have any access to it14:00
RoyKoh14:00
de-factoyeah its a mess, i probably will migrate it to cifs and throw that qnap in the garbage, but for now it has to be fixed14:01
de-factobecause a whole website goes offline if that happens again14:01
RoyKyou haven't specified hard or soft, but hard is default, or at least here, which should reconnect automatically14:01
de-factohow does your fstab line for such a case look like?14:02
RoyKcheck /proc/mounts - it should list all the flags used14:02
RoyKjust paste the nfs line, please14:02
de-factoone moment14:02
de-facto111.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 014:05
RoyKsee man nfs for retrans - it should log somewhere14:06
oerheksi would mount nfs in /mnt/  and keep /media/ for autoremove devices14:06
RoyKgood point14:07
RoyKbut hey, it's /var/www/something - shouldn't matter14:07
RoyKit's a nice way to keep things tidy without having to symlink or anything14:08
de-factoyeah not my design there, i have to fix the problem though14:08
RoyKalso - apache doesn't like symlinks unless you force it to14:08
oerheksuse nfswatch on the host14:08
RoyKde-facto: I'd do it that way14:08
shibboleth+followsymlinks14:08
RoyKoerheks: he doesn't have access to the host14:09
de-factoRoyK, you mean that config is fine like this?14:09
shibboleth+followsymlinksifownermatches or something, even better14:09
RoyKshibboleth: sure, but mounting the fs in the right place is clean14:09
RoyKde-facto: looks fine to me, except rsize and wsize, which I don't think is needed anymore14:09
shibbolethoh, don't mind me, i just entered this clubhouse :P14:10
de-factook 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 adventure14:10
de-factoor should i really install a cronjob with "mount -a" in it?14:10
RoyKde-facto: rsize/wsize isn't really relevant here14:11
de-factoeah14:11
RoyKde-facto: probably find the error ;)14:11
shibbolethde-facto, or a... systemd unit?14:11
RoyKtry to grep through /var/log for nfs errors14:11
de-factoyeah or that, its not a fix though it just raises the probability that my inbox keeps free of this :P14:11
RoyKshibboleth: nfs should handle that itself14:11
de-factoi already grep in dmesg syslog kernlog journalctl14:12
de-factonothing about nfs there14:12
RoyKmount.nfs even has a flag for umounting locked nfs mounts, -l, --lazy14:12
de-factonot sure what you mean by that14:13
RoyKnormally, if you have an nfs client mounting something on a host and the host dies, that share will stay dormant/defunct forever14:14
RoyKthe 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
RoyKbut that should most certainly be logged14:15
de-factoso you think the qnap got a hickup and locked the share?14:15
de-factoas i said "mount -a" immediately silently fixed it14:16
de-factothe mount point was just empty before that14:16
RoyKI 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 reconnect14:17
de-factoi think it was offline for half an hour or such14:17
de-factoor the mount point empty at least, not sure about the qnap, i dont have any access to it14:18
RoyKthen 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 dmesg14:18
RoyKthat's a long downtime, though14:19
de-factowhat would i be looking for in dmesg? i tried searching for "nfs" or "NFS" or that ip address or "mount"14:19
RoyKat least if it was daylight14:19
RoyKjust 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 it14:19
de-factoyeah unfortunately its full of ufw spam14:22
de-factodmesg -T | grep -v UFW | grep nfs only gives "FS-Cache: Netfs 'nfs' registered for caching" a day ago though14:23
de-factothats what i mean NFS not providing any useful info14:23
RoyKufw logging off ;)14:24
RoyKunlelss you really need them14:24
RoyKthere was an attempt to have ufw do userspace logging, but I have no idea how that went14:24
RoyKthat is - it's not ufw doing the logging, it's netfilter, kernel, which imho isn't a good idea for such large amounts of logs14:25
de-factoyeah if it was me i would not have installed ufw on there but oh well14:25
de-factoanhow i guess then the only option is to to a "mount -a" ever few minutes14:26
de-factoi dont see an opportunity where to get useful info from NFS about this14:26
RoyKor even better - create a script to check if it is mounted and if not, mount it14:27
RoyKsomething like "if $( cat /proc/mounts | grep /var/www/html/web > /dev/null 2>&1 ) ; then echo mounted ; else echo nope, not mounted ; fi"14:28
RoyKthen just replace echo ... with something logging it was remounted (man logger) and then remounting it14:29
de-factobut "mount -a" would not hurt i guess since it only mounts stuff that is not already mounted right?14:29
RoyKit'll mask other potential problems and if you by chance should want to umount an fs to check it or otherwise, it'll remount it14:30
de-factofair point14:30
de-factomaybe i put a list of automount filesystems in /etc/default/remount or such and use that from a systemd service with a timer14:31
RoyKshould work14:31
de-factoi 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 ehre14:32
RoyKwithout access to the qnap thing, well14:33
de-factoi will suggest to throw that in the garbage in the long term, it only causes a lot of problems (other than this)14:34
RoyKquite possibly a good idea ;)14:35
RoyKif you can afford something better, good, otherwise, if you have sufficient bandwidth, perhaps cloud storage, if you trust them, that is14:36
de-factoi 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 box14:36
RoyKAD is a catalog service, not storage, but good for use with accessing linux machines from windoze machines14:38
de-factoyeah windows and mac clients and the ad managing the credentials for an SMB share14:38
RoyKthat works well14:39
de-factoyeah and someone else responsible for incremental backups :P14:39
RoyKde-facto: yes, make sure you have good backups. I guess we all have failed on that at some point14:52
=== ijohnson is now known as ijohnson|lunch
=== ijohnson|lunch is now known as ijohnson

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!