Hi! I've noticed that "econf" in tinc-1.1* ebuild by default specifies '--localstatedir=/var/lib' to tinc's configure script, which leads to errors like: ``` $ tinc -n mynet dump connections Could not open pid file /var/lib/run/tinc.mynet.pid: No such file or directory ``` because, in source code, it using it as "/var" replacement: ``` src/uml_device.c: xasprintf(&device, LOCALSTATEDIR "/run/%s.umlsocket", identname); src/names.c: xasprintf(&logfilename, LOCALSTATEDIR SLASH "log" SLASH "%s.log", identname); src/names.c: xasprintf(&pidfilename, LOCALSTATEDIR SLASH "run" SLASH "%s.pid", identname); src/Makefile.in:localstatedir = @localstatedir@ src/Makefile.in:AM_CFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" -DSBINDIR=\"$(sbindir)\" src/Makefile.am:AM_CFLAGS = -DCONFDIR=\"$(sysconfdir)\" -DLOCALSTATEDIR=\"$(localstatedir)\" -DSBINDIR=\"$(sbindir)\" src/vde_device.c: xasprintf(&device, LOCALSTATEDIR "/run/vde.ctl"); ``` Should I report that "misuse" (if any) upstream or should I post fixed ebuild here (I think, it will be enough to just add --localstatedir=/var manually in econf arguments)?
(In reply to Vadim A. Misbakh-Soloviov (mva) from comment #0) > > Should I report that "misuse" (if any) upstream or should I post fixed > ebuild here (I think, it will be enough to just add --localstatedir=/var > manually in econf arguments)? can you test adding --localstatedir=/var and see if it fixes your problem
Sorry, missed your answer Yes, manual addition of > --localstatedir=/var fixes the problem. Although, shouldn't packages be patched to use /run directly instead of /var/run?
(In reply to Vadim A. Misbakh-Soloviov (mva) from comment #2) > Sorry, missed your answer > Yes, manual addition of > > --localstatedir=/var > fixes the problem. > Although, shouldn't packages be patched to use /run directly instead of > /var/run? Yeah, I agree. I'll prepare a patch.
Can you please test tinc-1.1_pre14-r2.ebuild and close this bug if everything works for you. Its working at my end. For posterity: I had to fix both the logfile and pidfile paths because both were being placed under LOCALSTATEDIR which is wrong. Upstream is clearly misunderstanding the correct LFS use of /var/lib. I've hard coded the correct paths. If upstream really wants the paths to the pidfile and logfile to be configurable, they should edit configure.ac and AC_DEFINE LOGFILENAME and PIDFILENAME to be whatever values are picked up from ./configure with some switch like --with-logfile=... and --with-pidfile=... @dlan. You're thoughts? I push this through upstream if you think this is a good idea.
(In reply to Anthony Basile from comment #4) > > @dlan. You're thoughts? I push this through upstream if you think this is > a good idea. @blueness, yes, I always think it's a good idea to push patches back to upstream which would make us carry less (thus much more clean ebuild), thanks
Hi, this bug is affecting tinc-1.0.31, too. Is the patch pushed upstream?
All the LOCALSTATEDIR macros in the package are used to construct /var/log and /var/run. I think the easiest fix is to pass --localstatedir=/var.
By the way, can you (anybody) port current patch to support prefix installations (at least, don't hardcode /var/log and /run)?