:: Re: [DNG] new freedesktop "standard…
Top Page
Delete this message
Reply to this message
Author: Alessandro Selli
Date:  
To: dng
Subject: Re: [DNG] new freedesktop "standard": /etc/machine-id
On 09/03/19 at 00:28, Arnt Karlsen wrote:
> On Fri, 8 Mar 2019 22:56:36 +0100, Alessandro wrote in message
> <93850f1a-3feb-adc9-1cd0-8ca8736fc970@???>:
>
>> On 08/03/19 at 18:38, Arnt Karlsen wrote:
>>> ..my /etc/cron.d/machine-id:
>>> PATH=/bin:/usr/bin:/sbin:/usr/sbin
>>>
>>> # ..a new /etc/machine-id every minute... ;o)
>>> * * * * * root date |md5sum |cut -d" " -f-1 >/etc/machine-id |tee
>>> >/dev/null 2>&1
>>
>>   What is tee doing there?
> ..allows logging the generated IDs with e.g.
> " |tee >>/var/log/machine-IDs ", some people
> might need to do that.



  I see.  I would leave logging to it's specific command, though:


echo $RANDOM | md5sum | cut -c 1-32 > /etc/machine-id && logger -p local1.info '/etc/machine randomly regenerated' || logger -p local1.err 'Random regeneration of /etc/machine failed'

But this is just a matter of personal choice.
 

> ..both valid improvements, me, I might go: " * * * * * root \
> fortune &&date |md5sum |cut -d" " -f-1 >/etc/machine-id |tee \
> >/dev/null 2>&1 " to keep this lightweight in my end and not
> in the other end. :o)



  The use of fortune as a RNG is telling of the number of gray hair you
must have!  😀



--
Alessandro Selli <alessandroselli@???>
VOIP SIP: dhatarattha@???
Chiave firma e cifratura PGP/GPG signing and encoding key:
BA651E4050DDFC31E17384BABCE7BD1A1B0DF2AE