Bug#893542: ntpsec-ntpviz: shares /var/log/ntpstats with ntp, which gets zapped when ntp is purged

2018-07-26 Thread Richard Laager
On 03/30/2018 05:31 PM, Richard Laager wrote:
> If this coordination is acceptable, I believe it solves the various
> interactions. I'm happy to test more scenarios if anyone thinks I missed
> something.
> 
> If this coordination is not acceptable, I'm open to alternative suggestions.

My current plan is to rename (on the ntpsec side) everything that
conflicts. I have a start on this, and it won't be too bad. There will
be a different set of trade-offs.

-- 
Richard



Bug#893542: ntpsec-ntpviz: shares /var/log/ntpstats with ntp, which gets zapped when ntp is purged

2018-06-18 Thread Richard Laager
On 06/18/2018 01:46 PM, Paride Legovini wrote:
> Just a friendly ping on this, as I'd like to see ntpsec migrate to
> testing. What are your plans for this patch?

I've been in some communication with an ntp maintainer, but no updates
as of recently. At this point, my intention is to package the new 1.1.1
release with this and a few other fixes and then close this as fixed
from my side. I had hoped to do that yesterday, but I didn't get to it.
I hope to complete this in the next couple of days.

-- 
Richard



Bug#893542: ntpsec-ntpviz: shares /var/log/ntpstats with ntp, which gets zapped when ntp is purged

2018-06-18 Thread Paride Legovini
On Fri, 30 Mar 2018 Richard Laager  wrote:
> If this coordination is acceptable, I believe it solves the various
> interactions. I'm happy to test more scenarios if anyone thinks I missed
> something.

Hello Richard,

Just a friendly ping on this, as I'd like to see ntpsec migrate to
testing. What are your plans for this patch?

Cheers,

Paride



Bug#893542: ntpsec-ntpviz: shares /var/log/ntpstats with ntp, which gets zapped when ntp is purged

2018-03-30 Thread Richard Laager
I did some testing just now.

I've updated ntpsec.postrm in git. I dropped the unnecessary LANG=C on
the first check, updated the style of the "then" statement, and most
importantly, moved the deluser inside the "! dpkg -s ntp" block:

if ! dpkg -s ntp > /dev/null 2>&1; then
rm -rf /var/lib/ntp/
rm -rf /var/log/ntpstats/
if ! LANG=C dpkg -s ntpsec-ntpviz 2> /dev/null | \
 grep -qE "^Status: (hold|install)"; then
deluser --system --quiet ntp || true
fi
fi

Here is the equivalent diff for ntp, which I have tested and confirmed:

