Re: xntp3: init script is not very policy-compliant

1998-06-17 Thread Joey Hess
Nicolás Lichtmaier wrote:
  I think we need a way to install a package without automatically having its
 server part configured and running. This is needed in many packages (e.g.:
 ssh).

I agree. This is also an issue when you do something like 
dpkg --root=/mnt -i foo.deb -- when you do that, you don't typically want
the daemon to be started.

Maybe there could be a dpkg option that sets an environment variable visible
inside the maintainer scripts that says daemons should not be stopped or 
started?

-- 
see shy jo

I'm on a long trip, pardon any delays in my reply.


--  
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: xntp3: init script is not very policy-compliant

1998-06-17 Thread Joey Hess
Raul Miller wrote:
 Briefly, this command line:
 f=/tmp/fifo; rm -f $f; mkfifo $f; ( sleep 100 $f 0$f );  sleep 2; echo $f
 will kill your interactive shell
 
 I'm a bit surprised to find this, um.. undocumented feature in three
 shells of supposedly different lineage.  I should note that it doesn't
 affect bash (nor other shells) when I tried it under solaris.  I guess
 it might be related to the kernel's handling of sigpipe.
 
 Someone want to check to see if it's just me, before I go off and file
 a whole bunch of bug reports?

If you do file bug reports, zsh should get one too:

[EMAIL PROTECTED]:~f=/tmp/fifo; rm -f $f; mkfifo $f; ( sleep 100 $f 0$f );
sleep 2; echo $f
zsh: file mode mismatch on fd 0

shell exits here

-- 
see shy jo

I'm on a long trip, pardon any delays in my reply.


--  
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: xntp3: init script is not very policy-compliant

1998-06-15 Thread Raul Miller
Bdale Garbee [EMAIL PROTECTED] wrote:
 Was the system clock ever warped more than 1024 seconds under these
 circumstances?  If so, I think that it would cause xntpd to exit, but I
 have not actually tried it.

Hmm... circumstancial evidence says that yes, this kills xntpd.

I guess the right thing to do for this would be to always restart
xntpd after running ntpdate.

start-stop-daemon --start --verbose --exec /usr/sbin/xntpd
( 
# xntpd won't start if ntpdate is running
# ntpdate may hang under some circumstances
ntpdate -bs `awk '/^[   ]*server/{print $2}'`
# xntpd may exit if clock slews more than 1024 seconds
start-stop-daemon --start --exec /usr/sbin/xntpd 2/dev/null
) 

Does ntpdate really hang?  This approach is fundamentally clunky.

-- 
Raul


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: xntp3: init script is not very policy-compliant

1998-06-15 Thread Raul Miller
Jason Gunthorpe [EMAIL PROTECTED] wrote:
 I've never had ntpdate ever work while xntpd is running, with the set
 options it never actually changes the time, I forget if it's a silent
 fail or if it gives some error.

Hmm.. and the system where I was running ntpdate in the background
(after I thought I had started xntpd, by the way) doesn't have a
running xntpd.

I guess it might be appropriate to run a meta-server (which would take
down xntpd when receiving an ntpdate request, then restarts xntpd (or
restarts it after a short delay if it stopped without authorization)).

I'm deferring further discussion of this for a bit, I think I've discovered
what I would think of as a bash (and ash, and ksh bug).

   * * * * *

Briefly, this command line:
f=/tmp/fifo; rm -f $f; mkfifo $f; ( sleep 100 $f 0$f );  sleep 2; echo $f
will kill your interactive shell

I'm a bit surprised to find this, um.. undocumented feature in three
shells of supposedly different lineage.  I should note that it doesn't
affect bash (nor other shells) when I tried it under solaris.  I guess
it might be related to the kernel's handling of sigpipe.

Someone want to check to see if it's just me, before I go off and file
a whole bunch of bug reports?

-- 
Raul


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: xntp3: init script is not very policy-compliant

1998-06-15 Thread Raul Miller
Jason Gunthorpe [EMAIL PROTECTED] wrote:
  I've never had ntpdate ever work while xntpd is running, with the set
  options it never actually changes the time, I forget if it's a silent
  fail or if it gives some error.

Harumph.

Personally, I've never seen ntpdate hang, I've only deferred it
because it's not useful until my ppp connection is up.

It's clear that xntpd should start after ntpdate -b has had a chance
to run.  If ntpdate really can hang, then perhaps the whole
bit with ntpdate, and starting xntpd should be backgrounded.

-- 
Raul


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: xntp3: init script is not very policy-compliant

1998-06-14 Thread Christian Schwarz

[I don't have the bug number at hand, so please forward this to the bug
tracking system.]

On Sun, 14 Jun 1998, Branden Robinson wrote:

 Package: xntp3
 Version: 5.91-8
 Severity: important
 
 There are a number of aspects of the existing init script that are not
 policy-compliant.  Within this mail is a modified version that is.  (Yes, I
 have tested it.)
 
