diff options
author | nachoparker <nacho@ownyourbits.com> | 2018-03-03 14:46:04 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2018-03-04 18:59:06 +0300 |
commit | 18e35dfdbb5a828c646a6c0e24a394840123cfbf (patch) | |
tree | 0c9721ebb306033d74b941d71f9f004d3479484c /etc | |
parent | 45a8800cd8a49bd2960f96f0d64557cbf0c6cf30 (diff) |
nc-automount: fix dependenciesv0.46.37
Diffstat (limited to 'etc')
-rw-r--r-- | etc/nextcloudpi-config.d/fail2ban.sh | 8 | ||||
-rw-r--r-- | etc/nextcloudpi-config.d/nc-automount.sh | 10 | ||||
-rw-r--r-- | etc/nextcloudpi-config.d/nc-ramlogs.sh | 2 | ||||
-rw-r--r-- | etc/nextcloudpi-config.d/nc-swapfile.sh | 11 |
4 files changed, 18 insertions, 13 deletions
diff --git a/etc/nextcloudpi-config.d/fail2ban.sh b/etc/nextcloudpi-config.d/fail2ban.sh index c3426259..ddb8511d 100644 --- a/etc/nextcloudpi-config.d/fail2ban.sh +++ b/etc/nextcloudpi-config.d/fail2ban.sh @@ -19,10 +19,10 @@ ACTIVE_=no BANTIME_=600 # cooldown time for incorrect passwords -FINDTIME_=600 +FINDTIME_=600 # bad attempts before banning an IP -MAXRETRY_=6 +MAXRETRY_=6 # email to send notifications to EMAIL_=optional@email.com @@ -65,6 +65,10 @@ EOF sed -i 's|Fail2Ban|NextCloudPi|' /etc/fail2ban/action.d/sendmail-whois-lines.conf grep -q actionstart_ "$F" || sed -i 's|actionstart|actionstart_|' "$F" grep -q actionstop_ "$F" || sed -i 's|actionstop|actionstop_|' "$F" + + # delay init because of automount + sed -i "/^ExecStart=/iExecStartPre=/bin/sleep 10" /lib/systemd/system/fail2ban.service + } configure() diff --git a/etc/nextcloudpi-config.d/nc-automount.sh b/etc/nextcloudpi-config.d/nc-automount.sh index 1d9cbed4..3841e0ab 100644 --- a/etc/nextcloudpi-config.d/nc-automount.sh +++ b/etc/nextcloudpi-config.d/nc-automount.sh @@ -38,7 +38,7 @@ EOF cat > /usr/lib/systemd/system/nc-automount.service <<'EOF' [Unit] Description=Automount USB drives -Before=mysqld.service +Before=mysqld.service dphys-swapfile.service fail2ban.service smbd.service nfs-server.service [Service] Restart=always @@ -51,6 +51,7 @@ EOF cat > /usr/lib/systemd/system/nc-automount-links.service <<'EOF' [Unit] Description=Monitor /media for mountpoints and create USBdrive* symlinks +Before=nc-automount.service [Service] Restart=always @@ -96,11 +97,8 @@ done EOF chmod +x /usr/local/etc/nc-automount-links-mon - # adjust when mariaDB starts - local DBUNIT=/lib/systemd/system/mariadb.service - grep -q sleep $DBUNIT || sed -i "/^ExecStart=/iExecStartPre=/bin/sleep 10" $DBUNIT - - systemctl daemon-reload + # delay init because of automount + sed -i "/^ExecStart=/iExecStartPre=/bin/sleep 10" /lib/systemd/system/mariadb.service } configure() diff --git a/etc/nextcloudpi-config.d/nc-ramlogs.sh b/etc/nextcloudpi-config.d/nc-ramlogs.sh index 9459f32d..88b48828 100644 --- a/etc/nextcloudpi-config.d/nc-ramlogs.sh +++ b/etc/nextcloudpi-config.d/nc-ramlogs.sh @@ -41,7 +41,7 @@ EOF [Unit] Description=Populate ramlogs dir Requires=network.target -Before=redis-server apache2 mysqld +Before=redis-server.service apache2.service mysqld.service [Service] ExecStart=/bin/bash /usr/local/bin/ramlog-dirs.sh diff --git a/etc/nextcloudpi-config.d/nc-swapfile.sh b/etc/nextcloudpi-config.d/nc-swapfile.sh index 7587847b..3f2c1670 100644 --- a/etc/nextcloudpi-config.d/nc-swapfile.sh +++ b/etc/nextcloudpi-config.d/nc-swapfile.sh @@ -44,19 +44,22 @@ configure() 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 &>/dev/null - # workaround for automount, systemd doesn't get the order right - grep -q sleep /etc/init.d/dphys-swapfile || sed -i "/\<start)/asleep 15" /etc/init.d/dphys-swapfile - dphys-swapfile setup && dphys-swapfile swapon && { [[ -f "$ORIG" ]] && swapoff "$ORIG" && rm -f "$ORIG" echo "swapfile moved successfully" return 0 } + echo "moving swapfile failed" return 1 } -install() { :; } +install() +{ + # delay init because of automount + sed -i "/\<start)/asleep 30" /etc/init.d/dphys-swapfile +} + # License # |