From bd81ae28fbb4afb302db384a67405b9161dae07f Mon Sep 17 00:00:00 2001 From: B. Watson Date: Tue, 20 Jun 2023 03:22:02 -0400 Subject: network/host-sflow: Fix init scrupt and doinst. Signed-off-by: B. Watson Signed-off-by: Willy Sudiarto Raharjo --- network/host-sflow/README | 7 +++++++ network/host-sflow/doinst.sh | 2 +- network/host-sflow/host-sflow.SlackBuild | 16 ++++++++++------ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/network/host-sflow/README b/network/host-sflow/README index 1426537c58..a805696a06 100644 --- a/network/host-sflow/README +++ b/network/host-sflow/README @@ -2,3 +2,10 @@ The Host sFlow agent exports physical and virtual server performance metrics using the sFlow protocol. The agent provides scalable, multi-vendor, multi-OS performance monitoring with minimal impact on the systems being monitored. + +To start hsflowd at boot, add something like this to your +/etc/rc.d/rc.local: + +if [ -x /etc/rc.d/rc.hsflowd ]; then + /etc/rc.d/rc.hsflowd start +fi diff --git a/network/host-sflow/doinst.sh b/network/host-sflow/doinst.sh index 00c3dd9dfa..83420b7d7c 100644 --- a/network/host-sflow/doinst.sh +++ b/network/host-sflow/doinst.sh @@ -22,5 +22,5 @@ preserve_perms() { config $NEW } -preserve_perms etc/init.d/hsflowd +preserve_perms etc/rc.d/rc.hsflowd.new config etc/hsflowd.conf.new diff --git a/network/host-sflow/host-sflow.SlackBuild b/network/host-sflow/host-sflow.SlackBuild index 60827f87b1..7c017930ce 100644 --- a/network/host-sflow/host-sflow.SlackBuild +++ b/network/host-sflow/host-sflow.SlackBuild @@ -22,13 +22,18 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# 20230620 bkw: modified by SlackBuilds.org, BUILD=2: +# - Install init script in Slackware standard location, and make it +# a proper .new config file. +# - Mention the init script in README. + # 02/Apr/2018 * First version cd $(dirname $0) ; CWD=$(pwd) PRGNAM=host-sflow VERSION=${VERSION:-2.0.15} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -40,9 +45,6 @@ if [ -z "$ARCH" ]; then esac fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -77,9 +79,9 @@ cd $PRGNAM-$VERSION chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ - -o -perm 511 \) -exec chmod 755 {} \; -o \ + -o -perm 511 \) -exec chmod 755 {} \+ -o \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+ # Soft-link in tarball causes x bit to be set below; nuke it rm -f $PRGNAM-$VERSION/README @@ -108,6 +110,8 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true mv $PKG/etc/hsflowd.conf $PKG/etc/hsflowd.conf.new +mv $PKG/etc/init.d $PKG/etc/rc.d +mv $PKG/etc/rc.d/hsflowd $PKG/etc/rc.d/rc.hsflowd.new mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a LICENSE README $PKG/usr/doc/$PRGNAM-$VERSION -- cgit v1.2.3