How to set timeout for the systemd start job “dev-md125.device” (mdadm)












0















I've setup a RAID1 device with mdadm on CentOS 7. The system boots fine when both disks are inserted but hangs when there is only one.



The error occurs at boot with the following message from systemd:




A start job is running for dev-md125.device (54s / no limit)




The problem here is the "no limit" part. How do I add a limit so that I can allow the system to boot?



There is nothing I can see in my mdadm.conf:



$cat /etc/mdadm.conf
MAILADDR root
AUTO +imsm +1.x -all
ARRAY /dev/md/archive:boot level=raid1 num-devices=2 UUID=1104ad14:c378ffcd:5d2c92be:ffaace05
ARRAY /dev/md/archive:root level=raid1 num-devices=2 UUID=f30b5fcf:d194f469:404a464f:c1b0ba0a
ARRAY /dev/md/archive:swap level=raid1 num-devices=2 UUID=d6490a08:3c6a7311:cb7ddd3f:9eac77ff


I tried adding timeouts to fstab:



$cat /etc/fstab
UUID=309bc32c-d75b-4ddb-9141-f234be9b72ca / xfs defaults,x-systemd.device-timeout=5 1 1
UUID=b336e2bb-f5d2-4065-9aed-9de77c02c0e2 /boot xfs defaults,x-systemd.device-timeout=5 1 2
UUID=93434118-d16e-4cc7-8ff0-c0891bcbcb72 swap swap defaults,x-systemd.device-timeout=5 0 0


I thought that /etc/systemd/system/sysinit.target.wants/dmraid-activation.service might be responsible but adding a timeout did not change the behavior (still no limit):



$cat /etc/systemd/system/sysinit.target.wants/dmraid-activation.service
[Unit]
Description=Activation of DM RAID sets
DefaultDependencies=no
Conflicts=shutdown.target
After=systemd-udev-settle.service
Before=lvm2-activation-early.service cryptsetup.target local-fs.target shutdown.target
Wants=systemd-udev-settle.service

[Service]
ExecStart=/lib/systemd/rhel-dmraid-activation
Type=oneshot
TimeoutSec=5

[Install]
WantedBy=sysinit.target









