head	1.14;
access;
symbols
	OPENPKG_E1_MP_HEAD:1.14
	OPENPKG_E1_MP:1.14
	OPENPKG_CW_FP:1.11
	OPENPKG_1_STABLE_MP:1.7;
locks; strict;
comment	@# @;


1.14
date	2006.11.14.13.47.47;	author rse;	state Exp;
branches;
next	1.13;
commitid	0KP6gdhSNNJzJDUr;

1.13
date	2006.10.13.15.20.49;	author thl;	state Exp;
branches;
next	1.12;
commitid	TkYHw80lgRshhxQr;

1.12
date	2006.08.25.19.16.14;	author rse;	state Exp;
branches;
next	1.11;
commitid	Tvsj1UyQ8rQ89gKr;

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

1.10
date	2004.09.20.14.33.22;	author rse;	state Exp;
branches;
next	1.9;

1.9
date	2004.04.02.12.50.54;	author ms;	state Exp;
branches;
next	1.8;

1.8
date	2003.10.20.15.49.03;	author ms;	state Exp;
branches;
next	1.7;

1.7
date	2003.07.22.13.18.04;	author mlelstv;	state Exp;
branches;
next	1.6;

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

1.5
date	2003.07.19.17.05.51;	author rse;	state Exp;
branches;
next	1.4;

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

1.3
date	2003.07.16.18.01.05;	author rse;	state Exp;
branches;
next	1.2;

1.2
date	2003.07.10.07.50.22;	author rse;	state Exp;
branches;
next	1.1;

1.1
date	2003.07.08.12.52.05;	author thl;	state Exp;
branches;
next	;


desc
@@


1.14
log
@the argument to rcService has to be the original package name as it internally run 'rc <name> status'. For checking the variables rcService since ever automatically translates all '-' into '_' characters
@
text
@#!@@l_prefix@@/bin/openpkg rc
##
##  rc.dhcp-agent -- Run-Commands
##

%config
    dhcp_agent_enable="$openpkg_rc_def"
    dhcp_agent_interface=""
    dhcp_agent_log_prolog="true"
    dhcp_agent_log_epilog="true"
    dhcp_agent_log_numfiles="10"
    dhcp_agent_log_minsize="1M"
    dhcp_agent_log_complevel="9"

%common
    dhcp_agent_pidfile="@@l_prefix@@/var/dhcp-agent/dhcp-client/$dhcp_agent_interface.pid"
    dhcp_agent_signal () {
        [ -f $dhcp_agent_pidfile ] && kill -$1 `cat $dhcp_agent_pidfile`
    }

%status -u @@l_susr@@ -o
    dhcp_agent_usable="no"
    dhcp_agent_active="no"
    rcService dhcp-agent enable yes && \
        [ ".$dhcp_agent_interface" != . ] && dhcp_agent_usable="yes"
    rcService dhcp-agent enable yes && \
        rcVarIsYes dhcp_agent_usable && \
        dhcp_agent_signal 0 && dhcp_agent_active="yes"
    echo "dhcp_agent_enable=\"$dhcp_agent_enable\""
    echo "dhcp_agent_usable=\"$dhcp_agent_usable\""
    echo "dhcp_agent_active=\"$dhcp_agent_active\""

%start -p 50 -u @@l_susr@@
    rcService dhcp-agent enable yes || exit 0
    rcService dhcp-agent active yes && exit 0
    rcService dhcp-agent usable && \
    @@l_prefix@@/sbin/dhcp-client 2>/dev/null -i $dhcp_agent_interface

%stop -p 950 -u @@l_susr@@
    rcService dhcp-agent enable yes || exit 0
    rcService dhcp-agent active no && exit 0
    rcService dhcp-agent usable && \
    @@l_prefix@@/sbin/dhcp-client 2>/dev/null -k -i $dhcp_agent_interface

%restart -u @@l_susr@@
    rcService dhcp-agent enable yes || exit 0
    rcService dhcp-agent active no && exit 0
    rc dhcp_agent stop
    sleep 2
    rc dhcp_agent start

%reload -u @@l_susr@@
    rcService dhcp-agent enable yes || exit 0
    rcService dhcp-agent usable && \
    @@l_prefix@@/sbin/dhcp-client 2>/dev/null -c -i $dhcp_agent_interface

%daily -u @@l_susr@@
    rcService dhcp-agent enable yes || exit 0
    shtool rotate -f \
        -n ${dhcp_agent_log_numfiles} -s ${dhcp_agent_log_minsize} -d \
        -z ${dhcp_agent_log_complevel} -o @@l_rusr@@ -g @@l_rgrp@@ -m 644 \
        -P "${dhcp_agent_log_prolog}" \
        -E "${dhcp_agent_log_epilog}" \
        @@l_prefix@@/var/dhcp-agent/dhcp-agent.log

@


1.13
log
@lint police
@
text
@d24 1
a24 1
    rcService dhcp_agent enable yes && \
d26 1
a26 1
    rcService dhcp_agent enable yes && \
