Qvm-sync-appmenus doesn't seem to work from salt

After I’ve installed a bunch of stuff in a template, I’d of course like to see those things show up in the menu. The problem is, no matter what I do qvm-sync-appmenus doesn’t do anything when called from Salt. The output indicates it’s “updating” the items, but it instead needs to “create” them.

If I instead issue qvm-start <template>; qvm-sync-appmenus --force-root <template>; qvm-shutdown --wait <template> on the dom0 command line, it works perfectly. (And so does opening up settings->Applications and refreshing there.) But putting it in a salt file that runs on target dom0? It acts like it’s running but has no actual effect; it will show that it “updated” my new items, but they don’t show up in the settings->applications available list. The command line output from the salt run shows that my items are being “created”

It’s possible that my installation procedure for this software is contributing. Since this is generally stuff I wrote myself, I simply put the executable in the appropriate path, then copy my .desktop file to /usr/share/applications. A “real” installer might do more, some magic thing: I don’t know. If so it’s not anything otherwise critical because once I get the thing to show in the menu, it works, but I’m having to go through a lot of hoop jumping to get that to happen, because Salt isn’t doing it.

Salt file, which I run after all software installs. It does actually run, so there’s no critical syntax error or anything like that.

{% if grains['nodename'] == 'dom0' %}

{% set namestem = 'vera' %}
{% set vmname = grains['app-stem'] + '-' + namestem %}
# the effect of the above two lines is to set the vmname to deb11a-vera

tmpl-{{namestem}}-post-startup:
    cmd.run:
        - name: 'qvm-start --skip-if-running {{vmname}}'
        - order: 1

tmpl-{{namestem}}-update-apps:
    cmd.run:
        - name: qvm-sync-appmenus --force-root {{vmname}}
        - order: 2

tmpl-{{namestem}}-post-shutdown:
    cmd.run:
        - name: 'qvm-shutdown --wait {{vmname}}'
        - order: 3

{% endif %}

I’ve also tried running this state independently from the command line, well after the rest of the qube configuration. No luck with that either. So in desperation I’m about to write a shell script to do this.

@unman, do you perchance have any insight into this?