head	1.14;
access;
symbols
	OPENPKG_E1_MP_HEAD:1.14
	OPENPKG_E1_MP:1.14
	OPENPKG_E1_MP_2_STABLE:1.13.10.1
	OPENPKG_E1_FP:1.13.10.1
	OPENPKG_2_STABLE_MP:1.14
	OPENPKG_2_STABLE_20061018:1.13.10.1
	OPENPKG_2_STABLE_20060622:1.13
	OPENPKG_2_STABLE:1.13.0.10
	OPENPKG_2_STABLE_BP:1.13
	OPENPKG_2_5_RELEASE:1.13
	OPENPKG_2_5_SOLID:1.13.0.8
	OPENPKG_2_5_SOLID_BP:1.13
	OPENPKG_2_4_RELEASE:1.13
	OPENPKG_2_4_SOLID:1.13.0.6
	OPENPKG_2_4_SOLID_BP:1.13
	OPENPKG_CW_FP:1.13
	OPENPKG_2_3_RELEASE:1.13
	OPENPKG_2_3_SOLID:1.13.0.4
	OPENPKG_2_3_SOLID_BP:1.13
	OPENPKG_2_2_RELEASE:1.13
	OPENPKG_2_2_SOLID:1.13.0.2
	OPENPKG_2_2_SOLID_BP:1.13
	OPENPKG_2_1_RELEASE:1.12
	OPENPKG_2_1_SOLID:1.12.0.4
	OPENPKG_2_1_SOLID_BP:1.12
	OPENPKG_2_0_RELEASE:1.12
	OPENPKG_2_0_SOLID:1.12.0.2
	OPENPKG_2_0_SOLID_BP:1.12
	OPENPKG_1_3_RELEASE:1.1.4.1
	OPENPKG_1_3_SOLID:1.1.4.1.0.2
	OPENPKG_1_3_SOLID_BP:1.1.4.1
	OPENPKG_1_STABLE_MP:1.12
	OPENPKG_1_2_RELEASE:1.1
	OPENPKG_1_2_SOLID:1.1.0.6
	OPENPKG_1_2_SOLID_BP:1.1
	OPENPKG_1_STABLE:1.1.0.4
	OPENPKG_1_STABLE_BP:1.1
	OPENPKG_1_1_RELEASE:1.1
	OPENPKG_1_1_SOLID:1.1.0.2
	OPENPKG_1_1_SOLID_BP:1.1;
locks; strict;
comment	@# @;


1.14
date	2006.08.25.19.20.01;	author rse;	state Exp;
branches;
next	1.13;
commitid	Tvsj1UyQ8rQ89gKr;

1.13
date	2004.09.20.14.33.39;	author rse;	state Exp;
branches
	1.13.10.1;
next	1.12;

1.12
date	2003.07.22.15.01.01;	author mlelstv;	state Exp;
branches;
next	1.11;

1.11
date	2003.07.22.08.11.13;	author rse;	state Exp;
branches;
next	1.10;

1.10
date	2003.07.21.08.40.55;	author thl;	state Exp;
branches;
next	1.9;

1.9
date	2003.07.19.17.06.35;	author rse;	state Exp;
branches;
next	1.8;

1.8
date	2003.07.17.21.35.14;	author thl;	state Exp;
branches;
next	1.7;

1.7
date	2003.07.10.07.51.13;	author rse;	state Exp;
branches;
next	1.6;

1.6
date	2003.07.09.14.06.27;	author thl;	state Exp;
branches;
next	1.5;

1.5
date	2003.07.07.21.54.35;	author thl;	state Exp;
branches;
next	1.4;

1.4
date	2003.07.03.14.43.38;	author thl;	state Exp;
branches;
next	1.3;

1.3
date	2003.06.24.12.08.11;	author thl;	state Exp;
branches;
next	1.2;

1.2
date	2003.05.01.09.15.24;	author cs;	state Exp;
branches;
next	1.1;

1.1
date	2002.03.03.12.27.40;	author rse;	state Exp;
branches
	1.1.4.1;
next	;

1.13.10.1
date	2006.10.16.14.57.00;	author rse;	state Exp;
branches;
next	;
commitid	iZxwRSmmWscPXUQr;

1.1.4.1
date	2003.07.24.20.50.46;	author rse;	state Exp;
branches;
next	;


desc
@@


