Install a one-shot service to initialize hostid
This commit is contained in:
parent
346c3cb5eb
commit
7ebf94cc23
3 changed files with 28 additions and 2 deletions
8
initialize-host-id
Normal file
8
initialize-host-id
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Initialize /etc/hostid if it doesn't exist or is empty
|
||||
#
|
||||
if [ ! -f /etc/hostid -o "$(cat /etc/hostid 2>/dev/null)" = "" ]; then
|
||||
hexdump -n 4 -e '"%02x"' /dev/urandom >/etc/hostid
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue