mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-09 14:42:01 -03:30
bugfixes RAM logs, swap and nc-database
This commit is contained in:
parent
e1c46b51b4
commit
aec77e4ee4
@ -33,6 +33,7 @@ install()
|
||||
|
||||
# CONFIGURE
|
||||
cp /etc/modsecurity/modsecurity.conf-recommended /etc/modsecurity/modsecurity.conf
|
||||
sed -i "s|SecRuleEngine .*|SecRuleEngine Off|" /etc/modsecurity/modsecurity.conf
|
||||
sed -i 's|SecTmpDir .*|SecTmpDir /var/cache/modsecurity/|' /etc/modsecurity/modsecurity.conf
|
||||
sed -i 's|SecDataDir .*|SecDataDir /var/cache/modsecurity/|' /etc/modsecurity/modsecurity.conf
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ configure()
|
||||
rmdir "$DBDIR_"
|
||||
}
|
||||
|
||||
local BASEDIR=$( dirname "$DATADIR_" )
|
||||
local BASEDIR=$( dirname "$DBDIR_" )
|
||||
mkdir -p "$BASEDIR"
|
||||
|
||||
[[ $( stat -fc%d / ) == $( stat -fc%d $BASEDIR ) ]] && \
|
||||
|
||||
@ -32,10 +32,10 @@ tmpfs /var/log tmpfs defaults,noatime,mode=1777 0 0 # Logs in RAM
|
||||
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0 # /tmp in RAM
|
||||
EOF
|
||||
|
||||
local HTTPUNIT=/etc/systemd/system/multi-user.target.wants/apache2.service
|
||||
local HTTPUNIT=/lib/systemd/system/apache2.service
|
||||
grep -q mkdir /etc/init.d/mysql || sed -i "/\<start)/amkdir -p /var/log/mysql" /etc/init.d/mysql
|
||||
grep -q mkdir /etc/init.d/apache2 || sed -i "/\<start)/amkdir -p /var/log/apache2" /etc/init.d/apache2
|
||||
grep -q mkdir $HTTPUNIT || sed -i "ExecStartPre=/bin/mkdir -p /var/log/apache2" $HTTPUNIT
|
||||
grep -q mkdir $HTTPUNIT || sed -i "/ExecStart/iExecStartPre=/bin/mkdir -p /var/log/apache2" $HTTPUNIT
|
||||
|
||||
grep -q vm.swappiness /etc/sysctl.conf || echo "vm.swappiness = 10" >> /etc/sysctl.conf && sysctl --load
|
||||
echo "Logs in RAM. Reboot for changes to take effect"
|
||||
|
||||
@ -21,13 +21,16 @@ DESCRIPTION="Move and resize your swapfile. Recommended to move to a permanent U
|
||||
|
||||
configure()
|
||||
{
|
||||
[[ $( stat -fc%d / ) == $( stat -fc%d $SWAPFILE_ ) ]] && \
|
||||
local ORIG=$( grep -oP "CONF_SWAPFILE=.*" /etc/dphys-swapfile | cut -f2 -d= )
|
||||
[[ "$ORIG" == "$SWAPFILE_" ]] && return
|
||||
|
||||
[[ $( stat -fc%d / ) == $( stat -fc%d $( dirname $SWAPFILE_ ) ) ]] && \
|
||||
echo -e "INFO: moving swapfile to another place in the same SD card\nIf you want to use an external mount, make sure it is properly set up"
|
||||
|
||||
sed -i "s|#\?CONF_SWAPFILE=.*|CONF_SWAPFILE=$SWAPFILE_|" /etc/dphys-swapfile
|
||||
sed -i "s|#\?CONF_SWAPSIZE=.*|CONF_SWAPSIZE=$SWAPSIZE_|" /etc/dphys-swapfile
|
||||
grep -q vm.swappiness /etc/sysctl.conf || echo "vm.swappiness = 10" >> /etc/sysctl.conf && sysctl --load
|
||||
service dphys-swapfile restart
|
||||
service dphys-swapfile restart && swapoff "$ORIG" && rm -f "$ORIG"
|
||||
}
|
||||
|
||||
install() { :; }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user