Bug 2020374

Summary: %systemd_user_postun_with_restart scriptlet helper "mark-restart-user-units" broken
Product: [Fedora] Fedora Reporter: Fabio Valentini <decathorpe>
Component: systemdAssignee: systemd-maint
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 35CC: fedoraproject, filbranden, flepied, lnykryn, maxwell, msekleta, ryncsn, ssahani, s, systemd-maint, yuwatana, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-05 08:19:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Fabio Valentini 2021-11-04 17:07:04 UTC
Description of problem:

When upgrading the syncthing package (where user services should be restarted after package updates, hence the use of %systemd_user_postun_with_restart), there's a scriptlet error that originates here:

/usr/lib/systemd/systemd-update-helper at line 54

Version-Release number of selected component (if applicable):
systemd-249.4-2.fc35.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. install syncthing (e.g. v1.18.3 from fedora 35 stable repo)
2. enable and start syncthing user session service for some user
2. upgrade syncthing (e.g. to v1.18.4 from fedora 35 koji / updates-testing)
3. observe scriptlet error and not-restarted user units that should have been restarted

Actual results:
User units don't get restarted after the package upgrade.

Expected results:
User units get successfully restarted after package upgrade.

Additional info:

dnf output snippet:

Running transaction
  Preparing        :
  Upgrading        : syncthing-1.18.4-1.fc35.x86_64
  Running scriptlet: syncthing-1.18.4-1.fc35.x86_64
  Running scriptlet: syncthing-1.18.3-1.fc35.x86_64
  Cleanup          : syncthing-1.18.3-1.fc35.x86_64
  Running scriptlet: syncthing-1.18.3-1.fc35.x86_64
/usr/lib/systemd/systemd-update-helper: line 54: unit: unbound variable

  Verifying        : syncthing-1.18.4-1.fc35.x86_64
  Verifying        : syncthing-1.18.3-1.fc35.x86_64

Upgraded:
  syncthing-1.18.4-1.fc35.x86_64

Comment 1 Zbigniew Jędrzejewski-Szmek 2021-11-05 08:19:46 UTC
Yeah, sorry about that.

*** This bug has been marked as a duplicate of bug 2020415 ***