Forum

Full Version: Services start before USB mount
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
My Pi mounts its USB drives faithfully at /media/LABEL on every boot. However, some services start before the mount has happened, minidlna and transmission-daemon to name two.

The Transmission service file (/etc/init/transmission-daemon.conf) indicates that the Upstart service will start on the filesystem and net-device-up IFACE=lo triggers and the minidlna init script (/etc/init.d/minidlna) indicates that the service will start on the $local_fs $network $remote_fs triggers. But, none of these triggers prevent the service from starting before the mount of my USB drives have finished, leading the services to treat files in those locations as missing.

Should I modify the Upstart configuration files and init scripts to wait on a different trigger set? If so, upon which events should it wait?
(20th Mar, 2019 03:47 PM)palswim Wrote: [ -> ]My Pi mounts its USB drives faithfully at /media/LABEL on every boot. However, some services start before the mount has happened, minidlna and transmission-daemon to name two.

The Transmission service file (/etc/init/transmission-daemon.conf) indicates that the Upstart service will start on the filesystem and net-device-up IFACE=lo triggers and the minidlna init script (/etc/init.d/minidlna) indicates that the service will start on the $local_fs $network $remote_fs triggers. But, none of these triggers prevent the service from starting before the mount of my USB drives have finished, leading the services to treat files in those locations as missing.

It's a bit complicated to use a trigger event, because mounting of external disks is completely async triggered by udev.

Quote:Should I modify the Upstart configuration files and init scripts to wait on a different trigger set? If so, upon which events should it wait?

This is bad idea, because those files will be overwritten if package which owned that script will be updated

Wouldn't it be better to put those mounts into /etc/fstab?
Reference URL's