diff --git a/debian/ntp.postrm b/debian/ntp.postrm
index d959aa5..7ec4b6b 100644
--- a/debian/ntp.postrm
+++ b/debian/ntp.postrm
@@ -25,7 +25,12 @@ installinit_error() {
 #DEBHELPER#

 if [ "$1" = "purge" ]; then
-   deluser --system --quiet ntp || true
-   rm -rf /var/lib/ntp/
-   rm -rf /var/log/ntpstats/
+   if ! dpkg -s ntpsec > /dev/null 2>&1; then
+   rm -rf /var/lib/ntp/
+   rm -rf /var/log/ntpstats/
+   if ! LANG=C dpkg -s ntpsec-ntpviz 2> /dev/null | \
+grep -qE "^Status: (hold|install)"; then
+   deluser --system --quiet ntp || true
+   fi
+   fi
 fi

If this coordination is acceptable, I believe it solves the various
interactions. I'm happy to test more scenarios if anyone thinks I missed
something.

If this coordination is not acceptable, I'm open to alternative suggestions.

-- 
Richard



Processed: Re: Bug#893542: ntpsec-ntpviz: shares /var/log/ntpstats with ntp, which gets zapped when ntp is purged

2018-03-30 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

> clone 893542 -1
Bug #893542 [ntpsec-ntpviz] ntpsec-ntpviz: shares /var/log/ntpstats with ntp, 
which gets zapped when ntp is purged
Bug 893542 cloned as bug 894475
> reassign -1 ntp
Bug #894475 [ntpsec-ntpviz] ntpsec-ntpviz: shares /var/log/ntpstats with ntp, 
which gets zapped when ntp is purged
Bug reassigned from package 'ntpsec-ntpviz' to 'ntp'.
No longer marked as found in versions ntpsec/1.0.0+dfsg1-5.
Ignoring request to alter fixed versions of bug #894475 to the same values 
previously set
>
End of message, stopping processing here.

Please contact me if you need assistance.
-- 
893542: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=893542
894475: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=894475
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#893542: ntpsec-ntpviz: shares /var/log/ntpstats with ntp, which gets zapped when ntp is purged

2018-03-19 Thread Richard Laager
On 03/19/2018 02:42 PM, Julian Gilbey wrote:
> Package: ntpsec-ntpviz
> Version: 1.0.0+dfsg1-5
> Severity: serious
> 
> I installed the ntpsec suite, then purged the ntp packages.
> Unfortunately, this zapped the /var/log/ntpstats directory, which is
> needed by ntpsec-ntpviz.  There needs to either been some agreement
> between ntp and ntpsec about the use of this directory, or ntpsec
> needs to use a different log directory.

We have the same situation in reverse too, it seems.

Keeping the same log directory between ntp and ntpsec is desirable, for
several reasons:

- The log format is the same.
- Logs are not lost on conversions from ntp to ntpsec or ntpsec to ntp.
- ntpsec-ntpviz is co-installable with ntp and works. This might be
desirable, if someone wants to continue using ntp but use ntpviz to
create useful graphs.
- IIRC, the default /etc/ntp.conf from ntp references this path, so
keeping the logging path the same means we don't need to change
/etc/ntp.conf on conversions from ntp<->ntpsec.

Likewise for /var/lib/ntp, where the drift file is stored. There again,
it is very desirable to keep the same drift file upon conversions from
ntp<->ntpsec. Otherwise, accuracy is lost until the new ntpd has a
chance to recalculate the drift value.

Related, there's the issue of the ntp user (and ntp group). Those should
not be removed until /var/log/ntpstats is gone. The ntpsec-ntpviz
package also needs the ntp user and group, so coordination is required
there too.

An alternative would be to _copy_ the log files and drift file on
initial installation of ntpsec. This has some downsides:
- Only ntp -> ntpsec conversions benefit. If someone goes the other way,
or goes to ntpsec and then back, logs are still lost, unless ntp also
adopts a copying approach (but then why copy instead of share?).
- ntpsec needs to sed /etc/ntp.conf to change the paths. This breaks
logging if someone moves back to ntp, unless ntp also seds the config
file (again then why not just share?).
- This breaks anything else that someone might be doing with the log
files (and drift file, but that seems unlikely).
- We still need to coordinate on the ntp user (and group), unless ntpsec
uses a different user (and group) too. If so, then I'm deviating from
upstream naming (and years of user history with ntp).

Another alternative would be for both packages to simply _not_ delete
any of these things.

I have wrapped the `rm -rf` with a check for ntp. Here is what I have in
ntpsec.postrm now:

if ! LANG=C dpkg -s ntp > /dev/null 2>&1
then
rm -rf /var/lib/ntp/
rm -rf /var/log/ntpstats/
fi
if ! LANG=C dpkg -s ntpsec-ntpviz 2> /dev/null | \
 grep -qE "^Status: (hold|install)"; then
deluser --system --quiet ntp || true
fi


I suggest the same for ntp.postrm, but with "ntp" changed to "ntpsec":

if ! LANG=C dpkg -s ntpsec > /dev/null 2>&1
then
rm -rf /var/lib/ntp/
rm -rf /var/log/ntpstats/
fi
if ! LANG=C dpkg -s ntpsec-ntpviz 2> /dev/null | \
 grep -qE "^Status: (hold|install)"; then
deluser --system --quiet ntp || true
fi


Is this acceptable on the ntp side? If not, can you propose a different
solution?

-- 
Richard



Bug#893542: ntpsec-ntpviz: shares /var/log/ntpstats with ntp, which gets zapped when ntp is purged

2018-03-19 Thread Julian Gilbey
Package: ntpsec-ntpviz
Version: 1.0.0+dfsg1-5
Severity: serious

I installed the ntpsec suite, then purged the ntp packages.
Unfortunately, this zapped the /var/log/ntpstats directory, which is
needed by ntpsec-ntpviz.  There needs to either been some agreement
between ntp and ntpsec about the use of this directory, or ntpsec
needs to use a different log directory.

Best wishes,

   ulian

-- System Information:
Debian Release: buster/sid
  APT prefers stretch
  APT policy: (500, 'stretch'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.14.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_GB.UTF-8), LANGUAGE=en_GB.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set 
to en_GB.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages ntpsec-ntpviz depends on:
ii  adduser   3.117
ii  cron [cron-daemon]3.0pl1-130
ii  fonts-liberation  1:1.07.4-5
ii  gnuplot   5.2.2+dfsg1-2
ii  gnuplot-qt [gnuplot]  5.2.2+dfsg1-2
ii  python3   3.6.4-1
ii  python3-ntp   1.0.0+dfsg1-5
ii  systemd   238-2

Versions of packages ntpsec-ntpviz recommends:
ii  apache2 [httpd]  2.4.29-2
ii  ntpsec   1.0.0+dfsg1-5
ii  python3-psutil   5.4.2-1
ii  systemd  238-2

Versions of packages ntpsec-ntpviz suggests:
ii  python  2.7.14-4
pn  python-gps  

-- no debconf information