[snip]
 restart|reload|force-reload)
   $0 stop
   $0 start
   ;;
[snip]

According to policy, the reload option must never _restart_ the service.
(This isn't stated explicitely in the documents, but it was meant that
way. Perhaps someone should clarify the text in the policy manual?) 

If xntp3 doesn't support reloading, the reload option should fail (or
not be implemented at all, which would make the script display the usage
text).


Thanks,

Chris

--  _,, Christian Schwarz
   / o \__   [EMAIL PROTECTED], [EMAIL PROTECTED],
   !   ___;   [EMAIL PROTECTED], [EMAIL PROTECTED]
   \  /
  \\\__/  !PGP-fp: 8F 61 EB 6D CF 23 CA D7  34 05 14 5C C8 DC 22 BA
   \  / http://fatman.mathematik.tu-muenchen.de/~schwarz/
-.-.,---,-,-..---,-,-.,.-.-
  DIE ENTE BLEIBT DRAUSSEN!


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: xntp3: init script is not very policy-compliant

1998-06-14 Thread Raul Miller
Branden Robinson [EMAIL PROTECTED] wrote:
 There are a number of aspects of the existing init script that are not
 policy-compliant.  Within this mail is a modified version that is.  (Yes, I
 have tested it.)

A question/comment, though:

 TIMEHOST1=ntp2.usno.navy.mil
 TIMEHOST2=tick.usno.navy.mil
 TIMEHOST3=tock.usno.navy.mil

Shouldn't this information be pulled out of /etc/ntp.conf?

   ntpdate -b -s -t 1 $TIMEHOST1 $TIMEHOST2 $TIMEHOST3  /dev/null 21

