Parcourir la source

logrotate and minor system updates

Danja Vasiliev il y a 10 ans
Parent
commit
bc3206e489

+ 1 - 1
openwrt/common/etc/banner

@@ -5,7 +5,7 @@
            |_|   personal |___| server
  http://superglue.it 
  -----------------------------------------------------
- based on OpenWRT r40774 (trunk)
+ version %VERSION% - based on OpenWRT %REVISION%
  -----------------------------------------------------
  provides now:            will provide:
    * HTTP (lighttpd)        * SMTP      

+ 2 - 2
openwrt/common/etc/config/dhcp

@@ -6,8 +6,8 @@ config dnsmasq
 	option localise_queries '1'
 	option rebind_protection '1'
 	option rebind_localhost '1'
-	option local '/lan/'
-	option domain 'lan'
+	option local '/home/'
+	option domain 'home'
 	option expandhosts '1'
 	option nonegcache '0'
 	option authoritative '1'

+ 7 - 6
openwrt/common/etc/config/fstab

@@ -10,12 +10,13 @@ config 'global' 'automount'
   option  'from_fstab'  '1' 
   option  'anon_mount'  '0' 
 
-config 'mount'
-  option 'label'        'sg-user'
-  option 'target'       '/www/htdocs'
-  option 'enabled'      '1' 
-  option 'enabled_fsck' '0' 
-  option 'options'      'noatime,nodiratime'
+## btrfs is not picked up here
+#config 'mount'
+#  option 'label'        'sg-user'
+#  option 'target'       '/www/htdocs'
+#  option 'enabled'      '1' 
+#  option 'enabled_fsck' '0' 
+#  option 'options'      'noatime,nodiratime'
 
 ## this is for vfat
 #config 'mount'

+ 0 - 1
openwrt/common/etc/config/network

@@ -1,4 +1,3 @@
-
 config interface 'loopback'
 	option ifname 'lo'
 	option proto 'static'

+ 2 - 0
openwrt/common/etc/crontabs/root

@@ -0,0 +1,2 @@
+1 6 * * *	/root/logrotate.sh /www/htdocs/logs/access.log; /root/logrotate.sh /www/htdocs/logs/error.log; /etc/init.d/lighttpd restart
+

+ 3 - 2
openwrt/common/etc/lighttpd/mime.conf

@@ -70,8 +70,9 @@ mimetype.assign             = (
   ".mp4"          =>      "video/mp4",
   ".webm"         =>      "video/webm; codecs='vorbis'",
   ".ogv"          =>      "video/ogg",
-  ""              =>      "text/html",
-# ""              =>      "application/octet-stream",
+  ".ttf"          =>  	  "application/font-sfnt",
+  ".otf"          =>  	  "application/font-sfnt",
+  ""              =>      "text/html"
  )
 
 

+ 9 - 1
openwrt/common/etc/rc.local

@@ -4,7 +4,11 @@
 _SG=/www/htdocs
 
 ## mount if needed
-mountpoint -q $_SG || block mount $_SG
+#mountpoint -q $_SG || block mount $_SG
+#mountpoint -q $_SG || mount -L sg-user -o rw,noatime,nodiratime $_SG
+
+## this seems to be the only way to mount btrfs on boot, ups                                                                       
+(sleep 15; mount /dev/sda3 -o rw,noatime,nodiratime $_SG 
 
 ## if /www is mounted
 mountpoint -q $_SG && (
@@ -41,4 +45,8 @@ mountpoint -q $_SG && (
 
   )
 
+## needed to make lighty use mounted location for logs
+/etc/init.d/lighttpd restart
+)&
+
 exit 0

+ 1 - 1
openwrt/common/etc/uci-defaults/20-set-ssid

@@ -1,5 +1,5 @@
 _MAC=$(iw wlan0 info | awk 'BEGIN { FS=":" } /addr/ { print $5$6 }')                 
-_MAC="SuperGlue-"$_MAC                                                               
+_MAC="Superglue-"$_MAC                                                               
 
 [ $(uci get wireless.@wifi-iface[0].ssid) != $_MAC ] && (
   uci set wireless.@wifi-iface[0].ssid=$_MAC

+ 11 - 0
openwrt/common/root/logrotate.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+_FILE=$1
+_DATE=$(date +%s)
+
+gzip -f $_FILE && 
+mv $_FILE.gz $_FILE.$_DATE.gz
+
+
+
+