mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] machine-id
@ 2014-03-31 13:13 Gieseler, Christian
  2014-04-01 14:18 ` Michael Olbrich
  0 siblings, 1 reply; 4+ messages in thread
From: Gieseler, Christian @ 2014-03-31 13:13 UTC (permalink / raw)
  To: ptxdist

Hi List,

while thinking how to preserve the existing machine-id after an complete update I had I look how this is generated. In the rc-once.d folder there is a script generating an id and systemd also has the capability to generate one and obviously does check for a valid machine-id and regenerates one in case of an invalid/non exisiting one.
Looking into the dependencys  the ptxdist machine-id script is selectd with systemd. Is the existance of the ptxdist machine-id necessary if systemd takes care of the machine id?
And finaly coming back to the original question what is the best way to preserve the machine-id? Patching Systemd to change the hardcoded path? Or are there other smarter solutions?

Best regards
Christian Gieseler



-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] machine-id
  2014-03-31 13:13 [ptxdist] machine-id Gieseler, Christian
@ 2014-04-01 14:18 ` Michael Olbrich
  2014-04-02 14:25   ` Gieseler, Christian
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Olbrich @ 2014-04-01 14:18 UTC (permalink / raw)
  To: ptxdist

On Mon, Mar 31, 2014 at 01:13:28PM +0000, Gieseler, Christian wrote:
> while thinking how to preserve the existing machine-id after an complete
> update I had I look how this is generated. In the rc-once.d folder there is a
> script generating an id and systemd also has the capability to generate one
> and obviously does check for a valid machine-id and regenerates one in case
> of an invalid/non exisiting one.
> Looking into the dependencys  the ptxdist machine-id script is selectd with
> systemd. Is the existance of the ptxdist machine-id necessary if systemd
> takes care of the machine id?
> And finaly coming back to the original question what is the best way to
> preserve the machine-id? Patching Systemd to change the hardcoded path? Or
> are there other smarter solutions?

The machine-id is read very early, so even if you change the path in
systemd, so the path must be in the rootfs and is probably overwritten
during a complete update.
You could explicitly save the machine-id before an update and copy it back
afterwards.
If you have an initrd then you could bind mount  your machine-id to
/etc/machine-id before starting systemd.

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] machine-id
  2014-04-01 14:18 ` Michael Olbrich
@ 2014-04-02 14:25   ` Gieseler, Christian
  2014-04-02 16:17     ` Michael Olbrich
  0 siblings, 1 reply; 4+ messages in thread
From: Gieseler, Christian @ 2014-04-02 14:25 UTC (permalink / raw)
  To: ptxdist

Hi Michael,

> -----Original Message-----
> From: ptxdist-bounces@pengutronix.de [mailto:ptxdist-
> bounces@pengutronix.de] On Behalf Of Michael Olbrich
> Sent: Tuesday, April 01, 2014 4:18 PM
> To: ptxdist@pengutronix.de
> Subject: Re: [ptxdist] machine-id
> 
> On Mon, Mar 31, 2014 at 01:13:28PM +0000, Gieseler, Christian wrote:
> > while thinking how to preserve the existing machine-id after an
> > complete update I had I look how this is generated. In the rc-once.d
> > folder there is a script generating an id and systemd also has the
> > capability to generate one and obviously does check for a valid
> > machine-id and regenerates one in case of an invalid/non exisiting one.
> > Looking into the dependencys  the ptxdist machine-id script is selectd
> > with systemd. Is the existance of the ptxdist machine-id necessary if
> > systemd takes care of the machine id?
> > And finaly coming back to the original question what is the best way
> > to preserve the machine-id? Patching Systemd to change the hardcoded
> > path? Or are there other smarter solutions?
> 
> The machine-id is read very early, so even if you change the path in systemd,
> so the path must be in the rootfs and is probably overwritten during a
> complete update.
> You could explicitly save the machine-id before an update and copy it back
> afterwards.
> If you have an initrd then you could bind mount  your machine-id to
> /etc/machine-id before starting systemd.

Ok, thats clear and easy to implement.

Can you explain why one needs the script /etc/rc.once.d/machine-id if the machine id is generated by systemd?

Best regards
Christian

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] machine-id
  2014-04-02 14:25   ` Gieseler, Christian
@ 2014-04-02 16:17     ` Michael Olbrich
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Olbrich @ 2014-04-02 16:17 UTC (permalink / raw)
  To: ptxdist

Hi,

On Wed, Apr 02, 2014 at 02:25:29PM +0000, Gieseler, Christian wrote:
> > On Mon, Mar 31, 2014 at 01:13:28PM +0000, Gieseler, Christian wrote:
> > > while thinking how to preserve the existing machine-id after an
> > > complete update I had I look how this is generated. In the rc-once.d
> > > folder there is a script generating an id and systemd also has the
> > > capability to generate one and obviously does check for a valid
> > > machine-id and regenerates one in case of an invalid/non exisiting one.
> > > Looking into the dependencys  the ptxdist machine-id script is selectd
> > > with systemd. Is the existance of the ptxdist machine-id necessary if
> > > systemd takes care of the machine id?
> > > And finaly coming back to the original question what is the best way
> > > to preserve the machine-id? Patching Systemd to change the hardcoded
> > > path? Or are there other smarter solutions?
> > 
> > The machine-id is read very early, so even if you change the path in systemd,
> > so the path must be in the rootfs and is probably overwritten during a
> > complete update.
> > You could explicitly save the machine-id before an update and copy it back
> > afterwards.
> > If you have an initrd then you could bind mount  your machine-id to
> > /etc/machine-id before starting systemd.
> 
> Ok, thats clear and easy to implement.
> 
> Can you explain why one needs the script /etc/rc.once.d/machine-id if the
> machine id is generated by systemd?

If the rootfs is read-only, then systemd will bind-mount a file on a tmpfs
to /etc/machine-id and fill it with a uuid. Without
/etc/rc.once.d/machine-id this would happen on every boot.
When /etc/rc.once.d/machine-id runs the rootfs is temporarily writeable and
the machine-id is copied to the rootfs to make it permanent.

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-02 16:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-31 13:13 [ptxdist] machine-id Gieseler, Christian
2014-04-01 14:18 ` Michael Olbrich
2014-04-02 14:25   ` Gieseler, Christian
2014-04-02 16:17     ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox