Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 371357 - net-misc/tinc - tincd script does not use syslog because it is hard-coded on the command line
Summary: net-misc/tinc - tincd script does not use syslog because it is hard-coded on ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Anthony Basile
URL: http://www.mail-archive.com/tinc@tinc...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-13 07:04 UTC by Francesco Saverio Proto
Modified: 2011-09-27 16:02 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
version bump to 1.0.16 and syslog USE flag added to ebuild (tinc-ebuild.patch,7.65 KB, patch)
2011-08-19 12:24 UTC, Francesco Saverio Proto
Details | Diff
gpg signature of attached patch (tinc-ebuild.patch.sign,490 bytes, text/plain)
2011-08-19 12:24 UTC, Francesco Saverio Proto
Details
Introduce the syslog USE flag (tinc-1.0.16.ebuild.patch,1.25 KB, patch)
2011-09-24 00:46 UTC, Francesco Saverio Proto
Details | Diff
adds initd script when USE flag syslog enabled (tincdsyslog.patch,1.76 KB, patch)
2011-09-24 00:47 UTC, Francesco Saverio Proto
Details | Diff
adds initd script when USE flag syslog disabled (tincdnosyslog.patch,1.80 KB, patch)
2011-09-24 00:48 UTC, Francesco Saverio Proto
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Francesco Saverio Proto 2011-06-13 07:04:35 UTC
Tincd does not write log messages to syslog. Asking the upstream developers the problem comes with some wrong command line options used in the init script. Those command line options should be used only for debug purposes.
I would recommend removing the --logfile option, and the --pidfile
option also, because it is redundant.


Reproducible: Always

Steps to Reproduce:
ps aux | grep tincd

and you can see that tincd is running with --logfile and --pidfile


Expected Results:  
Software should write messages directly to syslog
Comment 1 Jan Psota 2011-06-13 08:22:46 UTC
> Software should write messages directly to syslog

There are many programs that use specific /var/log/... and most of them
- and tinc too - allow to choose if syslog or dedicated file are better for their needs.
It is better for me to have dedicated tinc logs, because I need to know how much
time I spent on VPN to every institution.

I can see two solutions:
1. adding "syslog" USE flag to ebuild which cause tinc daemon use it
   (by removing --logfile from init scripts)
2. a way to change it's behavior from config file - /etc/conf.d/tincd

I think (1) is much better and so I will introduce in bleeding-edge.
(where there is tinc-1.0.14 since 11-th of May - I wrote Daniel Black about it)
Comment 2 Francesco Saverio Proto 2011-08-19 12:24:05 UTC
Created attachment 283897 [details, diff]
version bump to 1.0.16 and syslog USE flag added to ebuild
Comment 3 Francesco Saverio Proto 2011-08-19 12:24:42 UTC
Created attachment 283899 [details]
gpg signature of attached patch
Comment 4 Francesco Saverio Proto 2011-08-19 12:26:21 UTC
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.
Comment 5 Anthony Basile gentoo-dev 2011-09-23 19:21:36 UTC
I just adopted this package and bumped it to 1.0.16, latest upstream stable.

I did not add anything new ... yet.  I'm getting a feeling for the package first.  Can you give me your stuff in comment 2 as patches against the initrd image and the ebuild that will hit the tree in a few minutes.  Please don't post the manifest or your gpg sig as those are not necessary.  Also seperate each file into its own patch.

Thanks for your contribution :)
Comment 6 Francesco Saverio Proto 2011-09-24 00:46:50 UTC
Created attachment 287565 [details, diff]
Introduce the syslog USE flag
Comment 7 Francesco Saverio Proto 2011-09-24 00:47:40 UTC
Created attachment 287567 [details, diff]
adds initd script when USE flag syslog enabled
Comment 8 Francesco Saverio Proto 2011-09-24 00:48:43 UTC
Created attachment 287569 [details, diff]
adds initd script when USE flag syslog disabled
Comment 9 Francesco Saverio Proto 2011-09-24 01:06:16 UTC
Hello,

just to clarify, the file tincdnosyslog is exactly the same file of tincd initrd image present in the ebuild

the tincdsyslog is different just for one line.

the ebuild selects which one of the two files to install depending on the 'syslog' USE flag.
Comment 10 Anthony Basile gentoo-dev 2011-09-25 23:55:57 UTC
(In reply to comment #6)
> Created attachment 287565 [details, diff]
> Introduce the syslog USE flag

I see what you're trying to do here, but it bothers me that we have to introduce two nearly identical files.  I'm going to see if there's another way.

Also there is a small oversight in your patch.  The line just before your if use syslog installs both tincd and tincd.lo.  Since your if does that, you also want to change the line

   doinitd "${FILESDIR}"/tincd{,.lo}

to just

   doinitd "${FILESDIR}"/tincd.lo

Don't resubmit since I'm going to try to do this in a more economical way.
Comment 11 Anthony Basile gentoo-dev 2011-09-26 00:23:46 UTC
(In reply to comment #1)
> > Software should write messages directly to syslog
> 
> There are many programs that use specific /var/log/... and most of them
> - and tinc too - allow to choose if syslog or dedicated file are better for
> their needs.
> It is better for me to have dedicated tinc logs, because I need to know how
> much
> time I spent on VPN to every institution.
> 
> I can see two solutions:
> 1. adding "syslog" USE flag to ebuild which cause tinc daemon use it
>    (by removing --logfile from init scripts)
> 2. a way to change it's behavior from config file - /etc/conf.d/tincd
> 
> I think (1) is much better and so I will introduce in bleeding-edge.
> (where there is tinc-1.0.14 since 11-th of May - I wrote Daniel Black about it)

Okay I'm going with option 2.  This is the obvious way of doing it.  The USE flag is bad design because it means having to recompile tinc in order to change behavior rather than just changing one line in conf.d/tincd.

I'll have something up in a day or so.  Please test tinc-1.0.16-r1 and report back to this bug.
Comment 12 Anthony Basile gentoo-dev 2011-09-26 03:25:50 UTC
(In reply to comment #11)
> I'll have something up in a day or so.  Please test tinc-1.0.16-r1 and report
> back to this bug.

Its up.  Please test since this represents a significant rewrite of the init script system, making it more compliant with openrc.  I also took the opportunity to change some variable names to match those of the documentation, notably, TINCNET was changed to NETNAME (see man tincd).
Comment 13 Francesco Saverio Proto 2011-09-26 06:34:36 UTC
I upgrade to net-misc/tinc-1.0.16-r1

looks good to me :)
Comment 14 Anthony Basile gentoo-dev 2011-09-27 16:02:11 UTC
Please reopen if there's any further issues.