Skip to content

Commit

Permalink
Merge pull request #2397 from Fourdee/samba-cache
Browse files Browse the repository at this point in the history
DietPi-Software | Samba: Move disk cache to RAM
  • Loading branch information
Fourdee authored Jan 7, 2019
2 parents 9ab0bb3 + 6c03b20 commit 8a59961
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Changes / Improvements / Optimisations:
- DietPi-Software | NAA Daemon: Updated to 3.5.5-39. Thanks to @volpone for the heads up: https://github.com/Fourdee/DietPi/issues/2387#issue-395321320
- DietPi-Software | MPD: Updated to 0.20.23-1. Includes support for NFS and Samba: https://github.com/Fourdee/DietPi/issues/2377
- DietPi-Software | MPD: Now runs as "mpd" user again, updated systemd unit to match official one and better handle existing cache and log files on reinstall: https://github.com/Fourdee/DietPi/issues/2378
- DietPi-Software | Samba: Moved disk cache to RAM to reduce disk I/O. Thanks to @WolfganP for suggesting this enhancement: https://github.com/Fourdee/DietPi/issues/2396
- DietPi-Update | Added optional ability to automatically update DietPi, when updates are available. Please note, this is disabled by default.
- DietPi-Sync | Removed the compression option, which has no effect on local sync, since files are not stored compressed, but only transferred compressed through remote sync protocols, which are currently not offered by DietPi-Sync.
- General | Moved the remaining conf/* files located on DietPi-RAMdisk to /var/lib/dietpi or into DietPi-PREP, and removed /DietPi/dietpi/conf completely. These files were only used once or never, thus have no business inside the RAMdisk.
Expand Down
13 changes: 13 additions & 0 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -3351,6 +3351,17 @@ _EOF_
if (( ${aSOFTWARE_INSTALL_STATE[$software_id]} == 1 )); then

Banner_Installing

# Link disk cache to RAM: https://github.com/Fourdee/DietPi/issues/2396
# - Remove previous disk cache dir or symlink
[[ -e /var/cache/samba ]] && rm -R /var/cache/samba
# - Pre-create RAM cache dir
mkdir -p /var/run/samba-cache
# - Link disk cache to RAM
ln -s /var/run/samba-cache /var/cache/samba
# - Create RAM cache dir automatically on boot
echo 'd /var/run/samba-cache - - - - -' > /etc/tmpfiles.d/dietpi-samba_cache.conf

G_AGI samba

fi
Expand Down Expand Up @@ -13292,6 +13303,8 @@ _EOF_

Banner_Uninstalling
G_AGP samba samba-common-bin
[[ -f /etc/tmpfiles.d/dietpi-samba_cache.conf ]] && rm /etc/tmpfiles.d/dietpi-samba_cache.conf
[[ -d /var/run/samba-cache ]] && rm -R /var/run/samba-cache

fi

Expand Down
3 changes: 2 additions & 1 deletion dietpi/patch_file
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,8 @@ You will not face any practical differences, since both services start the same
# Netdata: https://github.com/Fourdee/DietPi/pull/2337
# NAA Daemon: https://github.com/Fourdee/DietPi/issues/2387#issue-395321320
# MPD: https://github.com/Fourdee/DietPi/issues/2377
(( $G_DIETPI_INSTALL_STAGE == 2 )) && /DietPi/dietpi/dietpi-software reinstall 45 65 124 128 131
# Samba: https://github.com/Fourdee/DietPi/issues/2396#issuecomment-451701569
(( $G_DIETPI_INSTALL_STAGE == 2 )) && /DietPi/dietpi/dietpi-software reinstall 45 65 124 128 131 96
#-------------------------------------------------------------------------------
#Docker fix on RPi due to faulty current "docker-ce" repo version: https://github.com/Fourdee/DietPi/issues/2282
local dpkg_out=''
Expand Down

0 comments on commit 8a59961

Please sign in to comment.