0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-05-06 18:20:10 +00:00
netdata_netdata/system/initd/init.d/netdata.in
Costa Tsaousis 6d90975e02
change the moto and the description of netdata (#19696)
* change the moto and the description of netdata

* Update netdata-installer.sh

* Update netdata.spec.in

* Update Packaging.cmake

* Update makeself-help-header.txt

* Update makeself-license.txt

* Update main.c

* Update netdata.service.in

* Update netdata.service.v235.in
2025-02-23 13:02:22 +02:00

95 lines
1.9 KiB
Bash

#!/bin/sh
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Netdata - X-Ray Vision for your infrastructure!
# chkconfig: 345 99 01
# description: netdata is a high-resolution, real-time, low-latency observability platform.
# Per-second data collection, high-performance long-term storage, low-latency
# visualization, machine-learning based anomaly detection, alerts and notifications,
# advanced correlations and fast root cause analysis, native horizontal scalability.
# processname: netdata
# Source functions
. /etc/rc.d/init.d/functions
DAEMON="netdata"
DAEMON_PATH=@sbindir_POST@
PIDFILE_PATH=@localstatedir_POST@/run/netdata
PIDFILE=$PIDFILE_PATH/$DAEMON.pid
DAEMONOPTS="-P $PIDFILE"
STOP_TIMEOUT="60"
[ -e /etc/sysconfig/$DAEMON ] && . /etc/sysconfig/$DAEMON
LOCKFILE=/var/lock/subsys/$DAEMON
service_start()
{
[ -x $DAEMON_PATH ] || exit 5
[ ! -d $PIDFILE_PATH ] && mkdir -p $PIDFILE_PATH
chown @netdata_user_POST@:@netdata_user_POST@ $PIDFILE_PATH
echo -n "Starting $DAEMON..."
daemon $DAEMON_PATH/$DAEMON $DAEMONOPTS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch $LOCKFILE
return $RETVAL
}
service_stop()
{
printf "%-50s" "Stopping $DAEMON..."
killproc -p ${PIDFILE} -d ${STOP_TIMEOUT} $DAEMON
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f ${PIDFILE} ${LOCKFILE}
return $RETVAL
}
condrestart()
{
if ! service_status > /dev/null; then
RETVAL=$1
return $RETVAL
fi
service_stop
service_start
}
service_status()
{
status -p ${PIDFILE} $DAEMON_PATH/$DAEMON
}
service_status_quiet()
{
status -p ${PIDFILE} $DAEMON_PATH/$DAEMON >/dev/null 2>&1
}
case "$1" in
start)
service_status_quiet && exit 0
service_start
;;
stop)
service_status_quiet || exit 0
service_stop
;;
restart)
service_stop
service_start
;;
try-restart)
condrestart 0
;;
force-reload)
condrestart 7
;;
status)
service_status
;;
*)
echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status}"
exit 3
esac