Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 872246 Details for
Bug 890961
sys-fs/bees missing openrc initscript
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
bees init.d script
bees.initd (text/plain), 2.72 KB, created by
Forza
on 2023-10-06 20:52:05 UTC
(
hide
)
Description:
bees init.d script
Filename:
MIME Type:
Creator:
Forza
Created:
2023-10-06 20:52:05 UTC
Size:
2.72 KB
patch
obsolete
>#!/sbin/openrc-run > ># shellcheck shell=bash > >## bees variables >rundir="/run/bees" >mnt="$rundir/mnt/${fsuuid}" >device="/dev/disk/by-uuid/${fsuuid}" >beeshome="${mnt}/.beeshome" >hashfile="${beeshome}/beeshash.dat" > ># optional variables can be set in conf.d >: "${logfile:="/var/log/bees/${RC_SVCNAME}.log"}" >: "${loglevel:=2}" >: "${bees_args:="-m 1"}" >export BEESSTATUS="${statusfile:-${rundir}/${fsuuid}.status}" > >## OpenRC >name="${RC_SVCNAME}" >description="Best-Effort Extent-Same, a btrfs dedupe agent" >command="/opt/bees/lib/bees/bees" >command_args="-v ${loglevel} ${bees_args} \"${mnt}\" " >command_background="true" >extra_started_commands="suspend resume" >description_suspend="Suspends bees without unloading it." >description_resume="Resumes normal operation." > >start_stop_daemon_args="--stdout ${logfile} --stderr ${logfile}" >pidfile="/run/${RC_SVCNAME}.pid" >retry=${GRACEFUL_TIMEOUT:-60} > >depend() { > use lvm device-mapper > after * >} > >checkconfig() { > if [ -z $hashfile ]; then > eerror "hashsize not set!" > return 1 > fi > if [ ! -b "${device}" ]; then > eerror "${device} not found!" > return 1 > fi > if [ ! "$(blkid -s TYPE -o value "${device}")" == "btrfs" ]; then > eerror "${device} is not a btrfs filesystem" > return 1 > fi; > if [ ! -z "${logfile}" ]; then > checkpath -f -m 0600 -o root:root "${logfile}" > fi >} > >start_pre() { > ebegin "Config check" > checkconfig || return 1 > > if findmnt "${mnt}" >/dev/null ; then > eerror "${mnt} is already mounted. Aborting." > return 1 > fi > checkpath -d -m 0700 -o root:root "${rundir}" > checkpath -d -m 0700 -o root:root "${rundir}/mnt" > > ebegin "Preparing ${fsuuid} mountpoint" > mount -osubvolid=5 "${device}" "${mnt}" || return 1 > if [ ! -d "${beeshome}" ]; then > btrfs subvolume create "${beeshome}" || return 1 > checkpath -d -m 0700 -o root:root "${beeshome}" > else > btrfs subvolume show "${beeshome}" > /dev/null || return 1 > fi > > checkpath -d -m 0700 -o root:root "${beeshome}" > checkpath -f -m 0600 -o root:root "${hashfile}" > > old_hashsize="$(du -b "${hashfile}" | cut -f1)" > if [ "${hashsize}" != "${old_hashsize}" ] ; then > truncate -s "${hashsize}" "${hashfile}" > rm "${beeshome}/beescrawl.dat" > fi > pushd "${mnt}" >/dev/null > eend $? >} >stop_pre() { > # make sure bees is not suspended before stopping. > start-stop-daemon --signal SIGCONT --pidfile "${pidfile}" > return $? >} > >stop_post() { > ebegin "Unmounting ${fsuuid}" > umount "${mnt}" > eend $? >} > >suspend() { > # Suspending bees is useful to avoid a 'btrfs send' bug > # that exists with some kernels. > # See https://zygo.github.io/bees/btrfs-kernel.md > ebegin "Suspending ${RC_SVCNAME}" > start-stop-daemon --signal SIGSTOP --pidfile "${pidfile}" > eend $? >} > >resume() { > ebegin "Resuming ${RC_SVCNAME}" > start-stop-daemon --signal SIGCONT --pidfile "${pidfile}" > eend $? >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 890961
:
848593
|
872246
|
872247
|
872279
|
872280
|
872282
|
872324
|
872325
|
872350
|
872351
|
872352