/etc/network/if-up.d/ntpdate does not detach correctly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ntp (Debian) |
Fix Released
|
Unknown
|
|||
ntp (Ubuntu) |
Won't Fix
|
Medium
|
Christian Ehrhardt |
Bug Description
It seems that the intent of /etc/network/
background itself, as it creates a subshell with &.
As reported in bug 1202758, this doesn't seem to work correctly. That doesn't close the file descriptors. As a result, if something is waiting on the output of 'ifup', it will sit and wait until ntpdate is finished.
Example:
$ time sudo sh -c 'o=$(sh -c "ifdown eth0 ; ifup eth0" 2>&1) ; echo $o'
If we change the way it detaches itself to close stdout, stdderr, and
stdin, then we're fine.
I'm reporting this, but I'm not sure how much of a real problem it is. As if th
e command sends stdin and stdout to /dev/null, then debugging its output would b
e more difficult.
Example diff:
$ diff -u /etc/network/
--- /etc/network/
+++ /etc/network/
@@ -56,4 +56,4 @@
lockfile-remove $LOCKFILE
fi
-) &
+) </dev/null >/dev/null 2>&1 &
ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: ntpdate 1:4.2.6.
ProcVersionSign
Uname: Linux 3.10.0-5-generic x86_64
ApportVersion: 2.11-0ubuntu1
Architecture: amd64
Date: Mon Jul 29 15:32:30 2013
MarkForUpload: True
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: ntp
UpgradeStatus: No upgrade log present (probably fresh install)
mtime.conffile.
Changed in ntp (Ubuntu): | |
importance: | Undecided → Medium |
Changed in ntp: | |
status: | Unknown → New |
Changed in ntp (Ubuntu): | |
assignee: | nobody → ChristianEhrhardt (paelzer) |
affects: | ntp → ubuntu |
Changed in ubuntu: | |
importance: | Unknown → Undecided |
no longer affects: | ubuntu |
Changed in ntp (Debian): | |
status: | Unknown → New |
Changed in ntp (Debian): | |
status: | New → Fix Released |
for my usecase, it would probably be nicest if I could just disable this via environment variable.
perhaps:
DISABLE_NTPDATE=1 ifup eth0
and then just a simple check for that variable in the script: NTPDATE: -0}" != "0" ] && exit 0
[ "${DISABLE_