>> Gentoo runs tincd as follows :
>>
>>  /usr/sbin/tincd --net=ninux --logfile=/var/log/tinc.ninux.log
>> --pidfile=/var/run/tinc.ninux.pid
>
> Ah, that is because if you use --logfile, syslog is not used at all. Those 
> long
> numbers are "UNIX time" (the number of seconds since 1970-01-01 00:00 UT). I
> have been too lazy to have it write time in a human readable format. However, 
> I
> do remember someone sending me a patch that does that, so I'll find it and
> apply it. However, the --logfile option is more something that is useful when
> debugging tinc related issues; it does not work in comination with log 
> rotation
> for example. I would recommend removing the --logfile option, and the 
> --pidfile
> option also, because it is redundant.

Hello,

so I had little time to work on this.

looks like --pidfile option is actually necessary because the build
process of Gentoo will configure tincd as follows:

./configure --prefix=/usr --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --mandir=/usr/share/man
--infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
--localstatedir=/var/lib --libdir=/usr/lib64 --enable-jumbograms
--enable-lzo --enable-zlib

this causing the pidfile to be created in /var/lib/run instead of /var/run.

so I did not touch the --pidfile option in the command line.

regarding the use of syslog in gentoo I followed the suggestion from
Gentoo developers and I created a new version of the ebuild with the
syslog USE flag. See this bug:
https://bugs.gentoo.org/show_bug.cgi?id=371357

I attach the patch that updates the ebuild to version 1.0.16 and
creates the syslog USE flag.

It is my first ebuild, I checked that it works fine, maybe is not very
clean about gentoo syntax conventions.

Saverio
diff -r c9d2b943282d -r dbb67bd25965 Manifest
--- a/Manifest	Fri Aug 19 10:28:22 2011 +0200
+++ b/Manifest	Fri Aug 19 14:13:18 2011 +0200
@@ -1,18 +1,12 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
 AUX tinc.networks 387 RMD160 cc842d8ab6fb137d87276553fbf7465baeccf871 SHA1 8339d5882e494a0fd2390e1abfd0f24163949ce4 SHA256 7165721abd3706c95973118fbb503e18f9a008da6bdbf21a4ce35ecf7818d5ad
 AUX tincd 1606 RMD160 21ee723a9e5555e5354dc95cd5105fa9f5b7032a SHA1 3b72687d20f602fdc75fd2af1a291eca42a8e3a6 SHA256 bc3262370f67bf056f076bb6410394087984b00c45a28ba58738e03bfdfe3801
 AUX tincd.conf 19 RMD160 907e8fbeeeeda7fd5c0916ebea6bf90d14539723 SHA1 e41eb0392c8265a9f55bf8c4069f7b25085ced14 SHA256 cdbdbf4c8ca3dc805c645a404df7cc7d10908ef4e5b59f1c1d056ca6301f34cb
 AUX tincd.lo 1174 RMD160 35c99f726d4ca8252a03c96fda5d5c4862400a50 SHA1 d92a40511b1389b455489f9c59155da7d1605c2b SHA256 c51d94776ec6a1dc2013cfaf40a9a8e1ce92bfa6b3229fbf342d3d1dd88a1c69
+AUX tincdnosyslog 1606 RMD160 21ee723a9e5555e5354dc95cd5105fa9f5b7032a SHA1 3b72687d20f602fdc75fd2af1a291eca42a8e3a6 SHA256 bc3262370f67bf056f076bb6410394087984b00c45a28ba58738e03bfdfe3801
+AUX tincdsyslog 1569 RMD160 a38293cd8c9cd267b0665cb9985f109754f61e37 SHA1 85bb2e7366efdaf8a584abd0160b864907f52a8f SHA256 3767564b92625372ada05de769b61c7078aefd5a25f591d574a133f0f5f1b30a
 DIST tinc-1.0.13.tar.gz 508903 RMD160 72e3063887546fb82e5c740a71b52840bd04237d SHA1 d84070502d693cf46c93d324cdf1686d67617db4 SHA256 6d86518161e91d0d4f8f2697ea959c90e92a409e833cdce5c92d6f0c0cb01091
