[package] pmacct: add uacctd
This patch add uacctd, an ulog based accounting deamon from pmacct project (http://www.pmacct.net/) It also put all pmacct packages in a submenu called (13 packages) Thanks in advance. Signed-off-by: Etienne CHAMPETIER <etienne.champetier@free.fr> git-svn-id: svn://svn.openwrt.org/openwrt/packages@26379 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
ee38b45037
commit
b260a6019a
@ -22,6 +22,7 @@ include $(INCLUDE_DIR)/package.mk
|
|||||||
define Package/pmacct/Default
|
define Package/pmacct/Default
|
||||||
SECTION:=admin
|
SECTION:=admin
|
||||||
CATEGORY:=Administration
|
CATEGORY:=Administration
|
||||||
|
SUBMENU:=Pmacct suite
|
||||||
URL:=http://www.pmacct.net/
|
URL:=http://www.pmacct.net/
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@ -80,6 +81,34 @@ define Package/pmacctd-sqlite
|
|||||||
DEPENDS+= +libsqlite3
|
DEPENDS+= +libsqlite3
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define Package/uacctd/Default
|
||||||
|
$(call Package/pmacct/Default)
|
||||||
|
DEPENDS+= +iptables-mod-ulog
|
||||||
|
TITLE:=ulog accounting daemon
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/uacctd
|
||||||
|
$(call Package/pmacctd/Default)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/uacctd-mysql
|
||||||
|
$(call Package/pmacctd/Default)
|
||||||
|
TITLE+= with MySQL support
|
||||||
|
DEPENDS+= +libmysqlclient
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/uacctd-pgsql
|
||||||
|
$(call Package/pmacctd/Default)
|
||||||
|
TITLE+= with PostreSQL support
|
||||||
|
DEPENDS+= +libpq
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/uacctd-sqlite
|
||||||
|
$(call Package/pmacctd/Default)
|
||||||
|
TITLE+= with SQLite support
|
||||||
|
DEPENDS+= +libsqlite3
|
||||||
|
endef
|
||||||
|
|
||||||
define Package/pmacct-client
|
define Package/pmacct-client
|
||||||
$(call Package/pmacct/Default)
|
$(call Package/pmacct/Default)
|
||||||
TITLE:=Command-line client to gather data from the IMT plugin
|
TITLE:=Command-line client to gather data from the IMT plugin
|
||||||
@ -87,11 +116,12 @@ endef
|
|||||||
|
|
||||||
define Compile/Template
|
define Compile/Template
|
||||||
|
|
||||||
$(PKG_BUILD_DIR)/nfacctd$(1) $(PKG_BUILD_DIR)/pmacctd$(1): $(STAMP_CONFIGURED)
|
$(PKG_BUILD_DIR)/nfacctd$(1) $(PKG_BUILD_DIR)/pmacctd$(1) $(PKG_BUILD_DIR)/uacctd$(1): $(STAMP_CONFIGURED)
|
||||||
-$(MAKE) -C $(PKG_BUILD_DIR) distclean
|
-$(MAKE) -C $(PKG_BUILD_DIR) distclean
|
||||||
$(call Build/Configure/Default, \
|
$(call Build/Configure/Default, \
|
||||||
--with-pcap-includes="$(STAGING_DIR)/usr/include" \
|
--with-pcap-includes="$(STAGING_DIR)/usr/include" \
|
||||||
--with-pcap-libs="$(STAGING_DIR)/usr/lib" \
|
--with-pcap-libs="$(STAGING_DIR)/usr/lib" \
|
||||||
|
--enable-ulog \
|
||||||
$(2) \
|
$(2) \
|
||||||
,\
|
,\
|
||||||
LIBS="-lz" \
|
LIBS="-lz" \
|
||||||
@ -101,8 +131,9 @@ $(PKG_BUILD_DIR)/nfacctd$(1) $(PKG_BUILD_DIR)/pmacctd$(1): $(STAMP_CONFIGURED)
|
|||||||
all
|
all
|
||||||
mv -f $(PKG_BUILD_DIR)/src/nfacctd $(PKG_BUILD_DIR)/nfacctd$(1)
|
mv -f $(PKG_BUILD_DIR)/src/nfacctd $(PKG_BUILD_DIR)/nfacctd$(1)
|
||||||
mv -f $(PKG_BUILD_DIR)/src/pmacctd $(PKG_BUILD_DIR)/pmacctd$(1)
|
mv -f $(PKG_BUILD_DIR)/src/pmacctd $(PKG_BUILD_DIR)/pmacctd$(1)
|
||||||
|
mv -f $(PKG_BUILD_DIR)/src/uacctd $(PKG_BUILD_DIR)/uacctd$(1)
|
||||||
|
|
||||||
$(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/nfacctd$(1) $(PKG_BUILD_DIR)/pmacctd$(1)
|
$(PKG_BUILD_DIR)/.built: $(PKG_BUILD_DIR)/nfacctd$(1) $(PKG_BUILD_DIR)/pmacctd$(1) $(PKG_BUILD_DIR)/uacctd$(1)
|
||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@ -127,7 +158,7 @@ endef
|
|||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd)$(CONFIG_PACKAGE_pmacctd),)
|
ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd)$(CONFIG_PACKAGE_pmacctd)$(CONFIG_PACKAGE_uacctd),)
|
||||||
define Compile/pmacct/basic
|
define Compile/pmacct/basic
|
||||||
$(call Compile/Template,, \
|
$(call Compile/Template,, \
|
||||||
--disable-mysql \
|
--disable-mysql \
|
||||||
@ -136,11 +167,12 @@ ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd)$(CONFIG_PACKAGE_pmacctd),)
|
|||||||
)
|
)
|
||||||
$(call Install/Template,nfacctd,)
|
$(call Install/Template,nfacctd,)
|
||||||
$(call Install/Template,pmacctd,)
|
$(call Install/Template,pmacctd,)
|
||||||
|
$(call Install/Template,uacctd,)
|
||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
$(eval $(Compile/pmacct/basic))
|
$(eval $(Compile/pmacct/basic))
|
||||||
|
|
||||||
ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd-mysql)$(CONFIG_PACKAGE_pmacctd-mysql),)
|
ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd-mysql)$(CONFIG_PACKAGE_pmacctd-mysql)$(CONFIG_PACKAGE_uacctd-mysql),)
|
||||||
define Compile/pmacct/mysql
|
define Compile/pmacct/mysql
|
||||||
$(call Compile/Template,-mysql, \
|
$(call Compile/Template,-mysql, \
|
||||||
--enable-mysql \
|
--enable-mysql \
|
||||||
@ -149,11 +181,12 @@ ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd-mysql)$(CONFIG_PACKAGE_pmacctd-mysql),)
|
|||||||
)
|
)
|
||||||
$(call Install/Template,nfacctd,-mysql)
|
$(call Install/Template,nfacctd,-mysql)
|
||||||
$(call Install/Template,pmacctd,-mysql)
|
$(call Install/Template,pmacctd,-mysql)
|
||||||
|
$(call Install/Template,uacctd,-mysql)
|
||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
$(eval $(Compile/pmacct/mysql))
|
$(eval $(Compile/pmacct/mysql))
|
||||||
|
|
||||||
ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd-pgsql)$(CONFIG_PACKAGE_pmacctd-pgsql),)
|
ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd-pgsql)$(CONFIG_PACKAGE_pmacctd-pgsql)$(CONFIG_PACKAGE_uacctd-pgsql),)
|
||||||
define Compile/pmacct/pgsql
|
define Compile/pmacct/pgsql
|
||||||
$(call Compile/Template,-pgsql, \
|
$(call Compile/Template,-pgsql, \
|
||||||
--enable-pgsql \
|
--enable-pgsql \
|
||||||
@ -162,11 +195,12 @@ ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd-pgsql)$(CONFIG_PACKAGE_pmacctd-pgsql),)
|
|||||||
)
|
)
|
||||||
$(call Install/Template,nfacctd,-pgsql)
|
$(call Install/Template,nfacctd,-pgsql)
|
||||||
$(call Install/Template,pmacctd,-pgsql)
|
$(call Install/Template,pmacctd,-pgsql)
|
||||||
|
$(call Install/Template,uacctd,-pgsql)
|
||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
$(eval $(Compile/pmacct/pgsql))
|
$(eval $(Compile/pmacct/pgsql))
|
||||||
|
|
||||||
ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd-sqlite)$(CONFIG_PACKAGE_pmacctd-sqlite),)
|
ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd-sqlite)$(CONFIG_PACKAGE_pmacctd-sqlite)$(CONFIG_PACKAGE_uacctd-sqlite),)
|
||||||
define Compile/pmacct/sqlite
|
define Compile/pmacct/sqlite
|
||||||
$(call Compile/Template,-sqlite, \
|
$(call Compile/Template,-sqlite, \
|
||||||
--enable-sqlite3 \
|
--enable-sqlite3 \
|
||||||
@ -175,6 +209,7 @@ ifneq ($(SDK)$(CONFIG_PACKAGE_nfacctd-sqlite)$(CONFIG_PACKAGE_pmacctd-sqlite),)
|
|||||||
)
|
)
|
||||||
$(call Install/Template,nfacctd,-sqlite)
|
$(call Install/Template,nfacctd,-sqlite)
|
||||||
$(call Install/Template,pmacctd,-sqlite)
|
$(call Install/Template,pmacctd,-sqlite)
|
||||||
|
$(call Install/Template,uacctd,-sqlite)
|
||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
$(eval $(Compile/pmacct/sqlite))
|
$(eval $(Compile/pmacct/sqlite))
|
||||||
@ -199,3 +234,8 @@ $(eval $(call BuildPackage,pmacctd-mysql))
|
|||||||
$(eval $(call BuildPackage,pmacctd-pgsql))
|
$(eval $(call BuildPackage,pmacctd-pgsql))
|
||||||
$(eval $(call BuildPackage,pmacctd-sqlite))
|
$(eval $(call BuildPackage,pmacctd-sqlite))
|
||||||
$(eval $(call BuildPackage,pmacct-client))
|
$(eval $(call BuildPackage,pmacct-client))
|
||||||
|
$(eval $(call BuildPackage,uacctd))
|
||||||
|
$(eval $(call BuildPackage,uacctd-mysql))
|
||||||
|
$(eval $(call BuildPackage,uacctd-pgsql))
|
||||||
|
$(eval $(call BuildPackage,uacctd-sqlite))
|
||||||
|
|
||||||
|
28
admin/pmacct/files/uacctd.conf
Normal file
28
admin/pmacct/files/uacctd.conf
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
!
|
||||||
|
! uacctd configuration example
|
||||||
|
!
|
||||||
|
! debug: true
|
||||||
|
|
||||||
|
uacctd_group : 1
|
||||||
|
|
||||||
|
daemonize: true
|
||||||
|
pidfile: /var/run/uacctd.pid
|
||||||
|
aggregate: src_host,dst_host
|
||||||
|
! aggregate: src_net,dst_net
|
||||||
|
plugins: memory
|
||||||
|
imt_buckets: 65537
|
||||||
|
imt_mem_pools_size: 65536
|
||||||
|
! imt_mem_pools_number: 0
|
||||||
|
! plugins: mysql
|
||||||
|
! plugins: pgsql
|
||||||
|
! plugins: sqlite3
|
||||||
|
! sql_db: uacct
|
||||||
|
! sql_table: acct
|
||||||
|
! sql_table_version: 2
|
||||||
|
! sql_passwd: arealsmartpwd
|
||||||
|
! sql_user: uacct
|
||||||
|
! sql_refresh_time: 90
|
||||||
|
! sql_optimize_clauses: true
|
||||||
|
! sql_history: 10m
|
||||||
|
! sql_history_roundoff: mh
|
||||||
|
! networks_file: ./networks.example
|
1
admin/pmacct/files/uacctd.default
Normal file
1
admin/pmacct/files/uacctd.default
Normal file
@ -0,0 +1 @@
|
|||||||
|
OPTIONS="-f /etc/uacctd.conf"
|
18
admin/pmacct/files/uacctd.init
Normal file
18
admin/pmacct/files/uacctd.init
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
# Copyright (C) 2006 OpenWrt.org
|
||||||
|
START=50
|
||||||
|
|
||||||
|
BIN=uacctd
|
||||||
|
DEFAULT=/etc/default/$BIN
|
||||||
|
RUN_D=/var/run
|
||||||
|
PID_F=$RUN_D/$BIN.pid
|
||||||
|
|
||||||
|
start() {
|
||||||
|
[ -f $DEFAULT ] && . $DEFAULT
|
||||||
|
mkdir -p $RUN_D
|
||||||
|
$BIN $OPTIONS
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
[ -f $PID_F ] && kill -INT $(cat $PID_F)
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user