0

I added a WebDAV folder to /etc/fstab

https://my.owncloud.de/remote.php/dav/files/matt/ /home/matt/Owncloud davfs user,rw,auto 0 0

but when it's mounted then Ubuntu doesn't shut down. See more details in the attached image.

Shutdown

  • 1
    Unmounting it before the shutdown does not work? – Rinzwind Mar 09 '23 at 15:15
  • Unmounting before shutdown work's but I don't want to always unmounting it myself. I want that it's mounted automatically on boot and unmounted on shutdown. –  Mar 09 '23 at 21:27
  • 1
    so you add it to the system so it is executed before a shutdown. See for insrance https://askubuntu.com/questions/779154/how-do-i-get-my-script-to-run-before-any-shutdown-sequence-like-unmounting-my-ex – Rinzwind Mar 10 '23 at 07:26
  • Thx now it's shutting down well –  Mar 10 '23 at 11:35
  • could you make what you did an answer and accept it? :) – Rinzwind Mar 10 '23 at 15:09

1 Answers1

1
  1. Create a custom script for unmount

    nano /home/matt/Scripts/umountCloud.sh

  2. Add unmount command

    umount /home/matt/Owncloud

  3. Make it executable

    chmod +x /home/matt/Scripts/umountCloud.sh

  4. Create a systems script

    sudo nano /etc/systemd/system/preShutdown.service

  5. Add following lines to execute the custom script on shutdown

    [Unit] Description=Shutdown Process

    [Service] Type=oneshot ExecStart=/home/matthias/Scripts/umountCloud.sh

    [Install] WantedBy=multi-user.target