1.14
log
@replace '@@l_prefix@@/lib/openpkg/bash @@l_prefix@@/etc/rc' in shebang with '@@l_prefix@@/bin/openpkg rc' to allow people who run the rc.xxx scripts directly (as executables) to leverage from the Set-UID functionality
@
text
@#!@@l_prefix@@/bin/openpkg rc
##
##  rc.sysmon -- Run-Commands
##

%config
    sysmon_enable="$openpkg_rc_def"
    sysmon_log_prolog="true"
    sysmon_log_epilog="true"
    sysmon_log_numfiles="10"
    sysmon_log_minsize="1M"
    sysmon_log_complevel="9"
    sysmon_stop_timeout="60"

%common
    sysmon_pidfile="@@l_prefix@@/var/sysmon/sysmond.pid"
    sysmon_signal () {
        [ -f $sysmon_pidfile ] && kill -$1 `cat $sysmon_pidfile`
    }

%status -u @@l_susr@@ -o
    sysmon_usable="unknown"
    sysmon_active="no"
    rcService sysmon enable yes && \
        sysmon_signal 0 && sysmon_active="yes"
    echo "sysmon_enable=\"$sysmon_enable\""
    echo "sysmon_usable=\"$sysmon_usable\""
    echo "sysmon_active=\"$sysmon_active\""

%start -u @@l_susr@@
    rcService sysmon enable yes || exit 0
    @@l_prefix@@/sbin/sysmond -q -f @@l_prefix@@/etc/sysmon/sysmon.conf >/dev/null 2>&1

%stop -u @@l_susr@@
    rcService sysmon enable yes || exit 0
    sysmon_signal TERM

%restart -u @@l_susr@@
    rcService sysmon enable yes || exit 0
    rc sysmon stop
    sleep 2
    rc sysmon start

%reload -u @@l_susr@@
    rcService sysmon enable yes || exit 0
    sysmon_signal HUP

%daily -u @@l_susr@@
    rcService sysmon enable yes || exit 0
    shtool rotate -f \
        -n ${sysmon_log_numfiles} -s ${sysmon_log_minsize} -d \
        -z ${sysmon_log_complevel} -o @@l_rusr@@ -g @@l_rgrp@@ -m 644 \
        -P "${sysmon_log_prolog}" \
        -E "${sysmon_log_epilog}" \
        @@l_prefix@@/var/sysmon/sysmon.log

@


1.13
log
@remove lonely logfile rotation comment in rc files
@
text
@d1 1
a1 1
#!@@l_prefix@@/lib/openpkg/bash @@l_prefix@@/etc/rc
@


1.13.10.1
log
@Mass merge from CURRENT to 2-STABLE (all packages except those of JUNK class)
@
text
@d1 1
a1 1
#!@@l_prefix@@/bin/openpkg rc
@


1.12
log
@%status and pidfile handling
@
text
@a49 2

    #   rotate logfile
@


1.11
log
@cleanup the priority: move 200 to 500 and because 500 is default just ommit it; fix DNS/NTP/etc. dependencies
@
text
@d13 1
d16 13
a28 1
    sysmon_pidfile="@@l_prefix@@/var/sysmon/sysmon.pid"
d32 1
a32 5
    rcTmp -i -p sysmon
    logfile=`rcTmp -f -n log`
    @@l_prefix@@/sbin/sysmond -q -f @@l_prefix@@/etc/sysmon/sysmon.conf >$logfile 2>&1
    grep "pid" $logfile | sed -e 's;^.*pid \([0-9]*\).*$;\1;' >$sysmon_pidfile
    rcTmp -k
d36 11
a46 3
    if [ -f $sysmon_pidfile ]; then
        kill -TERM `cat $sysmon_pidfile`
    fi
@


1.10
log
@PR#210: shtool options space before argument
@
text
@d17 1
a17 1
%start -p 200 -u @@l_susr@@
d25 1
a25 1
%stop -p 200 -u @@l_susr@@
@


