machinekit.ini and MKUUID

78 views
Skip to first unread message

schoo...@gmail.com

unread,
Jan 16, 2019, 10:07:35 AM1/16/19
to Machinekit Mailing List
Hi All,

Just an advisory, which may or may not affect you.

Since inception, /etc/linuxcnc has contained a hard coded UUID under the 'MKUUID=' field

This despite the text above it stating that all machines should have a unique MKUUID to enable the
zeroconf browsing for particular instances to work.

This has now actually caused problems, with some users exploring the networked communications aspect
of machinekit, as perhaps it was originally envisaged.

So, from today for RIP builds and as of machinekit package serial 'machinekit_0.1.1547649222.gitc44e93e-1' onwards,
there are a couple of wrinkles to be aware of, if you actually intend using the MKUUID for anything.

RIP builds
A fresh clone will generate a new UUID when built.
If you want to use a particular UUID, keep it in a separate system file called /etc/linuxcnc/mkuuid [1] and manually edit RIP/etc/linuxcnc/machinekit.ini to use it.
When you rebuild the machinekit.ini UUID will be preserved, however be aware doing a complete ' git clean -xdf && ./autogen.sh && ./configure' will wipe it.

([1] For RIPs, this file is just a suggested failsafe storage option for now, it will actually be used by package installs)

Package installs
A package install onto a blank system will generate a new UUID.

If you are updating and do not purge your configs:
  • If the package finds an /etc/linuxcnc/mkuuid file [1], it will use the MKUUID within if valid, over any other option.
  • If machinekit.ini exists with a valid UUID, it will use that.  Otherwise it will update with the generated UUID.
  • If machinekit.ini is missing even though the previous package was not purged, it will generate one with a valid UUID.

For the vast majority of users, this change will have no impact, their configs just use whatever UUID is in machinekit.ini, if at all,
without consequence.

regards

mugginsac

unread,
Feb 14, 2019, 1:57:00 PM2/14/19
to Machinekit
I just built a fresh uSD from one of Robert Nelson's images. It does not include uuid-runtime.
Since machinekit now has to have a uuid generated the first time it is run, shouldn't uuid-runtime be part of the Machinekit requirements.

Alan

ce...@tuta.io

unread,
Feb 14, 2019, 3:26:47 PM2/14/19
to Machinekit

Cern

Dne čtvrtek 14. února 2019 19:57:00 UTC+1 mugginsac napsal(a):

mugginsac

unread,
Feb 14, 2019, 5:05:57 PM2/14/19
to Machinekit
I loaded the things that I need to run machinekit (ssh, xorg, openbox, uuid-runtime), and no luck in Muddville. I am back to the other error.
So maybe the apparent lack of uuid-runtime is a red herring.

Ryan Press

unread,
Feb 15, 2019, 5:02:26 AM2/15/19
to mugginsac, Machinekit Mailing List
I had the same problem with a fresh Debian Stretch install, just a few days ago.

Ryan

--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to machinekit+...@googlegroups.com.
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

schoo...@gmail.com

unread,
Feb 15, 2019, 5:56:53 AM2/15/19
to machi...@googlegroups.com

On 15/02/19 10:02, Ryan Press wrote:
I had the same problem with a fresh Debian Stretch install, just a few days ago.

Ryan

On Thu, Feb 14, 2019, 1:57 PM mugginsac <mugg...@gmail.com wrote:
I just built a fresh uSD from one of Robert Nelson's images. It does not include uuid-runtime.
Since machinekit now has to have a uuid generated the first time it is run, shouldn't uuid-runtime be part of the Machinekit requirements.

It is, but we have no control over what other people put, or don't put, in their images.

Ryan Press

unread,
Feb 15, 2019, 6:36:57 AM2/15/19
to schoo...@gmail.com, Machinekit Mailing List
On Fri, Feb 15, 2019 at 5:56 AM schoo...@gmail.com <schoo...@gmail.com> wrote:

On 15/02/19 10:02, Ryan Press wrote:
I had the same problem with a fresh Debian Stretch install, just a few days ago.

Ryan

On Thu, Feb 14, 2019, 1:57 PM mugginsac <mugg...@gmail.com wrote:
I just built a fresh uSD from one of Robert Nelson's images. It does not include uuid-runtime.
Since machinekit now has to have a uuid generated the first time it is run, shouldn't uuid-runtime be part of the Machinekit requirements.

It is, but we have no control over what other people put, or don't put, in their images.

I didn't use an image.  I installed Debian from a netinstall ISO, set up the machinekit repo, and installed the machinekit package.  I did not notice the error message when it installed because apt continued on.  Afterward I needed to figure out what packaged I needed to install (uuid-runtime) to fix the errors when running Machinekit.

Ryan

schoo...@gmail.com

unread,
Feb 15, 2019, 7:23:16 AM2/15/19
to Ryan Press, Machinekit Mailing List
OK, found that problem.

The dependency was missed for Stretch because it uses another control file.
Should be built and in the repo by the end of the day.

Thanks for persisting, only with that info was I able to look in the right place.

Bas de Bruijn

unread,
Feb 15, 2019, 7:51:58 AM2/15/19
to Machinekit Mailing List

On 15 Feb 2019, at 13:23, "schoo...@gmail.com" <schoo...@gmail.com> wrote:

OK, found that problem.

The dependency was missed for Stretch because it uses another control file.
Should be built and in the repo by the end of the day.

PR’s have been merged.
So it should be available soon.


Thanks for persisting, only with that info was I able to look in the right place.

