Sample Header Ad - 728x90

Wait for mount before starting services

8 votes
1 answer
9688 views
I have a Raspbian 9 system with an external hard disk, which gets mounted as /srv/file during boot. I am running PostgreSQL and BIND, both of which have data files residing on that disk. On startup, PostgreSQL routinely fails to start because the external disk filesystem is not mounted yet. BIND starts but, for the same reason, name resolution fails for anything stored on the file system. systemctl list-units | grep mount tells me the systemd unit for the file system is srv-file.mount. I then went and added Requires=srv-file.mount to the [Unit] section of bind9.service and postgresql.service (neither has any other startup requirement), but still to no avail. What am I missing?
Asked by user149408 (1515 rep)
Jun 13, 2021, 04:24 PM
Last activity: Dec 20, 2024, 08:34 PM