1.9
log
@replace opXXXX with rcXXXX (PR#207)
@
text
@d36 2
a37 2
        -n${sysmon_log_numfiles} -s${sysmon_log_minsize} -d \
        -z${sysmon_log_complevel} -o@@l_rusr@@ -g@@l_rgrp@@ -m644 \
@


1.8
log
@migrate opServiceEnabled to opService ... enable yes; use new bootstrap feature and apply opService short circuit to %env
@
text
@d18 3
a20 3
    opService sysmon enable yes || exit 0
    opTmpDirGen sysmon
    opTmpDirFile sysmon log logfile
d23 1
a23 1
    opTmpDirDel sysmon
d26 1
a26 1
    opService sysmon enable yes || exit 0
d32 1
a32 1
    opService sysmon enable yes || exit 0
@


1.7
log
@use new openpkg_rc_def variable in run-command scripts for allowing the admin to change the global default for xxx_enable
@
text
@d18 1
a18 1
    opServiceEnabled sysmon || exit 0
d26 1
a26 1
    opServiceEnabled sysmon || exit 0
d32 1
a32 1
    opServiceEnabled sysmon || exit 0
@


1.6
log
@rclint police: fix badly prefixed variable, opServiceEnabled, exit not allowed here
@
text
@d7 1
a7 1
    sysmon_enable="yes"
@


1.5
log
@rclint police: fix mandatory/wished trailing blank line missing
@
text
@d18 6
a23 7
    if opServiceEnabled sysmon; then
        opTmpDirGen sysmon
        opTmpDirFile sysmon log logfile
        @@l_prefix@@/sbin/sysmond -q -f @@l_prefix@@/etc/sysmon/sysmon.conf >$logfile 2>&1
        grep "pid" $logfile | sed -e 's;^.*pid \([0-9]*\).*$;\1;' >$sysmon_pidfile
        opTmpDirDel sysmon
    fi
d26 3
a28 4
    if opServiceEnabled sysmon; then
        if [ -f $sysmon_pidfile ]; then
            kill -TERM `cat $sysmon_pidfile`
        fi
@


1.4
log
@add fsl support
@
text
@d43 1
@


1.3
log
@cosmetics: align/fix/unify rc header comment
@
text
@d8 5
d33 10
@


1.2
log
@clean up
@
text
@d3 1
a3 1
##  rc.sysmon -- Run-Commands for SYSMON daemon
@


1.1
log
@new package: sysmon 0.91.9
@
text
@d12 1
a12 1
%start -p 200 -u root
d21 1
a21 1
%stop -p 200 -u root
@


1.1.4.1
log
@mass Merge-From-CURRENT (MFC) in preparation for OpenPKG 1.3 [class PLUS only]
@
text
@d3 1
a3 1
##  rc.sysmon -- Run-Commands
d7 1
a7 7
    sysmon_enable="$openpkg_rc_def"
    sysmon_log_prolog="true"
    sysmon_log_epilog="true"
    sysmon_log_numfiles="10"
    sysmon_log_minsize="1M"
    sysmon_log_complevel="9"
    sysmon_stop_timeout="60"
d10 1
a10 4
    sysmon_pidfile="@@l_prefix@@/var/sysmon/sysmond.pid"
    sysmon_signal () {
        [ -f $sysmon_pidfile ] && kill -$1 `cat $sysmon_pidfile`
    }
d12 15
a26 37
%status -u @@l_susr@@ -o
    sysmon_usable="unknown"
    sysmon_active="no"
    rcService sysmon enable yes && \
        sysmon_signal 0 && sysmon_active="yes"
    echo "sysmon_enable=\"$sysmon_enable\""
    echo "sysmon_usable=\"$sysmon_usable\""
    echo "sysmon_active=\"$sysmon_active\""

%start -u @@l_susr@@
    rcService sysmon enable yes || exit 0
    @@l_prefix@@/sbin/sysmond -q -f @@l_prefix@@/etc/sysmon/sysmon.conf >/dev/null 2>&1

%stop -u @@l_susr@@
    rcService sysmon enable yes || exit 0
    sysmon_signal TERM

%restart -u @@l_susr@@
    rcService sysmon enable yes || exit 0
    rc sysmon stop
    sleep 2
    rc sysmon start

%reload -u @@l_susr@@
    rcService sysmon enable yes || exit 0
    sysmon_signal HUP

%daily -u @@l_susr@@
    rcService sysmon enable yes || exit 0

    #   rotate logfile
    shtool rotate -f \
        -n ${sysmon_log_numfiles} -s ${sysmon_log_minsize} -d \
        -z ${sysmon_log_complevel} -o @@l_rusr@@ -g @@l_rgrp@@ -m 644 \
        -P "${sysmon_log_prolog}" \
        -E "${sysmon_log_epilog}" \
        @@l_prefix@@/var/sysmon/sysmon.log
@


