On 2024-01-17 at 09:02, hw wrote:

> On Wed, 2024-01-17 at 07:26 -0500, Greg Wooledge wrote:
>
>> On Wed, Jan 17, 2024 at 11:19:50AM +0100, hw wrote:

>> > systemctl --user show -p InvocationID at-spi-dbus-bus.service 
>> > InvocationID=4bd113a0ec4c4f1eab6c51da8a43c1af
>> > Invalid unit name "InvocationID=4bd113a0ec4c4f1eab6c51da8a43c1af" escaped 
>> > as "InvocationID\x3d4bd113a0ec4c4f1eab6c51da8a43c1af" (maybe you should 
>> > use systemd-escape?).
>> > InvocationID=b6e84c2dd18b4d9f84436580113abaca
>> > 
>> > InvocationID=
>> 
>> What were you trying to do?  You took my command and mangled it.  You
>> appended the *output* of my command as an *argument* to your command,
>> substituting my 128-bit InvocationID with one of your own.  Why?
> 
> I copied your command and replaced the UUID with one that shows up in
> /run/user/1000/systemd/units/ as a link target since it seems unlikely
> that the same UUIDs you have are being used here..  At least that was
> my intention.
> 
> Maybe your command was supposed to be 'systemctl --user show -p
> InvocationID at-spi-dbus-bus.service'?

Not just "supposed to be" - I'm essentially certain that it *was* that.

What I think happened is that you saw the command, and its output on the
next line, and mistakenly thought that this was a single longer command
that had been line-wrapped.

> That shows only
> 
> 
> InvocationID=b6e84c2dd18b4d9f84436580113abaca
> 
> 
> which doesn't tell me anything.

If I'm not mistaken, it shows the same value as is the target of the
symlink, which tells you that the target of the symlink is the
InvocationID value. (I'd guess that the command is getting it from that
same symlink.)

>> > Neither the user, nor root gets anything from this.  What is it
>> > supposed to show?
>> 
>> You got the InvocationID of the at-spi-dbus-bus.service unit.  You
>> also got an error message because of the mangled argument you passed,
>> and an extra blank InvocationID= line as output from that same mangled
>> argument, because it wasn't a running unit's name.
>> 
>> When I ran *my* command, I was simply demonstrating that the "systemctl"
>> command, when asked for the InvocationID of a unit, gives the same
>> 128-bit number that you can see with ls -l.
>> 
>> That's all.  Nothing more complicated than that.
> 
> How would that be useful?

As a way of looking up the InvocationID of the "service" in question.

>> THE 128-BIT HEX NUMBER IS THE CONTENT.  IT IS THE DATA.  IT IS WHAT YOU
>> SEEM TO BE LOOKING FOR.  THAT'S ALL THERE IS.  THERE IS NO ADDITIONAL
>> PAYLOAD TO BE FOUND.
>> 
>> THE SYMBOLIC LINKS ARE *SUPPOSED* TO BE DANGLING.  THEY ARE NOT MEANT
>> TO BE catTED.
> 
> If that is so, what is the purpose of useless directory entries?

My guess is: so that they can get the data directly in a variable by a
call to stat() or similar, rather than having to read and parse (and
validate against possible malicious replacement) the contents of a file.

I wouldn't consider that to be sufficient benefit to justify abusing the
semantics of symbolic links, but it's long since clear that the
freedesktop.org people don't use the same criteria in assessing these
things as I would, so it's no surprise that they might have done it anyway.

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to