Package Details: htpdate 1.2.2-3

Git Clone URL: (read-only, click to copy)
Package Base: htpdate
Description: A client for time synchronisation
Upstream URL:
Keywords: time
Licenses: GPL2
Submitter: jryan
Maintainer: None
Last Packager: dschrempf
Votes: 5
Popularity: 0.011895
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

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.


*************** static void runasdaemon( char *pidfile )
*** 499,505 ****
            printlog( 1, "Error writing pid file" );
        } 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" );
        } 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.


Description=Htpdate daemon

ExecStart=/usr/bin/htpdate -a -s -i /run/ -P -u root:root



Description=Htpdate 30sec timer

OnCalendar=*-*-* *:*:30


dschrempf commented on 2019-02-06 13:37


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?

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/

BTW, my command line is /usr/bin/htpdate -D -a -s -i /var/run/

jryan commented on 2016-03-08 16:23

Updated to 1.1.3