+DIST tinc-1.0.16.tar.gz 519460 RMD160 a4d44bd90d4c19f4cc8bc27c1f92a8fb437698d3 SHA1 6700e63c548228b1675f243f0075f98511f1e3a8 SHA256 f20863cb1155ba4e4dd4cf16c35a5d706cd326eb8fe62b8b0a31fd57241a5400
 EBUILD tinc-1.0.13.ebuild 1049 RMD160 5d7498f943b260e89662ef2aca40d93d9dc5b4cb SHA1 99586c0c96f382a8d7e3b488136ee1ed6f18a216 SHA256 f78730591f2e34e7b82ad476fe09df387881f72e0a32193d40a562c138cdbdb6
+EBUILD tinc-1.0.16.ebuild 1264 RMD160 8a9ab75e63dc134bfef0b1d97d97779933318bb4 SHA1 48c15d633b79f06b34ce859780f04d428d7fc1ff SHA256 f0d28662a5254d57374930ab02f6befd6f76fc4219edcab04140b5fe223fef2c
 MISC ChangeLog 3705 RMD160 278c681cd253ba3809b5aefb390f29e0dc6a1feb SHA1 ebced133e3868d51891941965e2dad293e76b547 SHA256 164b47f04b76637c58bcbeb160f873309bb52d2e79c450e82445c722e0dca51a
 MISC metadata.xml 317 RMD160 86d1e9df9bf86f6fd4ca50115c9d63991d98465d SHA1 92a3bdc3fcb160f3e78edd627d2a508d74aad565 SHA256 3c9957000d0913f04876499d562adfbfbea392a4ba2055ea0ab60b3ee8d3b68d
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.17 (GNU/Linux)
-
-iEYEARECAAYFAk4m7PcACgkQCaWpQKGI+9Rb1wCfevIUGOS39oT2j60jDmtztTHg
-8/4An1vTltxDtixrBzKz5s8m4wzk6W22
-=L3ic
------END PGP SIGNATURE-----
diff -r c9d2b943282d -r dbb67bd25965 files/tincdnosyslog
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/files/tincdnosyslog	Fri Aug 19 14:13:18 2011 +0200
@@ -0,0 +1,64 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/tinc/files/tincd,v 1.5 2008/04/01 14:08:45 dragonheart Exp $
+
+opts="reload"
+
+depend() {
+	use logger dns
+	need net
+}
+
+checkconfig() {
+	if ! grep -q '^ *NETWORK:' /etc/conf.d/tinc.networks 
+	then
+		eerror "No VPN networks configured in /etc/conf.d/tinc.networks"
+		return 1
+	fi
+}
+
+start() {
+	checkconfig || return 1
+	ebegin "Starting tinc VPN networks"
+	eend 0
+	awk '/^ *NETWORK:/ { print $2 }' /etc/conf.d/tinc.networks | while read TINCNET
+	do
+		if [ ! -f /etc/tinc/"$TINCNET"/tinc.conf ] 
+		then
+			eerror "Cannot start network $TINCNET, /etc/tinc/$TINCNET/tinc.conf does not exist !"
+		else
+			ebegin "Starting tinc network $TINCNET"
+			/usr/sbin/tincd --net="$TINCNET" --logfile=/var/log/tinc.$TINCNET.log --pidfile=/var/run/tinc.$TINCNET.pid
+			eend $?
+		fi
+	done
+}
+
+stop() {
+	ebegin "Stopping tinc VPN networks"
+	eend 0
+	awk '/^ *NETWORK:/ { print $2 }' /etc/conf.d/tinc.networks | while read TINCNET
+	do
+		if [ -f /var/run/tinc."$TINCNET".pid ]
+		then
+			ebegin "Stopping tinc network $TINCNET"
+			/usr/sbin/tincd --kill --pidfile=/var/run/tinc."$TINCNET".pid
+			eend $?
+		fi
+	done
+}
+
+reload() {
+	ebegin "Reloading configuration for tinc VPN networks"
+	eend 0
+	awk '/^ *NETWORK:/ { print $2 }' /etc/conf.d/tinc.networks | while read TINCNET
+	do
+		if [ -f /var/run/tinc."$TINCNET".pid ]
+		then
+			ebegin "Reloading tinc network $TINCNET"
+			/usr/sbin/tincd --kill HUP  --pidfile=/var/run/tinc."$TINCNET".pid
+			eend $?
+		fi
+	done
+}
diff -r c9d2b943282d -r dbb67bd25965 files/tincdsyslog
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/files/tincdsyslog	Fri Aug 19 14:13:18 2011 +0200
@@ -0,0 +1,64 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/tinc/files/tincd,v 1.5 2008/04/01 14:08:45 dragonheart Exp $
+
+opts="reload"
+
+depend() {
+	use logger dns
+	need net
+}
+
+checkconfig() {
+	if ! grep -q '^ *NETWORK:' /etc/conf.d/tinc.networks 
+	then
+		eerror "No VPN networks configured in /etc/conf.d/tinc.networks"
+		return 1
+	fi
+}
+
+start() {
+	checkconfig || return 1
+	ebegin "Starting tinc VPN networks"
+	eend 0
+	awk '/^ *NETWORK:/ { print $2 }' /etc/conf.d/tinc.networks | while read TINCNET
+	do
+		if [ ! -f /etc/tinc/"$TINCNET"/tinc.conf ] 
+		then
+			eerror "Cannot start network $TINCNET, /etc/tinc/$TINCNET/tinc.conf does not exist !"
+		else
+			ebegin "Starting tinc network $TINCNET"
+			/usr/sbin/tincd --net="$TINCNET" --pidfile=/var/run/tinc.$TINCNET.pid
+			eend $?
+		fi
+	done
+}
+
+stop() {
+	ebegin "Stopping tinc VPN networks"
+	eend 0
+	awk '/^ *NETWORK:/ { print $2 }' /etc/conf.d/tinc.networks | while read TINCNET
+	do
+		if [ -f /var/run/tinc."$TINCNET".pid ]
+		then
+			ebegin "Stopping tinc network $TINCNET"
+			/usr/sbin/tincd --kill --pidfile=/var/run/tinc."$TINCNET".pid
+			eend $?
+		fi
+	done
+}
+
+reload() {
+	ebegin "Reloading configuration for tinc VPN networks"
+	eend 0
+	awk '/^ *NETWORK:/ { print $2 }' /etc/conf.d/tinc.networks | while read TINCNET
+	do
+		if [ -f /var/run/tinc."$TINCNET".pid ]
+		then
+			ebegin "Reloading tinc network $TINCNET"
+			/usr/sbin/tincd --kill HUP  --pidfile=/var/run/tinc."$TINCNET".pid
+			eend $?
+		fi
+	done
+}
diff -r c9d2b943282d -r dbb67bd25965 tinc-1.0.16.ebuild
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tinc-1.0.16.ebuild	Fri Aug 19 14:13:18 2011 +0200
@@ -0,0 +1,42 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/tinc/tinc-1.0.13.ebuild,v 1.2 2010/09/17 09:48:50 robbat2 Exp $
+
+EAPI=2
+
+DESCRIPTION="tinc is an easy to configure VPN implementation"
+HOMEPAGE="http://www.tinc-vpn.org/";
+SRC_URI="http://www.tinc-vpn.org/packages/${P}.tar.gz";
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~sparc ~x86 ~x86-linux ~ppc-macos ~x86-macos"
+IUSE="+lzo +zlib +syslog"
+
+DEPEND=">=dev-libs/openssl-0.9.7c
+	lzo? ( dev-libs/lzo:2 )
+	zlib? ( >=sys-libs/zlib-1.1.4-r2 )
+    syslog? ( app-admin/syslog-ng )"
+
+src_configure() {
+	econf  --enable-jumbograms $(use_enable lzo) $(use_enable zlib)  || die
+}
+
+src_install() {
+	emake DESTDIR="${D}" install || die
+	dodir /etc/tinc
+	dodoc AUTHORS NEWS README THANKS
+	doinitd "${FILESDIR}"/tincd{,.lo}
+	if use syslog; then
+		newinitd "${FILESDIR}"/tincdsyslog tincd || die "newinitd failed!"
+	else
+		newinitd "${FILESDIR}"/tincdnosyslog tincd || die "newinitd failed!"
+	fi
+	doconfd "${FILESDIR}"/tinc.networks
+	newconfd "${FILESDIR}"/tincd.conf tincd
+}
+
+pkg_postinst() {
+	elog "This package requires the tun/tap kernel device."
+	elog "Look at http://www.tinc-vpn.org/ for how to configure tinc"
+}

Attachment: tinc-ebuild.patch.sign
Description: Binary data

_______________________________________________
tinc mailing list
[email protected]
http://www.tinc-vpn.org/cgi-bin/mailman/listinfo/tinc

Reply via email to