FS#49441 - [systemd] PLEASE ENTER SUMMARY

Attached to Project: Arch Linux
Opened by Andrei Pozolotin (random-archer) - Monday, 23 May 2016, 02:06 GMT
Last edited by Dave Reisner (falconindy) - Monday, 23 May 2016, 05:05 GMT
Task Type Bug Report
Category Packages: Testing
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

unit resolution problem in function add_systemd_unit() {}
https://git.archlinux.org/svntogit/packages.git/tree/trunk/initcpio-install-systemd?h=packages/systemd#n55

unit=$(PATH=/usr/lib/systemd/system:/lib/systemd/system type -P "$1")
if [[ -z $unit ]]; then
# complain about not found unit file
return 1
fi

there are 2 issues here:
1) PATH must include /etc/systemd/system, see https://www.freedesktop.org/software/systemd/man/systemd.unit.html
2) (type -P "$1") does not work reliably with absolute paths, must use unit name (file name) instead


here is possible correction:

unit=$(basename $1)
unit=$(PATH=/etc/systemd/system:/usr/lib/systemd/system:/lib/systemd/system type -P "$unit")
if [[ -z $unit ]]; then
# complain about not found unit file
return 1
fi


Additional info:
* package versions: 229, 230
This task depends upon

Closed by  Dave Reisner (falconindy)
Monday, 23 May 2016, 05:05 GMT
Reason for closing:  Duplicate
Additional comments about closing:   FS#42396 

Loading...