Skip to content

Commit f45cd57

Browse files
authored
Merge pull request #540 from Xazziri/master
Improve startup speeds in some situations by using find before chown
2 parents c8216ef + 13776f5 commit f45cd57

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

rootfs/etc/cont-init.d/03-config.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ if [ -d "${LIBRENMS_PATH}/html/plugins/Weathermap" ]; then
105105
ln -sf /data/weathermap ${LIBRENMS_PATH}/html/plugins/Weathermap/configs
106106
fi
107107
chown -h librenms:librenms ${LIBRENMS_PATH}/html/plugins/Weathermap/configs
108-
chown -R librenms:librenms /data/weathermap ${LIBRENMS_PATH}/html/plugins/Weathermap/output
108+
find /data/weathermap ${LIBRENMS_PATH}/html/plugins/Weathermap/output \( ! -user librenms -o ! -group librenms \) -exec chown librenms:librenms {} +
109109
fi
110110

111111
# cleanup bad symlink: https://github.com/librenms/docker/issues/294#issuecomment-1190389960
@@ -219,7 +219,7 @@ done
219219
# Fix perms
220220
echo "Fixing perms..."
221221
chown librenms:librenms /data/config /data/monitoring-plugins /data/plugins /data/rrd /data/weathermap /data/alert-templates
222-
chown -R librenms:librenms /data/logs ${LIBRENMS_PATH}/composer* ${LIBRENMS_PATH}/config.d ${LIBRENMS_PATH}/bootstrap ${LIBRENMS_PATH}/logs ${LIBRENMS_PATH}/storage ${LIBRENMS_PATH}/vendor
222+
find /data/logs ${LIBRENMS_PATH}/composer* ${LIBRENMS_PATH}/config.d ${LIBRENMS_PATH}/bootstrap ${LIBRENMS_PATH}/logs ${LIBRENMS_PATH}/storage ${LIBRENMS_PATH}/vendor \( ! -user librenms -o ! -group librenms \) -exec chown librenms:librenms {} +
223223
chmod ug+rw /data/logs /data/rrd ${LIBRENMS_PATH}/bootstrap/cache ${LIBRENMS_PATH}/storage ${LIBRENMS_PATH}/storage/framework/*
224224

225225
# Check additional Monitoring plugins

0 commit comments

Comments
 (0)