Hello,
I'm glad you sorted it out. :)
Please, mark the discussion as "solved" by manually adding the text tag "[Solved]" to the beginning of the subject of the first post.
Happy Debian !
Thanks for updating the discussion.First of all thank you for your detailed answer and sorry for this late answer.
You can replicate it as you wish, therefore you can experiment to find the best fix possible. :wink:Too bad that you don't face the same issue so that we can identify the best fix.
Yes, deepening into the internal working of systemd can be very interesting: it is what I tried to do.I agree that this is a common question, I found indeed many people trying to solve similar issue but without having a clear and systematic answer to solve this.
It would be interesting to check system logs with _netdev,nofail,x-systemd.automount in your /etc/fstab (without the two services listed below as alternative solution).In my case I must admit that I have spent much more time that expected trying to solve this issue, the extra attributes (_netdev,nofail,x-systemd.automount) in the /etc/fstab didn't really helped on my side.
Sure it will do !I fell back on the solution presented in this topic and created the same service as the one suggested :Then added the following requirements on my mount services :Code:
cat /etc/systemd/system/ping-available.service[Unit]Description=Wait for ping to be availableAfter=network-online.targetRequires=network-online.target[Service]Type=oneshotExecStart=/usr/bin/bash -c 'until /usr/bin/ping -qW 1 -c1 192.168.1.254; do sleep 1; done'RemainAfterExit=yesTimeoutSec=30[Install]WantedBy=network-online.target
This is solution is not as clean as I you have wanted but it does the job and works fine after each reboot.Code:
cat /etc/systemd/system/mnt-synology-western.mount[Unit]Description=mount point for western digital filesAfter=ping-available.serviceWants=ping-available.service[Mount]What=//192.168.1.60/Western DigitalWhere=/mnt/synology/westernType=cifsOptions=vers=3.0,credentials=/root/.synocredDirectoryMode=0700TimeoutSec=30[Install]WantedBy=multi-user.target
I also added the same requirement on my docker service as I had a container requiring the mounted directory as well.
Hope it can help other people.
I'm glad you sorted it out. :)
Please, mark the discussion as "solved" by manually adding the text tag "[Solved]" to the beginning of the subject of the first post.
Happy Debian !
Statistics: Posted by Aki — 2024-06-09 08:28