Do not generate new machine id if current is valid
Do not generate new machine id if current is valid

dbus-uuidgen was being called every reboot (Issue 1731004) which causes a new /var/lib/dbus/machine-id to be generated each time.  The original reasoning for the change was to ensure we had a valid machine-id, and 'dbus-uuidgen --ensure' would return an error code instead of generating a new id if the existing id was invalid.  A better fix is to only generate a new id if the old one is corrupt.

By checking the return value of dbus-uuidgen, we now only clear the existing machine-id if the function fails.  If machine-id is non-existent, the "--ensure" switch still creates a new file in this case.

Even though it's allowable (ie not catastrophic) to generate a new machine-id each boot, in general this value is expected to be constant over many boots.  PulseAudio is specifically depending on this value to be a unique id for the machine that does not change between boots (and there are likely to be other programs as well).

BUG=crosbug 2043
TEST=Audio volume should be restored to last setting upon reboot.

Review URL: http://codereview.chromium.org/3291006

joshfire/chromiumos-platform-init