#!/bin/sh # Save this script at a suitable path, for example # /usr/local/sbin/suspend.sh # then edit /etc/rc.suspend to include the path. # Allow detachment of a USB device that is used for a ZFS pool named # Transcend. # while mount | grep Transcend 2>&1; do zpool export Transcend sleep 5 done # Since is fixed, I wonder whether combined # use of sysutils/lsof lsof(8) and devel/libnotify notify-send(1) can notify # the user of the path to an open file, if one is open within the pool. # # # Allow detachment of USB devices that are used for OpenZFS L2ARC for # the boot pool on internal storage. # zpool offline august gpt/cache-august zpool offline august gpt/cache2-august zpool offline august gpt/cache3-august sync killall pulseaudio # Credit to David Schlachter for 'USB audio devices on FreeBSD' # # # Attempt to kill all dsp- and mixer-related processes. # while fstat | grep -e dsp -e mixer 2>&1; do fstat | grep -e dsp -e mixer | cut -w -f 3 | while read pid; do kill -15 "$pid" done done # Make (play/rec) the default # on an HP EliteBook 8570p. # sysctl hw.snd.default_unit=1 # Retrospective # ============= # # I found it impossible to kill PulseAudio. Instead, it was set to no longer # automatically spawn: . # # Killing of KMix by the script required a manual run of # /usr/local/bin/kded5 & # as grahamperrin after each wake of the computer. # # For a while, I forced deletion of KMix – # – and used a fake manifest to # prevent automated reinstallation: . # # Eventually, the issue involving KMix was resolved: #