<div dir="ltr">The custom time syncing service file does not have "Before=time-sync.target".<div><br></div><div>In fact, not only when the time changes by the custom time syncing service ,but also when I set the time manually by "date -s 2015-05-01 11:08:00", the timer and the same-name service will run.</div><div><br></div><div><br></div><div>Here is the custom time syncing service file:</div><div><div>#cat /lib/systemd/system/XXXXXX.service</div><div>[Unit]</div><div>Description=XXXXXXX Daemon</div><div>After=ppp.service</div><div><br></div><div>[Service]</div><div>Type=simple</div><div>ExecStart=/usr/lib/XXXXXX/xxxxxx/bin/xxxxxx</div><div>Restart=always</div></div><div><br></div><div><br></div><div>Here is the log when I set the time manually by "date -s 2015-05-01 11:08:00"</div><div>#systemctl status updateimage.timer -l</div><div>— updateimage.timer - Update image</div><div> Loaded: loaded (/lib/systemd/system/updateimage.timer; disabled)</div><div> Active: active (waiting) since Fri 2010-01-01 08:00:04 CST; 5 years 3 months ago</div><div><br></div><div>May 01 11:08:00 systemd[1]: Timer elapsed on updateimage.timer</div><div>May 01 11:08:00 systemd[1]: updateimage.timer changed waiting -> running</div><div>May 01 11:08:00 systemd[1]: updateimage.timer got notified about unit deactivation.</div><div>May 01 11:08:00 systemd[1]: updateimage.timer: Realtime timer elapses at Sat 2015-05-02 02:00:00 CST.</div><div><br></div><div>#systemctl status updateimage.service -l</div><div>â— updateimage.service - Update image</div><div> Loaded: loaded (/lib/systemd/system/updateimage.service; static)</div><div> Active: inactive (dead) since Fri 2015-05-01 11:08:00 CST; 18min ago</div><div> Process: 579 ExecStart=/bin/updateImage.sh (code=exited, status=0/SUCCESS)</div><div> Main PID: 579 (code=exited, status=0/SUCCESS)</div><div><br></div><div>May 01 11:08:00 systemd[1]: Enqueued job updateimage.service/start as 1019</div><div>May 01 11:08:00 systemd[1]: Forked /bin/updateImage.sh as 579</div><div>May 01 11:08:00 systemd[1]: updateimage.service changed dead -> start</div><div>May 01 11:08:00 systemd[579]: Executing: /bin/updateImage.sh</div><div>May 01 11:08:00 systemd[1]: Child 579 belongs to updateimage.service</div><div><br></div><div><br></div><div>--</div><div>laborish</div><div><br></div><div><br></div><div> <br><div class="gmail_extra"><br><div class="gmail_quote">2015-05-01 10:34 GMT+08:00 Cameron Norman <span dir="ltr"><<a href="mailto:camerontnorman@gmail.com" target="_blank">camerontnorman@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On Thu, Apr 30, 2015 at 6:35 PM, Likang Wang <<a href="mailto:laborish@gmail.com">laborish@gmail.com</a>> wrote:<br>
> Hi all,<br>
<span class="">><br>
> The entire system is running on an embedded box, and the system time will be<br>
> set to 2008-01-01 00:00:00 after every reboot. My app running on the box<br>
> will get the real time from my server and update time on the box after every<br>
> booting.(I could not use NTP or systemd-timesyncd for some other reason)<br>
<br>
</span>Does the service file for this custom time syncing service have the<br>
directive `Before=time-sync.target` ? If it does, are you sure that<br>
when it is considered running by systemd that the time has indeed been<br>
synced?<br>
<br>
Cheers,<br>
--<br>
Cameron Norman<br>
</blockquote></div><br></div></div></div>