From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dgaW7-0004gy-8s for guix-patches@gnu.org; Sat, 12 Aug 2017 13:48:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dgaW2-0004sB-7s for guix-patches@gnu.org; Sat, 12 Aug 2017 13:48:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:48731) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dgaW2-0004rv-5S for guix-patches@gnu.org; Sat, 12 Aug 2017 13:48:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dgaW1-0004Kg-SB for guix-patches@gnu.org; Sat, 12 Aug 2017 13:48:01 -0400 Subject: [bug#27855] [PATCH] gnu: Add rsync service. Resent-Message-ID: Date: Sat, 12 Aug 2017 18:46:49 +0100 From: Christopher Baines Message-ID: <20170812184649.2003677a@cbaines.net> In-Reply-To: <87valtylnc.fsf@gmail.com> References: <20170727220151.2116-1-go.wigust@gmail.com> <20170728231747.5eae3af9@cbaines.net> <874ltvh5d6.fsf@gmail.com> <20170729125554.29836b28@cbaines.net> <87r2wszni8.fsf@gmail.com> <20170803163322.3e87b004@cbaines.net> <87fud8zkqv.fsf@gmail.com> <20170810081820.71b29b0a@cbaines.net> <20170810192139.2c3f04da@cbaines.net> <87mv778d66.fsf@gmail.com> <87y3qprjjd.fsf@gmail.com> <20170812075903.0dc36c0c@cbaines.net> <87valtylnc.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/q_5=7owy1xdUHcO263B/P.Z"; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Oleg Pykhalov Cc: 27855@debbugs.gnu.org --Sig_/q_5=7owy1xdUHcO263B/P.Z Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sat, 12 Aug 2017 16:13:11 +0300 Oleg Pykhalov wrote: > Hello Christopher, >=20 > Christopher Baines writes: >=20 > =E2=80=A6 > >> >> On Thu, 10 Aug 2017 08:18:20 +0100 > >> >> Christopher Baines wrote: > >> >> =20 > >> >>> I've attached the beginnings of a system test for this. I > >> >>> haven't got as far as actually testing the service directly > >> >>> yet, but I'm going to try testing it, both when running as > >> >>> root, and when not running as root. > >> >>>=20 > >> >>> A VM start script can be created from this rsync.scm file, by > >> >>> running: guix system vm gnu/tests/rsync.scm > >> >>>=20 > >> >>> Also, the test itself can be run by doing: > >> >>> make check-system TESTS=3Drsync =20 > >> >> > >> >> I've now got around to actually testing the service. I've > >> >> attached a patch which creates two system tests. One which > >> >> tests the service with the default port, and one with a higher > >> >> port (I randomly picked 2000). > >> >> > >> >> The default port test currently passes, but the higher port one > >> >> currently fails as the rsync service can't create the PID file. > >> >> > >> >> One option to fix this would be to create a /var/run/rsync > >> >> directory which is owned by the rsyncd user, and then create the > >> >> PID file as /var/run/rsync/pid. =20 > >> > > >> > I'll check it later, if you'll not be faster than me. :-) > >> > =20 > >> >> Just let me know if you have any questions? =20 > >> > =E2=80=A6 > >> > > >> > I successfully passed you previous patch test, but the new patch > >> > one with two =E2=80=9Cports=E2=80=9D fails. =20 > >>=20 > >> Trying to understand what is going on. Working on your latest test > >> patch. > >>=20 > >> This is what I currently have. It's not differ from your patch > >> except commented test below. guix/gnu/tests/rsync.scm > >> https://paste.pound-python.org/raw/ZyfPIvOWAbPd7blPRXf7/ > >>=20 > >> I fully commented > >> (test-equal "Test file correctly received from share" =E2=80=A6). > >>=20 > >> (test-assert "Test file copied to share" > >> =E2=80=A6 > >> (zero? ; ERROR HERE > >> (system* "rsync" "/tmp/input" "localhost::files/"))) > >>=20 > >> Bottom of test log: > >> --8<---------------cut here---------------start------------->8--- > >> rsync: mkstemp ".input.Y6OhRW" (in files) failed: Permission denied > >> (13) rsync error: some files/attrs were not transferred (see > >> previous errors) (code 23) at main.c(1178) [sender=3D3.1.2] QEMU > >> runs as PID 5 connected to QEMU's monitor > >> read QEMU monitor prompt > >> connected to guest REPL > >> %%%% Starting test rsync (Writing full log to "rsync.log") > >> marionette is ready > >> /gnu/store/bm3kvdwh8q3spvhxbmpmcjwz3fng8z5f-rsync-test-builder:1: > >> FAIL Test file copied to share # of expected passes 2 > >> # of unexpected failures 1 > >> note: keeping build directory `/tmp/guix-build-rsync-test.drv-9' > >> builder for > >> `/gnu/store/1hv9c616m9xkgi549hgbn1y2vr8mnzfr-rsync-test.drv' failed > >> with exit code 1 @ > >> build-failed /gnu/store/1hv9c616m9xkgi549hgbn1y2vr8mnzfr-rsync-test.drv > >> - 1 builder for > >> `/gnu/store/1hv9c616m9xkgi549hgbn1y2vr8mnzfr-rsync-test.drv' failed > >> with exit code 1 TOTAL: 1 > >> FAIL: /gnu/store/s0rwmr3iha48jbw2b9xkzcqqsamdl21q-rsync-test make: > >> *** [Makefile:5217: check-system] Error 1 --8<---------------cut > >> here---------------end--------------->8--- =20 > > > > With the change to add the uid to the rsync configuration file, the > > rsync-with-default-port passes for me. What test are you running > > here? =20 >=20 > It was =E2=80=9Crsync-with-default-port=E2=80=9D. With =E2=80=9Cuid=E2= =80=9D passed successfully all > tests in =E2=80=9Crsync-with-default-port=E2=80=9D. >=20 > Test 2000 port > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > The =E2=80=9Ctest-rsync-with-port-2000=E2=80=9D fails, because we sync wi= th default > rsync protocol port in this test but we need 2000. >=20 > --8<---------------cut here---------------start------------->8--- > (test-assert "Test file copied to share" > =E2=80=A6 > (system* "rsync" "/tmp/input" "localhost::files/")) > --8<---------------cut here---------------end--------------->8--- >=20 > Why I thought about this: > --8<---------------cut here---------------start------------->8--- > rsync: failed to connect to localhost (127.0.0.1): Connection refused > (111) rsync error: error in socket IO (code 10) at > clientserver.c(125) [sender=3D3.1.2] rsync: failed to connect to > localhost (127.0.0.1): Connection refused (111) rsync error: error in > socket IO (code 10) at clientserver.c(125) [Receiver=3D3.1.2] > --8<---------------cut here---------------end--------------->8--- >=20 > Next lines: > --8<---------------cut here---------------start------------->8--- > ice-9/eval.scm:387:11: In procedure eval: > ice-9/eval.scm:387:11: In procedure open-file: No such file or > directory: "/tmp/output" QEMU runs as PID 5 > connected to QEMU's monitor > read QEMU monitor prompt > connected to guest REPL > %%%% Starting test rsync (Writing full log to "rsync.log") > marionette is ready > /gnu/store/ahmg6h2fnap2znwhl6b4jrjgp830h4dv-rsync-test-builder:1: > FAIL Test file copied to > share /gnu/store/ahmg6h2fnap2znwhl6b4jrjgp830h4dv-rsync-test-builder:1: > FAIL Test file correctly received from share # of expected > passes 2 # of unexpected failures 2 note: keeping build > directory `/tmp/guix-build-rsync-test.drv-13' builder for > `/gnu/store/9fakmd8dqzdw1ybff6gb00qfzhrwqdis-rsync-test.drv' failed > with exit code 1 @ > build-failed /gnu/store/9fakmd8dqzdw1ybff6gb00qfzhrwqdis-rsync-test.drv > - 1 builder for > `/gnu/store/9fakmd8dqzdw1ybff6gb00qfzhrwqdis-rsync-test.drv' failed > with exit code 1 TOTAL: 1 > FAIL: /gnu/store/rmb3hywspr34fwp5xinphaml7c4xjpvk-rsync-test make: > *** [Makefile:5217: check-system] Error 1 --8<---------------cut > here---------------end--------------->8--- >=20 > I only fixed PID error in current moment. >=20 > gnu/tests/rsync.scm > https://paste.pound-python.org/raw/D4ccInuJG0g0899GCdy2/ >=20 > gnu/services/rsync.scm > https://paste.pound-python.org/raw/URDLeIV3XFZ29SjcZYc6/ Yep, I think I just stopped writing the test after finding the issue with the PID file. I haven't looked in to how to fix this in the test, so if you could, that would be great. Otherwise, I'll probably have time to look at this again within a week or so. You'll probably need to refactor the test a bit, as at the moment, the information regarding the port isn't available where you run the commands. > >> Also, I have (is related?) error on top of test log. > >> --8<---------------cut here---------------start------------->8--- > >> natsu@magnolia ~/src/guix$ ./pre-inst-env make check-system > >> TESTS=3Drsync-with-default-port Compiling Scheme modules... > >> warning: failed to load '(gnu tests admin)': > >> ERROR: In procedure allocate-struct: Wrong type argument in > >> position 2: 8 --8<---------------cut > >> here---------------end--------------->8--- =20 > > > > I think I may have seen this error too, no idea what it relates to > > though. =20 >=20 > Should we report this as a bug? Ideally yes, but I have no idea where the bug might be. I guess it might be Guile, as I didn't find anything named allocate-struct in Guix. --Sig_/q_5=7owy1xdUHcO263B/P.Z Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlmPPwlfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XdbTg//RF4YlWsZR3CcMVyjpnXMML2O5nM3kOjce+1pRsRGXG0+Fz3lyHCavXVn 7MxHto/ymyFm/4iZMPiOtDEJqxL7e+rYgBGH0nn/T+9QyjeGZyDK8ZuFGTDS9WH8 5psZnSRQfhgJ3aMOvUTj1ObvZhudg3dhkYmkSwzxo+tmuS7eRhc6t00wpkLtzVaX BtRn9DyPAslGA1XZ7bGKALIafmSLEJGl+r/owMx9R7tvEY14ynfK+VzuqXDHAzV3 1ooh16Au3bnKDAzSDRy6HJ11j2xm1ykbHmP7+jIflYh5/CIOiG7R22YHxX0DmWgp ancr9KX00yjqftubqtFQL1fg5LiUpK+7iAhVQ8AS3/PwrOmsB/YheXyiuHtdtNzq F2z71Po/6mX6CmbHkio6kkXSxjTIXC0q5w5idK9B4Sm5OwqujbnzBWBSqHMuoVir BTzlQeBEaNksPqEgBF6CTL6yvnFNRjnWn80giZ9wh4LDTZuCqtrgCg76OMwsiT4n kaOgVtcHD0LaC9NBPo1EIjjXf4iQMNSLUKe7z1Kbnz2J5sciAIGmj5k1SmzB/v93 DfUTUIlIEQVfoL6a3zyOx+K4bk/bZRpcayY2jPbFQDthEDqCGXWBoviTTb+2o99z l+kVMhR+TAgQmN1c4WX1wpZdiWcIwAL/4IsU92QHGa0eZwSFCUA= =ixoM -----END PGP SIGNATURE----- --Sig_/q_5=7owy1xdUHcO263B/P.Z--