Any reason not to use
ntpdate -b -s `awk '/^[  ]*server/{print $2}'` 
? (that's a tab and a space between the square brackets).

[Note that I've tossed the timeout, but to prevent any potential
boot-hang problems have backgrounded the sction.  According to 
/usr/doc/xntp/html/ntpdate.html on my system, -t 1 is the default,
so it seems somewhat broken to explicitly set it.  Note that this
is probably influenced by the default of getting four samples.]

Also, it may be worth bailing out of the script entirely if there
are no servers mentioned in /etc/ntp.conf

-- 
Raul


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: xntp3: init script is not very policy-compliant

1998-06-14 Thread Branden Robinson
On Sun, Jun 14, 1998 at 09:08:08AM -0400, Raul Miller wrote:
 Branden Robinson [EMAIL PROTECTED] wrote:
  There are a number of aspects of the existing init script that are not
  policy-compliant.  Within this mail is a modified version that is.  (Yes, I
  have tested it.)
 
 A question/comment, though:
 
  TIMEHOST1=ntp2.usno.navy.mil
  TIMEHOST2=tick.usno.navy.mil
  TIMEHOST3=tock.usno.navy.mil
 
 Shouldn't this information be pulled out of /etc/ntp.conf?
 
ntpdate -b -s -t 1 $TIMEHOST1 $TIMEHOST2 $TIMEHOST3  /dev/null 21
 
 Any reason not to use
   ntpdate -b -s `awk '/^[  ]*server/{print $2}'` 
 ? (that's a tab and a space between the square brackets).
 
 [Note that I've tossed the timeout, but to prevent any potential
 boot-hang problems have backgrounded the sction.  According to 
 /usr/doc/xntp/html/ntpdate.html on my system, -t 1 is the default,
 so it seems somewhat broken to explicitly set it.  Note that this
 is probably influenced by the default of getting four samples.]
 
 Also, it may be worth bailing out of the script entirely if there
 are no servers mentioned in /etc/ntp.conf

All good suggestions, so I'm CC'ing the bug to make sure the maintainer
sees them.

Also, xntp3's cron.weekly script does redirect the output of stopping its
daemon (to rotate the log files) to /dev/null, so every week you'll get
mail from cron helpfully telling you the daemon was stopped.

-- 
G. Branden Robinson |
Purdue University   |  Bother, said Pooh, as he was
[EMAIL PROTECTED]  |  assimilated by the Borg.
http://www.ecn.purdue.edu/~branden/ |


pgp4HuxHHANsz.pgp
Description: PGP signature


Re: xntp3: init script is not very policy-compliant

1998-06-14 Thread Bdale Garbee
In article [EMAIL PROTECTED] you wrote:

: Any reason not to use
:  ntpdate -b -s `awk '/^[  ]*server/{print $2}'` 
: ? (that's a tab and a space between the square brackets).
: [Note that I've tossed the timeout, but to prevent any potential
: boot-hang problems have backgrounded the sction.

I don't think backgrounding the ntpdate will work well in practice, because
ntpdate and xntpd can't be running at the same time.  If you background it,
and then launch xntpd without waiting for ntpdate to finish, I'm pretty sure
you'll get a socket already in use kind of error.  This is actually a 
logical thing, not just a technical issue, since having more than one
process trying to understand and whack on the system clock at the same time
feels like it would be doomed to failure...

Have you actually tried this and found something different?

I've actually had several folks request that I break ntpdate out into a 
separate package, so that they could install just it and configure some hosts
to run it against at boot without having the full xntpd installation around.
I have mixed feelings about this, but understand the motivations.  Anyone else
care to comment?

With respect to the cron scripts, I haven't looked at them for a while.  They
are essentially what was there when I took over the package.  They do not,
with the package in its present form, generate *any* regualar email.  I'm 
actually not personally thrilled about the explicit stop and start in the
cron.weekly.  If anyone cares to propose something different/better, I'll be
happy to look at doing this differently... if what's there is fine with
everyone, that's ok too.

Bdale


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: xntp3: init script is not very policy-compliant

1998-06-14 Thread Raul Miller
Bdale Garbee [EMAIL PROTECTED] wrote:
 Have you actually tried this and found something different?

I've run ntpdate numerous times with xntp already running.

 I've actually had several folks request that I break ntpdate out into a 
 separate package, so that they could install just it and configure some hosts
 to run it against at boot without having the full xntpd installation around.
 I have mixed feelings about this, but understand the motivations.  Anyone else
 care to comment?

The package has an installed-size of 355 (k).  If that's a problem, we
need a more general mechanism to tell dpkg to install only part of a package.

-- 
Raul


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: xntp3: init script is not very policy-compliant

1998-06-14 Thread Nicolás Lichtmaier
On Sun, Jun 14, 1998 at 12:38:00PM -0400, Raul Miller wrote:
 Bdale Garbee [EMAIL PROTECTED] wrote:
  Have you actually tried this and found something different?
 
 I've run ntpdate numerous times with xntp already running.
 
  I've actually had several folks request that I break ntpdate out into a 
  separate package, so that they could install just it and configure some 
  hosts
  to run it against at boot without having the full xntpd installation around.
  I have mixed feelings about this, but understand the motivations.  Anyone 
  else
  care to comment?
 
 The package has an installed-size of 355 (k).  If that's a problem, we
 need a more general mechanism to tell dpkg to install only part of a package.

 I think we need a way to install a package without automatically having its
server part configured and running. This is needed in many packages (e.g.:
ssh).


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: xntp3: init script is not very policy-compliant

1998-06-14 Thread Jason Gunthorpe

On Sun, 14 Jun 1998, Raul Miller wrote:

 [Note that I've tossed the timeout, but to prevent any potential
 boot-hang problems have backgrounded the sction.  According to 

You can't background ntpdate, both ntpdate and xntpd can not run at the
same time, if you load one then the other will fail.

Jason


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: xntp3: init script is not very policy-compliant

1998-06-14 Thread Raul Miller
Jason Gunthorpe [EMAIL PROTECTED] wrote:
 You can't background ntpdate, both ntpdate and xntpd can not run at the
 same time, if you load one then the other will fail.

Hm... then I guess it should be done the other way around.

ntpdate will run with xntpd running, I've done this numerous times.
So start xntpd first.

-- 
Raul


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: xntp3: init script is not very policy-compliant

1998-06-14 Thread Bdale Garbee
In article [EMAIL PROTECTED] you wrote:
: Bdale Garbee [EMAIL PROTECTED] wrote:
: Have you actually tried this and found something different?

: I've run ntpdate numerous times with xntp already running.

Hmm.  I didn't think that would work.  Learn something new every day!

Was the system clock ever warped more than 1024 seconds under these
circumstances?  If so, I think that it would cause xntpd to exit, but I
have not actually tried it.

Bdale


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: xntp3: init script is not very policy-compliant

1998-06-14 Thread Jason Gunthorpe

On Sun, 14 Jun 1998, Raul Miller wrote:

 Jason Gunthorpe [EMAIL PROTECTED] wrote:
  You can't background ntpdate, both ntpdate and xntpd can not run at the
  same time, if you load one then the other will fail.
 
 Hm... then I guess it should be done the other way around.
 
 ntpdate will run with xntpd running, I've done this numerous times.
 So start xntpd first.

I've never had ntpdate ever work while xntpd is running, with the set
options it never actually changes the time, I forget if it's a silent
fail or if it gives some error.

Wakko{root}/mnt/Big/home/jgg#ntpdate ntp.fuller.edu
14 Jun 16:17:34 ntpdate[4120]: the NTP socket is in use, exiting

Wakko{root}/mnt/Big/home/jgg#strace ntpdate -b -s www.tac.net 
[...]
bind(4, {sin_family=AF_INET, sin_port=htons(123),
sin_addr=inet_addr(0.0.0.0)}, 16) = -1 EADDRINUSE (Address already in
use)   
[...]

Wakko{root}/mnt/Big/home/jgg#tail /var/log/syslog
Jun 14 16:17:53 Wakko ntpdate[4123]: the NTP socket is in use, exiting

Jason


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]