thin-edge / tedge-rugpi-image

thin-edge.io Raspberry Pi 0/1B/2B/3/4/5 image using rugpi for A/B updates
https://thin-edge.io/
2 stars 8 forks source link

hostname is not updated in /etc/hosts #42

Closed reubenmiller closed 10 months ago

reubenmiller commented 10 months ago

The tedge-bootstrap service fails to update the /etc/hosts with the hardware based serial number as sed fails due to Device or resource busy error.

The full logs of the tedge-bootstrap service are shown below:

journalctl -u tedge-bootstrap -n 100
Oct 11 11:53:13 raspberrypi tedge-bootstrap[357]: rpi1-b827eb353f56
Oct 11 11:53:32 rpi1-b827eb353f56 tedge-bootstrap[315]: Setting device.type to tedge_rugpi_armhf_pi01
Oct 11 11:53:33 rpi1-b827eb353f56 tedge-bootstrap[467]: sed: cannot rename /etc/sedU9pvYr: Device or resource busy
Oct 11 11:53:33 rpi1-b827eb353f56 tedge-bootstrap[315]: Failed to set /etc/hosts record. Retries left 9
Oct 11 11:53:35 rpi1-b827eb353f56 tedge-bootstrap[471]: sed: cannot rename /etc/sedykXm9u: Device or resource busy
Oct 11 11:53:35 rpi1-b827eb353f56 tedge-bootstrap[315]: Failed to set /etc/hosts record. Retries left 8
Oct 11 11:53:37 rpi1-b827eb353f56 tedge-bootstrap[473]: sed: cannot rename /etc/sedYFvofB: Device or resource busy
Oct 11 11:53:38 rpi1-b827eb353f56 tedge-bootstrap[315]: Failed to set /etc/hosts record. Retries left 7
Oct 11 11:53:40 rpi1-b827eb353f56 tedge-bootstrap[479]: sed: cannot rename /etc/sedUDFhkQ: Device or resource busy
Oct 11 11:53:40 rpi1-b827eb353f56 tedge-bootstrap[315]: Failed to set /etc/hosts record. Retries left 6
Oct 11 11:53:42 rpi1-b827eb353f56 tedge-bootstrap[496]: sed: cannot rename /etc/sedAxZTlr: Device or resource busy
Oct 11 11:53:42 rpi1-b827eb353f56 tedge-bootstrap[315]: Failed to set /etc/hosts record. Retries left 5
Oct 11 11:53:44 rpi1-b827eb353f56 tedge-bootstrap[498]: sed: cannot rename /etc/sedsdBfGs: Device or resource busy
Oct 11 11:53:44 rpi1-b827eb353f56 tedge-bootstrap[315]: Failed to set /etc/hosts record. Retries left 4
Oct 11 11:53:47 rpi1-b827eb353f56 tedge-bootstrap[500]: sed: cannot rename /etc/sed6H0ziQ: Device or resource busy
Oct 11 11:53:47 rpi1-b827eb353f56 tedge-bootstrap[315]: Failed to set /etc/hosts record. Retries left 3
Oct 11 11:53:49 rpi1-b827eb353f56 tedge-bootstrap[521]: sed: cannot rename /etc/sedWgdF59: Device or resource busy
Oct 11 11:53:49 rpi1-b827eb353f56 tedge-bootstrap[315]: Failed to set /etc/hosts record. Retries left 2
Oct 11 11:53:51 rpi1-b827eb353f56 tedge-bootstrap[547]: sed: cannot rename /etc/sedg3QkqR: Device or resource busy
Oct 11 11:53:51 rpi1-b827eb353f56 tedge-bootstrap[315]: Failed to set /etc/hosts record. Retries left 1
Oct 11 11:53:53 rpi1-b827eb353f56 tedge-bootstrap[562]: sed: cannot rename /etc/sedyYvUEV: Device or resource busy
Oct 11 11:53:53 rpi1-b827eb353f56 tedge-bootstrap[315]: Failed to set /etc/hosts record. Retries left 0
Oct 11 11:53:55 rpi1-b827eb353f56 systemd[1]: tedge-bootstrap.service: Deactivated successfully.
Oct 11 11:53:55 rpi1-b827eb353f56 systemd[1]: Finished tedge-bootstrap.service - Set hostname on startup.
Oct 11 11:53:55 rpi1-b827eb353f56 systemd[1]: tedge-bootstrap.service: Consumed 1.202s CPU time.