mirror of
https://github.com/henrygd/beszel.git
synced 2026-09-18 05:54:17 +00:00
fix(install): generate /etc/machine-id on systems without /proc (#2274)
* fix(install): generate /etc/machine-id on systems without /proc The install script read the fingerprint UUID from /proc/sys/kernel/random/uuid, which FreeBSD does not have. On pfSense the redirect still created /etc/machine-id, cat failed, and the agent was left with an empty machine-id file. The [ ! -f ] guard then skipped regeneration on every later run. Fall back to uuidgen when /proc is unavailable, mirroring how the script already picks between sha256sum and FreeBSD's sha256, and leave no file behind when neither source exists. * fix(install): regenerate empty machine id
This commit is contained in:
@@ -796,9 +796,16 @@ set_selinux_context
|
||||
# Cleanup
|
||||
rm -rf "$TEMP_DIR"
|
||||
|
||||
# Make sure /etc/machine-id exists for persistent fingerprint
|
||||
if [ ! -f /etc/machine-id ]; then
|
||||
cat /proc/sys/kernel/random/uuid | tr -d '-' > /etc/machine-id
|
||||
# Make sure /etc/machine-id exists and is non-empty for persistent fingerprint
|
||||
if [ ! -s /etc/machine-id ]; then
|
||||
if [ -r /proc/sys/kernel/random/uuid ]; then
|
||||
tr -d '-' < /proc/sys/kernel/random/uuid > /etc/machine-id
|
||||
elif command -v uuidgen >/dev/null; then
|
||||
# FreeBSD has no /proc/sys/kernel/random/uuid
|
||||
uuidgen | tr -d '-' > /etc/machine-id
|
||||
else
|
||||
echo "No UUID source found, skipping /etc/machine-id creation"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check for NVIDIA GPUs and grant device permissions for systemd service
|
||||
|
||||
Reference in New Issue
Block a user