0
0
mirror of https://github.com/Doodle3D/doodle3d-firmware.git synced 2024-12-22 02:53:49 +01:00

Log rotation:

- install logrotate wifibox.conf file,
- create directories required for log rotation on boot.
This commit is contained in:
Wouter R 2016-03-16 22:33:38 +01:00
parent 61fcb7ecb6
commit 453ec4294f
3 changed files with 20 additions and 2 deletions

View File

@ -70,6 +70,7 @@ endef
# sysupgrade to determine which files to keep (see `opkg list-changed-conffiles`).
define Package/wifibox/conffiles
/etc/config/wifibox
/etc/logrotate.d/wifibox.conf
endef
# The $(1) variable represents the root directory on the router running
@ -94,6 +95,7 @@ define Package/wifibox/install
#$(INSTALL_DIR) $(1)/etc
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/logrotate.d
$(INSTALL_DIR) $(1)/root/
$(INSTALL_DIR) $(1)/root/sketches
#$(INSTALL_DIR) $(1)/www
@ -117,6 +119,7 @@ define Package/wifibox/install
$(INSTALL_BIN) $(WIFIBOX_BASE_DIR)/script/dhcpcheck_init $(1)/etc/init.d/dhcpcheck
$(INSTALL_BIN) $(WIFIBOX_BASE_DIR)/script/d3dapi $(1)/$(TGT_LUA_DIR_SUFFIX)/script
$(INSTALL_BIN) $(WIFIBOX_BASE_DIR)/script/signin.sh $(1)/$(TGT_LUA_DIR_SUFFIX)/script
$(CP) $(WIFIBOX_BASE_DIR)/script/logrotate-wifibox.conf $(1)/etc/logrotate.d/wifibox.conf
$(CP) $(WIFIBOX_BASE_DIR)/script/wifibox.uci.config $(1)/etc/config/wifibox # copy base configuration to uci config dir
$(CP) $(WIFIBOX_BASE_DIR)/FIRMWARE-VERSION $(1)/etc/wifibox-version

View File

@ -0,0 +1,13 @@
# Doodle3D logrotate configuration
compress
su
create
/tmp/wifibox.log /tmp/print3d-*.log {
rotate 2
size 1000k
missingok
olddir /tmp/wifibox-rotated
copytruncate
}

View File

@ -17,9 +17,11 @@ boot() {
$LOGGER "Invoking Doodle3D WiFi box network auto-initialization..."
/usr/share/lua/wifibox/script/d3dapi autowifi
$LOGGER "Start signing in..."
/usr/share/lua/wifibox/script/signin.sh > /dev/null 2> /dev/null &
$LOGGER "Start signing in..."
/usr/share/lua/wifibox/script/signin.sh > /dev/null 2> /dev/null &
mkdir -p /var/lib # required by logrotate for logrotate.status
mkdir -p /tmp/wifibox-rotated # this is where rotated wifibox logs are placed
}
start() {