From 86bd1cd1e5257f27d80f92f39dbd7facc5f17b0e Mon Sep 17 00:00:00 2001 From: ston1th Date: Thu, 14 Apr 2022 00:14:11 +0200 Subject: [PATCH] fixed rc --- scripts/install_openbsd.sh | 42 +++++--------------------------------- 1 file changed, 5 insertions(+), 37 deletions(-) diff --git a/scripts/install_openbsd.sh b/scripts/install_openbsd.sh index fa14751..90ddc4a 100644 --- a/scripts/install_openbsd.sh +++ b/scripts/install_openbsd.sh @@ -11,20 +11,18 @@ cat <<"EOF">/etc/rc.d/cachefs #!/bin/sh daemon="/usr/local/sbin/cachefs" -daemon_flags="-src /mnt/nfs -dst /mnt/cache -data /var/cachefs/md.json -listen :9090 -webdav :9091 -quota 10 -v 2" -daemon_logger="daemon.info" +daemon_flags="-src file:///mnt/nfs -dst file:///mnt/cache -data /var/cachefs/md.json -listen :9090 -webdav :9091 -cache :9092 -quota 10" daemon_user="_cachefs" . /etc/rc.d/rc.subr -pexp="${daemon}.*" +pexp=".*${daemon}.*" rc_bg=YES rc_reload=NO -rc_pre() { - if ! mount | grep -q /mnt/cache; then - bioctl -c C -p /root/sd1_key -l sd1a softraid0 && { sleep 1; fsck /dev/sd2a && mount /mnt/cache; } - fi +rc_start() { + ${rcexec} "${daemon} ${daemon_flags} < /dev/null 2>&1 | \ + logger -ip daemon.info -t cachefs" } rc_cmd $1 @@ -33,36 +31,6 @@ chmod 555 /etc/rc.d/cachefs mkdir -p /mnt/cache /var/cachefs -fdisk -iy sd1 - -disklabel -E sd1 </dev/null|sha256 >/root/sd1_key -chmod 600 /root/sd1_key -bioctl -c C -p /root/sd1_key -l sd1a softraid0 - -fdisk -iy sd2 -disklabel -E sd2 <>/etc/fstab -echo "sync; umount /mnt/cache && bioctl -d sd2" >>/etc/rc.shutdown -chmod 700 /etc/rc.shutdown - -mount /mnt/cache chown _cachefs:_cachefs /mnt/cache /var/cachefs rcctl enable cachefs