1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-25 07:00:43 +00:00
nixpkgs/pkgs/tools/networking/ddclient/default.nix
Tuomas Tynkkynen 7532c5379d ddclient: Force line buffering on stdout
Status messages of ddclient go to stdout, which is block buffered by
default, so most of its output won't appear in the journal until it is
exiting:

-- Reboot --
Apr 19 11:31:04 xen systemd[1]: Starting Dynamic DNS Client...
Apr 19 11:31:04 xen systemd[1]: Started Dynamic DNS Client.
Apr 19 11:31:53 xen systemd[1]: Stopping Dynamic DNS Client...
Apr 19 11:31:53 xen ddclient[530]: === opt ====
Apr 19 11:31:53 xen ddclient[530]: opt{cache}                           : <undefined>
Apr 19 11:31:53 xen ddclient[530]: opt{cmd}                             : <undefined>
...

Fix this by adding a patch to set line buffering on stdout.
2015-04-19 12:32:04 +03:00

30 lines
875 B
Nix

{buildPerlPackage, fetchurl, perlPackages, iproute}:
buildPerlPackage {
name = "ddclient-3.8.2";
src = fetchurl {
url = mirror://sourceforge/ddclient/ddclient-3.8.2.tar.gz ;
sha256 = "17mcdqxcwa6c05m8xhxi4r37j4qvbp3wgbpvzqgmrmgwava5wcrw";
};
buildInputs = [ perlPackages.IOSocketSSL perlPackages.DigestSHA1 ];
patches = [ ./ddclient-foreground.patch ./ddclient-line-buffer-stdout.patch ];
# Use iproute2 instead of ifconfig
preConfigure = ''
touch Makefile.PL
substituteInPlace ddclient --replace 'in the output of ifconfig' 'in the output of ip addr show'
substituteInPlace ddclient --replace 'ifconfig -a' '${iproute}/sbin/ip addr show'
substituteInPlace ddclient --replace 'ifconfig $arg' '${iproute}/sbin/ip addr show $arg'
'';
installPhase = ''
mkdir -p $out/bin
cp ddclient $out/bin
'';
doCheck = false;
}