# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/prometheus-node-exporter/initd.patch # Copyright (C) 2026 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 or patched project license # --- T2-COPYRIGHT-END --- --- node_exporter-1.11.1/examples/init.d/node_exporter.vanilla 2026-05-20 21:35:03.625528182 +0200 +++ node_exporter-1.11.1/examples/init.d/node_exporter 2026-05-20 21:36:32.763149639 +0200 @@ -1,39 +1,38 @@ #!/bin/bash -RETVAL=0 +[ -f /etc/sysconfig/node_exporter ] && . /etc/sysconfig/node_exporter +OPTIONS+=" --web.listen-address=:9100" PROG="node_exporter" -EXEC="/etc/node_exporter/node_exporter" -LOCKFILE="/var/lock/subsys/$PROG" -OPTIONS="--web.listen-address=:9100" - -# Source function library. -if [ -f /etc/rc.d/init.d/functions ]; then - . /etc/rc.d/init.d/functions -else - echo "/etc/rc.d/init.d/functions does not exist" - exit 0 -fi +EXEC="/usr/bin/node_exporter" + +title() { + local x w="$(stty size 2>/dev/null /dev/null 2>&1 & - RETVAL=$? - [ $RETVAL -eq 0 ] && touch $LOCKFILE && success || failure - echo - return $RETVAL - fi + error=$? + status } stop() { - echo -n "Stopping $PROG: " - killproc $EXEC - RETVAL=$? - [ $RETVAL -eq 0 ] && rm -r $LOCKFILE && success || failure - echo + title "Stopping $PROG" + killall $EXEC || error=$? + status } restart () @@ -48,16 +47,15 @@ start ;; stop) - stop - ;; - status) - status $PROG + stop ;; restart) restart ;; *) - echo "Usage: $0 {start|stop|restart|status}" + echo "Usage: $0 {start|stop|restart}" exit 1 esac -exit $RETVAL +exit 0 + +