mirror of
https://github.com/novatiq/packages.git
synced 2026-04-29 06:58:39 +01:00
sysstat: import from old packages
Signed-off-by: Marko Ratkaj <marko.ratkaj@sartura.hr>
This commit is contained in:
committed by
Luka Perkov
parent
433a621c42
commit
08631d9c8f
@@ -0,0 +1,7 @@
|
||||
config sysstat 'sysstat'
|
||||
option log_history '7'
|
||||
option compressafter '10'
|
||||
option sadc_options ''
|
||||
option sa_dir '/var/log/sysstat'
|
||||
option zip 'xz'
|
||||
option enabled 'true'
|
||||
Executable
+49
@@ -0,0 +1,49 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2015 OpenWrt.org
|
||||
|
||||
START=90
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/lib/sysstat/sadc
|
||||
SYSSTAT_CFG="/etc/sysstat/sysstat"
|
||||
|
||||
validate_sysstat_section() {
|
||||
uci_validate_section sysstat sysstat "${1}" \
|
||||
'log_history:uinteger' \
|
||||
'compressafter:uinteger' \
|
||||
'sadc_options:string' \
|
||||
'sa_dir:string' \
|
||||
'zip:string' \
|
||||
'enabled:string'
|
||||
}
|
||||
|
||||
start_service() {
|
||||
|
||||
local log_history compressafter sadc_options sa_dir zip enabled
|
||||
|
||||
validate_sysstat_section sysstat || {
|
||||
echo "validation failed"
|
||||
return 1
|
||||
}
|
||||
|
||||
[ -d /var/log/sysstat ] || mkdir -p /var/log/sysstat
|
||||
|
||||
echo "HISTORY=$log_history" > $SYSSTAT_CFG
|
||||
echo "COMPRESSAFTER=$compressafter" >> $SYSSTAT_CFG
|
||||
echo "SADC_OPTIONS=\"$sadc_options\"" >> $SYSSTAT_CFG
|
||||
echo "SA_DIR=\"$sa_dir\"" >> $SYSSTAT_CFG
|
||||
echo "ZIP=\"$zip\"" >> $SYSSTAT_CFG
|
||||
echo "ENABLED=\"$enabled\"" >> $SYSSTAT_CFG
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command $PROG -S DISK -F -L -
|
||||
procd_set_param file $SYSSTAT_CFG
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "sysstat"
|
||||
procd_add_validation validate_sysstat_section
|
||||
}
|
||||
Reference in New Issue
Block a user