share|improve this question





























    0















    I've setup a RAID1 device with mdadm on CentOS 7. The system boots fine when both disks are inserted but hangs when there is only one.



    The error occurs at boot with the following message from systemd:




    A start job is running for dev-md125.device (54s / no limit)




    The problem here is the "no limit" part. How do I add a limit so that I can allow the system to boot?



    There is nothing I can see in my mdadm.conf:



    $cat /etc/mdadm.conf
    MAILADDR root
    AUTO +imsm +1.x -all
    ARRAY /dev/md/archive:boot level=raid1 num-devices=2 UUID=1104ad14:c378ffcd:5d2c92be:ffaace05
    ARRAY /dev/md/archive:root level=raid1 num-devices=2 UUID=f30b5fcf:d194f469:404a464f:c1b0ba0a
    ARRAY /dev/md/archive:swap level=raid1 num-devices=2 UUID=d6490a08:3c6a7311:cb7ddd3f:9eac77ff


    I tried adding timeouts to fstab:



    $cat /etc/fstab
    UUID=309bc32c-d75b-4ddb-9141-f234be9b72ca / xfs defaults,x-systemd.device-timeout=5 1 1
    UUID=b336e2bb-f5d2-4065-9aed-9de77c02c0e2 /boot xfs defaults,x-systemd.device-timeout=5 1 2
    UUID=93434118-d16e-4cc7-8ff0-c0891bcbcb72 swap swap defaults,x-systemd.device-timeout=5 0 0


    I thought that /etc/systemd/system/sysinit.target.wants/dmraid-activation.service might be responsible but adding a timeout did not change the behavior (still no limit):



    $cat /etc/systemd/system/sysinit.target.wants/dmraid-activation.service
    [Unit]
    Description=Activation of DM RAID sets
    DefaultDependencies=no
    Conflicts=shutdown.target
    After=systemd-udev-settle.service
    Before=lvm2-activation-early.service cryptsetup.target local-fs.target shutdown.target
    Wants=systemd-udev-settle.service

    [Service]
    ExecStart=/lib/systemd/rhel-dmraid-activation
    Type=oneshot
    TimeoutSec=5

    [Install]
    WantedBy=sysinit.target









    share|improve this question



























      0












      0








      0








      I've setup a RAID1 device with mdadm on CentOS 7. The system boots fine when both disks are inserted but hangs when there is only one.



      The error occurs at boot with the following message from systemd:




      A start job is running for dev-md125.device (54s / no limit)




      The problem here is the "no limit" part. How do I add a limit so that I can allow the system to boot?



      There is nothing I can see in my mdadm.conf:



      $cat /etc/mdadm.conf
      MAILADDR root
      AUTO +imsm +1.x -all
      ARRAY /dev/md/archive:boot level=raid1 num-devices=2 UUID=1104ad14:c378ffcd:5d2c92be:ffaace05
      ARRAY /dev/md/archive:root level=raid1 num-devices=2 UUID=f30b5fcf:d194f469:404a464f:c1b0ba0a
      ARRAY /dev/md/archive:swap level=raid1 num-devices=2 UUID=d6490a08:3c6a7311:cb7ddd3f:9eac77ff


      I tried adding timeouts to fstab:



      $cat /etc/fstab
      UUID=309bc32c-d75b-4ddb-9141-f234be9b72ca / xfs defaults,x-systemd.device-timeout=5 1 1
      UUID=b336e2bb-f5d2-4065-9aed-9de77c02c0e2 /boot xfs defaults,x-systemd.device-timeout=5 1 2
      UUID=93434118-d16e-4cc7-8ff0-c0891bcbcb72 swap swap defaults,x-systemd.device-timeout=5 0 0


      I thought that /etc/systemd/system/sysinit.target.wants/dmraid-activation.service might be responsible but adding a timeout did not change the behavior (still no limit):



      $cat /etc/systemd/system/sysinit.target.wants/dmraid-activation.service
      [Unit]
      Description=Activation of DM RAID sets
      DefaultDependencies=no
      Conflicts=shutdown.target
      After=systemd-udev-settle.service
      Before=lvm2-activation-early.service cryptsetup.target local-fs.target shutdown.target
      Wants=systemd-udev-settle.service

      [Service]
      ExecStart=/lib/systemd/rhel-dmraid-activation
      Type=oneshot
      TimeoutSec=5

      [Install]
      WantedBy=sysinit.target









      share|improve this question
















      I've setup a RAID1 device with mdadm on CentOS 7. The system boots fine when both disks are inserted but hangs when there is only one.



      The error occurs at boot with the following message from systemd:




      A start job is running for dev-md125.device (54s / no limit)




      The problem here is the "no limit" part. How do I add a limit so that I can allow the system to boot?



      There is nothing I can see in my mdadm.conf:



      $cat /etc/mdadm.conf
      MAILADDR root
      AUTO +imsm +1.x -all
      ARRAY /dev/md/archive:boot level=raid1 num-devices=2 UUID=1104ad14:c378ffcd:5d2c92be:ffaace05
      ARRAY /dev/md/archive:root level=raid1 num-devices=2 UUID=f30b5fcf:d194f469:404a464f:c1b0ba0a
      ARRAY /dev/md/archive:swap level=raid1 num-devices=2 UUID=d6490a08:3c6a7311:cb7ddd3f:9eac77ff


      I tried adding timeouts to fstab:



      $cat /etc/fstab
      UUID=309bc32c-d75b-4ddb-9141-f234be9b72ca / xfs defaults,x-systemd.device-timeout=5 1 1
      UUID=b336e2bb-f5d2-4065-9aed-9de77c02c0e2 /boot xfs defaults,x-systemd.device-timeout=5 1 2
      UUID=93434118-d16e-4cc7-8ff0-c0891bcbcb72 swap swap defaults,x-systemd.device-timeout=5 0 0


      I thought that /etc/systemd/system/sysinit.target.wants/dmraid-activation.service might be responsible but adding a timeout did not change the behavior (still no limit):



      $cat /etc/systemd/system/sysinit.target.wants/dmraid-activation.service
      [Unit]
      Description=Activation of DM RAID sets
      DefaultDependencies=no
      Conflicts=shutdown.target
      After=systemd-udev-settle.service
      Before=lvm2-activation-early.service cryptsetup.target local-fs.target shutdown.target
      Wants=systemd-udev-settle.service

      [Service]
      ExecStart=/lib/systemd/rhel-dmraid-activation
      Type=oneshot
      TimeoutSec=5

      [Install]
      WantedBy=sysinit.target






      centos systemd raid mdadm software-raid






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 3 '18 at 0:35







      Zhro

















      asked Nov 3 '18 at 0:26









      ZhroZhro

      342413




      342413






















          1 Answer
          1






          active

          oldest

          votes


















          0














          I haven't tried myself but according to RedHat official site you need to proceed as follows:



          Imagine you want to specify a timeout for httpd.service.




          1. Copy the file:


            cp /usr/lib/systemd/system/httpd.service /etc/systemd/system/httpd.service




          2. Open the file and put TimeoutStartSec=10 parameter under the [service] section.

          3. Reload the configuracion.


            systemctl daemon-reload





          Please refer to here for more info.



          I hope this helps.






          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%2f479512%2fhow-to-set-timeout-for-the-systemd-start-job-dev-md125-device-mdadm%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









            0














            I haven't tried myself but according to RedHat official site you need to proceed as follows:



            Imagine you want to specify a timeout for httpd.service.




            1. Copy the file:


              cp /usr/lib/systemd/system/httpd.service /etc/systemd/system/httpd.service




            2. Open the file and put TimeoutStartSec=10 parameter under the [service] section.

            3. Reload the configuracion.


              systemctl daemon-reload





            Please refer to here for more info.



            I hope this helps.






            share|improve this answer




























              0














              I haven't tried myself but according to RedHat official site you need to proceed as follows:



              Imagine you want to specify a timeout for httpd.service.




              1. Copy the file:


                cp /usr/lib/systemd/system/httpd.service /etc/systemd/system/httpd.service




              2. Open the file and put TimeoutStartSec=10 parameter under the [service] section.

              3. Reload the configuracion.


                systemctl daemon-reload





              Please refer to here for more info.



              I hope this helps.






              share|improve this answer


























                0












                0








                0







                I haven't tried myself but according to RedHat official site you need to proceed as follows:



                Imagine you want to specify a timeout for httpd.service.




                1. Copy the file:


                  cp /usr/lib/systemd/system/httpd.service /etc/systemd/system/httpd.service




                2. Open the file and put TimeoutStartSec=10 parameter under the [service] section.

                3. Reload the configuracion.


                  systemctl daemon-reload





                Please refer to here for more info.



                I hope this helps.






                share|improve this answer













                I haven't tried myself but according to RedHat official site you need to proceed as follows:



                Imagine you want to specify a timeout for httpd.service.




                1. Copy the file:


                  cp /usr/lib/systemd/system/httpd.service /etc/systemd/system/httpd.service




                2. Open the file and put TimeoutStartSec=10 parameter under the [service] section.

                3. Reload the configuracion.


                  systemctl daemon-reload





                Please refer to here for more info.



                I hope this helps.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 10 mins ago









                Manuel FlorianManuel Florian

                364




                364






























                    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.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f479512%2fhow-to-set-timeout-for-the-systemd-start-job-dev-md125-device-mdadm%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

                    CARDNET

                    Boot-repair Failure: Unable to locate package grub-common:i386

                    濃尾地震