packages/utils/uvol/files/uvol.init
Daniel Golle 6772c0fe44
uvol: clean up paths and fix delayed startup
* Winchester discs can take a long time to spin up which results in
   blockd also taking a while to complete to start.

 * Make sure uvol only gets started once blockd is ready.

 * Clean up paths (use '/tmp/run/uvol' everywhere instead of relying on
   the '/var' -> '/tmp' symlink)

 * Create 'apk' folder when initializing .meta volume.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-02-18 03:09:06 +00:00

22 lines
349 B
Bash

#!/bin/sh /etc/rc.common
START=99
USE_PROCD=1
NAME=uvol
PROG=/usr/sbin/uvol
start_service() {
[ "${__BOOT_UVOL}" = "1" ] && return 0
procd_open_instance "$NAME"
procd_set_param command "$PROG" boot
procd_close_instance
}
boot() {
__BOOT_UVOL=1 start
}
service_triggers() {
procd_add_raw_trigger "mount.ready" 200 /etc/init.d/uvol start
}