"Fossies" - the Fresh Open Source Software Archive

Member "unix/FreeBSD/pandora_agent" (15 Sep 2021, 1034 Bytes) of package /linux/misc/pandorafms_agent_unix-7.0NG.757.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 
    3 # **********************************************************************
    4 # Pandora FMS Agent Daemon launcher for FreeBSD
    5 # (c) 2010 Junichi Satoh <junichi@rworks.jp>
    6 # (c) 2014 Koichiro Kikuchi <koichiro@rworks.jp>
    7 #
    8 # **********************************************************************
    9 
   10 # PROVIDE: pandora_agent
   11 # REQUIRE: LOGIN
   12 # KEYWORD: shutdown
   13 
   14 # Add the following line to /etc/rc.conf to enable `pandora_agent':
   15 #
   16 # pandora_agent_enable="YES"
   17 #
   18 
   19 . "/etc/rc.subr"
   20 
   21 name="pandora_agent"
   22 rcvar=pandora_agent_enable
   23 
   24 # read configuration and set defaults
   25 pandora_agent_enable=${pandora_agent_enable:-"NO"}
   26 load_rc_config "$name"
   27 
   28 PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
   29 
   30 pidfile=/var/run/$name.pid
   31 required_files="/usr/local/etc/pandora/pandora_agent.conf"
   32 stop_postcmd=stop_postcmd
   33 
   34 command=/usr/sbin/daemon
   35 command_interpreter=/usr/local/bin/perl
   36 procname=/usr/local/bin/pandora_agent
   37 
   38 command_args="-cfp $pidfile $procname /usr/local/etc/pandora"
   39 
   40 stop_postcmd()
   41 {
   42     rm -f $pidfile
   43 }
   44 
   45 run_rc_command "$1"