joyent/smartos-vmtools — pull request #2 by MerlinDMC (2012-08-25 18:32:08+00:00)
Title: changed mdata-get and two initialization scripts

### mdata-get
mdata-get tries to read from the socket even if it is not available and runs in retries until canceled manually
```
# ./mdata-get dummy
./mdata-get: line 49: /dev/cuau1: No such file or directory
./mdata-get: line 60: 3: Bad file descriptor
mdata-get: timeout getting status. (exit code: 142)
./mdata-get: line 60: 3: Bad file descriptor
...
```
I've added code to check for socket presence before the read loop starts.
### set-root-authorized-keys
If no metadata is set for root_authorized_keys a false .ssh/authorized_keys file is generated.
I've added code to test if the metadata could be read before generating folders and files.
### run-user-script
If the user-script is not set in customer_metadata "No metadata for user-script" is saved in /root/user-script and left there.
I've just added code to remove the file in that single case.