Start Systemd Service After Device Appears: Difference between revisions
Jump to navigation
Jump to search
(Created page with "What if you install a service on a separate disk that is not necessarily mounted at boot? * Create fstab entries with nofail option /dev/dbvg/db2mspr /home/db2mspr...") |
(No difference)
|
Revision as of 19:27, 2 November 2020
What if you install a service on a separate disk that is not necessarily mounted at boot?
- Create fstab entries with nofail option
/dev/dbvg/db2mspr /home/db2mspr xfs nofail 0 0
- Create UDEV rule to activate the vg and mount the fs once the device appears
KERNEL=="devNameHere", RUN+="/bin/bash -c '/sbin/pvscan --cache -a ay && mount -a -O nofail'"
- Add a require directive for the mount point to the service file
[Unit] RequiresMountsFor=/home/db2mspr ...