d34 3
a36 3
    rcService dhcp_agent enable yes || exit 0
    rcService dhcp_agent active yes && exit 0
    rcService dhcp_agent usable && \
d40 3
a42 3
    rcService dhcp_agent enable yes || exit 0
    rcService dhcp_agent active no && exit 0
    rcService dhcp_agent usable && \
d46 2
a47 2
    rcService dhcp_agent enable yes || exit 0
    rcService dhcp_agent active no && exit 0
d53 2
a54 2
    rcService dhcp_agent enable yes || exit 0
    rcService dhcp_agent usable && \
d58 1
a58 1
    rcService dhcp_agent enable yes || exit 0
@


1.12
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
@d24 1
a24 1
    rcService dhcp-agent enable yes && \
d26 1
a26 1
    rcService dhcp-agent enable yes && \
d34 3
a36 3
    rcService dhcp-agent enable yes || exit 0
    rcService dhcp-agent active yes && exit 0
    rcService dhcp-agent usable && \
d40 3
a42 3
    rcService dhcp-agent enable yes || exit 0
    rcService dhcp-agent active no && exit 0
    rcService dhcp-agent usable && \
d46 3
a48 3
    rcService dhcp-agent enable yes || exit 0
    rcService dhcp-agent active no && exit 0
    rc dhcp-agent stop
d50 1
a50 1
    rc dhcp-agent start
d53 2
a54 2
    rcService dhcp-agent enable yes || exit 0
    rcVarIsYes dhcp-agent_usable && \
d58 1
a58 1
    rcService dhcp-agent enable yes || exit 0
@


1.11
log
@remove priorities (actually inherited via cut & paste from rc.bind ;-) from packages where the default priority is fully sufficient; fix %stop priorities: they have to be 1000 minus the %start priority in order to stop a package later if it was started earlier.
@
text
@d1 1
a1 1
#!@@l_prefix@@/lib/openpkg/bash @@l_prefix@@/etc/rc
@


1.10
log
@remove lonely logfile rotation comment in rc files
@
text
@d33 1
a33 1
%start -p 90 -u @@l_susr@@
d39 1
a39 1
%stop -p 90 -u @@l_susr@@
d45 1
a45 1
%restart -p 90 -u @@l_susr@@
d52 1
a52 1
%reload -p 90 -u @@l_susr@@
@


1.9
log
@correct rc status variable, and those passed to rcService from within rc file as well
@
text
@a58 2

    #   rotate logfile
@


1.8
log
@Implement features in ticket #202, but don't test because it's too broken
@
text
@d24 1
a24 1
    rcService dhcp_agent enable yes && \
d26 1
a26 1
    rcService dhcp_agent enable yes && \
d34 3
a36 3
    rcService dhcp_agent enable yes || exit 0
    rcService dhcp_agent active yes && exit 0
    rcService dhcp_agent usable && \
d40 3
a42 3
    rcService dhcp_agent enable yes || exit 0
    rcService dhcp_agent active no && exit 0
    rcService dhcp_agent usable && \
d46 2
a47 2
    rcService dhcp_agent enable yes || exit 0
    rcService dhcp_agent active no && exit 0
d53 2
a54 2
    rcService dhcp_agent enable yes || exit 0
    rcVarIsYes dhcp_agent_usable && \
d58 1
a58 1
    rcService dhcp_agent enable yes || exit 0
@


1.7
log
@snapshot, junk because fails to work under FreeBSD
@
text
@d35 2
a36 1
    rcVarIsYes dhcp_agent_usable && \
d41 2
a42 1
    rcVarIsYes dhcp_agent_usable && \
d47 1
@


1.6
log
@PR#210: shtool options space before argument
@
text
@d8 1
d15 29
a43 1
%start
d45 3
a47 1
    #   FIXME: missing operation
d49 1
a49 1
%stop
d51 2
a52 1
    #   FIXME: missing operation
@


1.5
log
@replace opXXXX with rcXXXX (PR#207)
@
text
@d27 2
a28 2
        -n${dhcp_agent_log_numfiles} -s${dhcp_agent_log_minsize} -d \
        -z${dhcp_agent_log_complevel} -o@@l_rusr@@ -g@@l_rgrp@@ -m644 \
@


1.4
log
@migrate opServiceEnabled to opService ... enable yes; use new bootstrap feature and apply opService short circuit to %env
@
text
@d15 1
a15 1
    opService dhcp_agent enable yes || exit 0
d19 1
a19 1
    opService dhcp_agent enable yes || exit 0
d23 1
a23 1
    opService dhcp_agent enable yes || exit 0
@


1.3
log
@update and finish packaging a little bit more
@
text
@d15 1
a15 1
    opServiceEnabled dhcp_agent || exit 0
d19 1
a19 1
    opServiceEnabled dhcp_agent || exit 0
d23 1
a23 1
    opServiceEnabled dhcp_agent || exit 0
@


1.2
log
@use new openpkg_rc_def variable in run-command scripts for allowing the admin to change the global default for xxx_enable
@
text
@d14 8
@


1.1
log
@add fsl support
@
text
@d7 1
a7 1
    dhcp_agent_enable="yes"
@

