Package Details: htpdate 1.2.2-3

Git Clone URL: https://aur.archlinux.org/htpdate.git (read-only, click to copy)
Package Base: htpdate
Description: A client for time synchronisation
Upstream URL: http://www.vervest.org/htp/
Keywords: time
Licenses: GPL2
Submitter: jryan
Maintainer: dschrempf
Last Packager: dschrempf
Votes: 4
Popularity: 0.015074
First Submitted: 2015-08-25 16:54
Last Updated: 2020-05-06 11:20

Latest Comments

1 2 Next › Last »

pedh commented on 2020-05-06 13:22

It works now, Thank you very much!

dschrempf commented on 2020-05-06 11:21

Thank you. I have updated the package. I had to recreate the patch myself, because yours was rejected. Did you use diff -u to create the patch? Anyways, please let me know if it works!

pedh commented on 2020-05-06 08:01

The systemd htpdate unit hangs up and reports that no process was found.

May 06 14:07:33 pedh systemd[1]: htpdate.service: New main PID 24661 does not exist or is a zombie.

The process actually exists, but the PID value is different with the value from the pid file.

➜  ~ ps auxww | grep htpdate
root      286805  0.0  0.0   2320    76 ?        S    14:07   0:00 /usr/bin/htpdate -D -a -s www.linux.org www.freebsd.org ntp.neu.edu.cn www.kernel.org

After reading the source code, I found that the PID value, which is pid_t type, should be signed integer ( glibc reference ), is truncated to unsigned short and written to the pid file, and cause the incorrectness. The systemd unit starts successfully after the error was fixed.

Here is the patch.

htpdate.c

*************** static void runasdaemon( char *pidfile )
*** 499,505 ****
            printlog( 1, "Error writing pid file" );
            exit(1);
        } else {
!           fprintf( pid_file, "%u\n", (unsigned short)pid );
            fclose( pid_file );
        }
        printlog( 0, "htpdate version "VERSION" started" );
--- 499,505 ----
            printlog( 1, "Error writing pid file" );
            exit(1);
        } else {
!           fprintf( pid_file, "%d\n", (signed int)pid );
            fclose( pid_file );
        }
        printlog( 0, "htpdate version "VERSION" started" );

dschrempf commented on 2020-01-23 14:57

Thank you for your comment! I have fixed the PID file bug, but still use a forking systemd file. It works on my computer. Please let me know, if you still have problems!

wongsyrone commented on 2020-01-22 02:40

It fails to start due to incorrect PID. The current workaround is run as oneshot and create a timer.

/etc/systemd/system/htpdate.service

[Unit]
Description=Htpdate daemon

[Service]
Type=oneshot
StandardError=journal
User=root
ExecStart=/usr/bin/htpdate -a -s -i /run/htpdate.pid -P 192.168.8.60:808 -u root:root www.linux.org www.freebsd.org ntp.neu.edu.cn www.kernel.org

[Install]
WantedBy=multi-user.target

/etc/systemd/system/htpdate.timer

[Unit]
Description=Htpdate 30sec timer

[Timer]
OnBootSec=0min
OnCalendar=*-*-* *:*:30
Unit=htpdate.service

[Install]
WantedBy=basic.target

dschrempf commented on 2019-02-06 13:37

Hello,

I tried to apply the patches, but the first one 100-xxx was rejected. If you want, you can investigate the issue.

patching file htpdate.c Hunk #1 succeeded at 391 (offset 32 lines). Hunk #2 FAILED at 377. 1 out of 2 hunks FAILED -- saving rejects to file htpdate.c.rej

--- htpdate.c +++ htpdate.c @@ -377,7 +377,7 @@ static int htpdate_adjtimex( double drif printlog( 1, "seteuid()" ); exit(1); } else { - return( ntp_adjtime(&tmx) ); + return( adjtimex(&tmx) ); }

}

wongsyrone commented on 2019-02-04 08:58

Do you mind add patches from OpenWrt?

https://github.com/openwrt/packages/tree/master/net/htpdate/patches

dschrempf commented on 2019-02-03 22:16

Thanks, updated.

wongsyrone commented on 2019-02-02 02:21

The pid path should be /var/run/htpdate.pid.

BTW, my command line is /usr/bin/htpdate -D -a -s -i /var/run/htpdate.pid www.linux.org www.freebsd.org ntp.neu.edu.cn www.kernel.org

jryan commented on 2016-03-08 16:23

Updated to 1.1.3