On 15/02/19 11:36, Ryan Press wrote:

On Fri, Feb 15, 2019 at 5:56 AM schoo...@gmail.com <schoo...@gmail.com> wrote:

On 15/02/19 10:02, Ryan Press wrote:
I had the same problem with a fresh Debian Stretch install, just a few days ago.

Ryan

On Thu, Feb 14, 2019, 1:57 PM mugginsac <mugg...@gmail.com wrote:
I just built a fresh uSD from one of Robert Nelson's images. It does not include uuid-runtime.
Since machinekit now has to have a uuid generated the first time it is run, shouldn't uuid-runtime be part of the Machinekit requirements.

It is, but we have no control over what other people put, or don't put, in their images.

I didn't use an image.  I installed Debian from a netinstall ISO, set up the machinekit repo, and installed the machinekit package.  I did not notice the error message when it installed because apt continued on.  Afterward I needed to figure out what packaged I needed to install (uuid-runtime) to fix the errors when running Machinekit.

Ryan


Condit Alan

unread,
Feb 17, 2019, 7:57:10 PM2/17/19
to Bas de Bruijn, Machinekit Mailing List
I just did an update for machinekit. It reported an error involving sed. I suspect the error is in the script that is supposed to edit mkuuid and machinekit.ini. See the next to the last line below (separated by ———).

machinekit@beaglebone:~$ sudo apt-get install machinekit
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  machinekit-rt-preempt
The following packages will be upgraded:
  machinekit machinekit-rt-preempt
2 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
Need to get 5,490 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://deb.machinekit.io/debian stretch/main armhf machinekit-rt-preempt armhf 0.1.1550234988.git6b4bdbf-1~stretch [1,044 kB]
Get:2 http://deb.machinekit.io/debian stretch/main armhf machinekit armhf 0.1.1550234988.git6b4bdbf-1~stretch [4,446 kB]
Fetched 5,490 kB in 4s (1,259 kB/s)     
(Reading database ... 51500 files and directories currently installed.)
Preparing to unpack .../machinekit-rt-preempt_0.1.1550234988.git6b4bdbf-1~stretch_armhf.deb ...
Unpacking machinekit-rt-preempt (0.1.1550234988.git6b4bdbf-1~stretch) over (0.1.1548236839.git1dfa004-1~stretch) ...
Preparing to unpack .../machinekit_0.1.1550234988.git6b4bdbf-1~stretch_armhf.deb ...
Unpacking machinekit (0.1.1550234988.git6b4bdbf-1~stretch) over (0.1.1548236839.git1dfa004-1~stretch) ...
Processing triggers for mime-support (3.60) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Processing triggers for shared-mime-info (1.8-1+deb9u1) ...
Processing triggers for rsyslog (8.24.0-1) ...
Setting up machinekit-rt-preempt (0.1.1550234988.git6b4bdbf-1~stretch) ...
Setting up machinekit (0.1.1550234988.git6b4bdbf-1~stretch) ...
Installing new version of config file /etc/linuxcnc/rtapi.ini ...
[ ok ] Restarting udev (via systemctl): udev.service.
Valid MKUUID in mkuuid 
538c1a6c-1b80-44c4-a11d-f85b171aef60 - using that
Value in mkuuid and ini files differ - using mkuuid 
538c1a6c-1b80-44c4-a11d-f85b171aef60
------------------
sed: -e expression #1, char 20: unterminated `s’ command
------------------
Processing triggers for libc-bin (2.24-11+deb9u3) ...


Thanks,
Alan


You received this message because you are subscribed to a topic in the Google Groups "Machinekit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/machinekit/1o2oHcZXkSQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to machinekit+...@googlegroups.com.

schoo...@gmail.com

unread,
Feb 18, 2019, 2:39:34 AM2/18/19
to machi...@googlegroups.com

There is nothing wrong with the sed command, can only assume there is some spurious char in one of the variables causing premature line termination.

Go to /etc/linuxcnc and delete the mkuuid file and try again.

That would have been created the last time you installed and may be corrupt.

schoo...@gmail.com

unread,
Feb 18, 2019, 6:27:49 AM2/18/19
to machi...@googlegroups.com
I have now uninstalled and re-installed several times on a spare Stretch partition, with and without a mkuuid file existing and cannot replicate your problem.

It did remind me however of the arcane dpkg behaviour I noted when originally testing this.

dpkg does not actually check the physical location for configuration files and assumes their existence unless you have removed the package
with `apt purge <package-name>`

So if you remove machinekit, it will leave the /etc/linuxcnc folder as is and assume it contains what it should do at next re-install.

The safest way to update, if you are doing so frequently, is to create a 'clean slate' and do `apt purge machinekit*`

It will not touch the /etc/linuxcnc/mkuuid file if you have one, because that is not part of the install manifest.
However if a particular MKUUID is not important to you, delete that as well.

The next re-install will copy machinekit.ini and rtapi.ini to /etc/linuxcnc and update the MKUUID in machinekit.ini to a unique one
and then create a mkuuid file containing it so that you can update and retain the same MKUUID, if that matters.

The sed line which errored is here in the postinst file
https://github.com/machinekit/machinekit/blob/master/debian/machinekit.postinst#L87

The charactor 20 referred to is right on the divider between the search term and the replacement one, which makes me suspect that
the first var had picked up a spurious char from the grep operation and it was interpreted as a line ending which terminated the sed operation prematurely.

Hopefully if you purge and re-install you should have no further problems.

regards
Reply all
Reply to author
Forward
0 new messages