%PDF- %PDF-
Server IP : 79.170.40.229 / Your IP : 52.14.56.247 Web Server : Apache System : Linux web232.extendcp.co.uk 4.18.0-513.24.1.el8_9.x86_64 #1 SMP Mon Apr 8 11:23:13 EDT 2024 x86_64 User : 1stforcarhirealicante.com ( 296923) PHP Version : 5.6.40 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/thread-self/root/etc/rc0.d/ |
Upload File : |
#!/bin/bash # # elastic-agent elastic-agent shipper # # chkconfig: 2345 98 02 # description: Starts and stops a single elastic-agent instance on this system # ### BEGIN INIT INFO # Provides: elastic-agent # Required-Start: $local_fs $network $syslog # Required-Stop: $local_fs $network $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Agent manages other beats based on configuration provided. # Description: Elastic-Agent is a shipper part of the Elastic Beats # family. Please see: https://www.elastic.co/beats ### END INIT INFO PATH=/usr/bin:/sbin:/bin:/usr/sbin export PATH [ -f /etc/sysconfig/elastic-agent ] && . /etc/sysconfig/elastic-agent pidfile=${PIDFILE-/var/run/elastic-agent.pid} agent=${BEATS_AGENT-/usr/share/elastic-agent/bin/elastic-agent} args="-c /etc/elastic-agent/elastic-agent.yml --path.home /usr/share/elastic-agent --path.config /etc/elastic-agent --path.logs /var/log/elastic-agent" beat_user="${BEAT_USER:-root}" wrapper="/usr/share/elastic-agent/bin/elastic-agent-god" wrapperopts="-r / -n -p $pidfile" user_wrapper="su" user_wrapperopts="$beat_user -c" RETVAL=0 DEFAULT_GODEBUG="madvdontneed=1" export GODEBUG=${GODEBUG-$DEFAULT_GODEBUG} # Source function library. . /etc/rc.d/init.d/functions # Determine if we can use the -p option to daemon, killproc, and status. # RHEL < 5 can't. if status | grep -q -- '-p' 2>/dev/null; then daemonopts="--pidfile $pidfile" pidopts="-p $pidfile" fi if command -v runuser >/dev/null 2>&1; then user_wrapper="runuser" fi [ "$beat_user" != "root" ] && wrapperopts="$wrapperopts -u $beat_user" start() { echo -n $"Starting elastic-agent: " if [ $? -ne 0 ]; then echo exit 1 fi daemon $daemonopts $wrapper $wrapperopts -- $agent $args RETVAL=$? echo return $RETVAL } stop() { echo -n $"Stopping elastic-agent: " killproc $pidopts $wrapper RETVAL=$? echo [ $RETVAL = 0 ] && rm -f ${pidfile} } restart() { if [ $? -ne 0 ]; then return 1 fi stop start } rh_status() { status $pidopts $wrapper RETVAL=$? return $RETVAL } rh_status_q() { rh_status >/dev/null 2>&1 } case "$1" in start) start ;; stop) stop ;; restart) restart ;; condrestart|try-restart) rh_status_q || exit 0 restart ;; status) rh_status ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart}" exit 1 esac exit $RETVAL