Which service provides time-sync.target in systemd?











up vote
4
down vote

favorite












How can I recognize which service provides time-sync.target in systemd? Is it configurable or is it hardcoded in systemd? How can I configure my custom time-sync daemon/service to provide this target?










share|improve this question




























    up vote
    4
    down vote

    favorite












    How can I recognize which service provides time-sync.target in systemd? Is it configurable or is it hardcoded in systemd? How can I configure my custom time-sync daemon/service to provide this target?










    share|improve this question


























      up vote
      4
      down vote

      favorite









      up vote
      4
      down vote

      favorite











      How can I recognize which service provides time-sync.target in systemd? Is it configurable or is it hardcoded in systemd? How can I configure my custom time-sync daemon/service to provide this target?










      share|improve this question















      How can I recognize which service provides time-sync.target in systemd? Is it configurable or is it hardcoded in systemd? How can I configure my custom time-sync daemon/service to provide this target?







      systemd date






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 5 at 13:42









      Jeff Schaller

      38.1k1053124




      38.1k1053124










      asked Dec 5 at 13:16









      Filip Havlíček

      232




      232






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          5
          down vote



          accepted










          Run



          systemctl show time-sync.target


          to see the information and configuration maintained by systemd for this target. In particular, this will tell you that it is part of the special systemd units and documented there:




          Services responsible for synchronizing the system clock from a remote source (such as NTP client implementations) should pull in this target and order themselves before it. All services where correct time is essential should be ordered after this unit, but not pull it in. systemd automatically adds dependencies of type After= for this target unit to all SysV init script service units with an LSB header referring to the "$time" facility.




          It is fully configurable (use systemctl edit to override any aspect you want to). As mentioned above, services which provide time synchronisation (e.g. systemd-timesyncd.service) declare that they want this target, and order themselves before it; services which need time synchronisation order themselves after it.



          To configure a time synchronisation service, copy the relevant parts of systemd-timesync’s configuration:



          [Unit]
          Before=time-sync.target
          Wants=time-sync.target





          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f486146%2fwhich-service-provides-time-sync-target-in-systemd%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            5
            down vote



            accepted










            Run



            systemctl show time-sync.target


            to see the information and configuration maintained by systemd for this target. In particular, this will tell you that it is part of the special systemd units and documented there:




            Services responsible for synchronizing the system clock from a remote source (such as NTP client implementations) should pull in this target and order themselves before it. All services where correct time is essential should be ordered after this unit, but not pull it in. systemd automatically adds dependencies of type After= for this target unit to all SysV init script service units with an LSB header referring to the "$time" facility.




            It is fully configurable (use systemctl edit to override any aspect you want to). As mentioned above, services which provide time synchronisation (e.g. systemd-timesyncd.service) declare that they want this target, and order themselves before it; services which need time synchronisation order themselves after it.



            To configure a time synchronisation service, copy the relevant parts of systemd-timesync’s configuration:



            [Unit]
            Before=time-sync.target
            Wants=time-sync.target





            share|improve this answer

























              up vote
              5
              down vote



              accepted










              Run



              systemctl show time-sync.target


              to see the information and configuration maintained by systemd for this target. In particular, this will tell you that it is part of the special systemd units and documented there:




              Services responsible for synchronizing the system clock from a remote source (such as NTP client implementations) should pull in this target and order themselves before it. All services where correct time is essential should be ordered after this unit, but not pull it in. systemd automatically adds dependencies of type After= for this target unit to all SysV init script service units with an LSB header referring to the "$time" facility.




              It is fully configurable (use systemctl edit to override any aspect you want to). As mentioned above, services which provide time synchronisation (e.g. systemd-timesyncd.service) declare that they want this target, and order themselves before it; services which need time synchronisation order themselves after it.



              To configure a time synchronisation service, copy the relevant parts of systemd-timesync’s configuration:



              [Unit]
              Before=time-sync.target
              Wants=time-sync.target





              share|improve this answer























                up vote
                5
                down vote



                accepted







                up vote
                5
                down vote



                accepted






                Run



                systemctl show time-sync.target


                to see the information and configuration maintained by systemd for this target. In particular, this will tell you that it is part of the special systemd units and documented there:




                Services responsible for synchronizing the system clock from a remote source (such as NTP client implementations) should pull in this target and order themselves before it. All services where correct time is essential should be ordered after this unit, but not pull it in. systemd automatically adds dependencies of type After= for this target unit to all SysV init script service units with an LSB header referring to the "$time" facility.




                It is fully configurable (use systemctl edit to override any aspect you want to). As mentioned above, services which provide time synchronisation (e.g. systemd-timesyncd.service) declare that they want this target, and order themselves before it; services which need time synchronisation order themselves after it.



                To configure a time synchronisation service, copy the relevant parts of systemd-timesync’s configuration:



                [Unit]
                Before=time-sync.target
                Wants=time-sync.target





                share|improve this answer












                Run



                systemctl show time-sync.target


                to see the information and configuration maintained by systemd for this target. In particular, this will tell you that it is part of the special systemd units and documented there:




                Services responsible for synchronizing the system clock from a remote source (such as NTP client implementations) should pull in this target and order themselves before it. All services where correct time is essential should be ordered after this unit, but not pull it in. systemd automatically adds dependencies of type After= for this target unit to all SysV init script service units with an LSB header referring to the "$time" facility.




                It is fully configurable (use systemctl edit to override any aspect you want to). As mentioned above, services which provide time synchronisation (e.g. systemd-timesyncd.service) declare that they want this target, and order themselves before it; services which need time synchronisation order themselves after it.



                To configure a time synchronisation service, copy the relevant parts of systemd-timesync’s configuration:



                [Unit]
                Before=time-sync.target
                Wants=time-sync.target






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 5 at 13:34









                Stephen Kitt

                162k24360438




                162k24360438






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f486146%2fwhich-service-provides-time-sync-target-in-systemd%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Bressuire

                    Cabo Verde

                    Gyllenstierna