Changeset View
Changeset View
Standalone View
Standalone View
libexec/rc/rc.d/machine_id
- This file was added.
#!/bin/sh | |||||||||||
# | |||||||||||
# $FreeBSD$ | |||||||||||
# | |||||||||||
# PROVIDE: machine_id | |||||||||||
# REQUIRE: mountcritremote FILESYSTEMS | |||||||||||
# BEFORE: LOGIN | |||||||||||
. /etc/rc.subr | |||||||||||
: ${machine_id_file:=/var/db/machine-id} | |||||||||||
: ${machine_id_perms:=444} | |||||||||||
name="machine_id" | |||||||||||
desc="Update ${machine_id_file}" | |||||||||||
rcvar="machine_id_enable" | |||||||||||
start_cmd="machine_id_start" | |||||||||||
stop_cmd=":" | |||||||||||
machine_id_start() | |||||||||||
{ | |||||||||||
if [ ! -f ${machine_id_file} ] ; then | |||||||||||
startmsg -n "Creating ${machine_id_file} " | |||||||||||
t=$(mktemp -t machine-id) | |||||||||||
arichardsonUnsubmitted Done Inline Actions
arichardson: | |||||||||||
/bin/uuidgen -r -o $t | |||||||||||
install -C -o root -g wheel -m ${machine_id_perms} "$t" "${machine_id_file}" | |||||||||||
rm -f "$t" | |||||||||||
startmsg 'done.' | |||||||||||
fi | |||||||||||
} | |||||||||||
Done Inline Actions
Do we want this message displayed every time after the machine-id file is created? jlduran_gmail.com: Do we want this message displayed every time after the machine-id file is created? | |||||||||||
Done Inline ActionsPlease, discard the comment. jlduran_gmail.com: Please, discard the comment.
It was supposed to be just the removal of `-n` (should be echoed… | |||||||||||
Done Inline Actionsthe machine-id file should only be generated once, ideally. tcberner: the machine-id file should only be generated once, ideally. | |||||||||||
load_rc_config $name | |||||||||||
run_rc_command "$1" |