View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0017661 | CentOS-8 | systemd | public | 2020-08-11 07:45 | 2020-08-11 07:45 |
Reporter | Yenya | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Product Version | 8.2.2004 | ||||
Summary | 0017661: "The unit files have no installation config" even though they do (Also=... line) | ||||
Description | I want to create a unit file for losetup of a block device image (not a filesystem, so cannot use mount -o loop instead), but systemctl enable complains that the unit file has no installation config. This has probably been already fixed upstream, because in Fedora systemd-245.7-1.fc32.x86_64 the same unit file works. | ||||
Steps To Reproduce | # cat <<EOF > /lib/systemd/system/loop0.service [Unit] Description=Setup loop device DefaultDependencies=false Before=local-fs.target After=systemd-udev-settle.service Wants=systemd-udev-settle.service [Service] Type=oneshot ExecStart=/usr/sbin/losetup /dev/loop0 /var/lib/drbd0 TimeoutSec=60 RemainAfterExit=yes [Install] WantedBy=local-fs.target Also=systemd-udev-settle.service EOF # systemctl daemon-reload # systemctl enable loop0.service Expected behaviour: Created symlink /etc/systemd/system/local-fs.target.wants/loop0.service → /usr/lib/systemd/system/loop0.service. Observed behaviour: ===== Created symlink /etc/systemd/system/local-fs.target.wants/loop0.service → /usr/lib/systemd/system/loop0.service. The unit files have no installation config (WantedBy, RequiredBy, Also, Alias settings in the [Install] section, and DefaultInstance for template units). This means they are not meant to be enabled using systemctl. Possible reasons for having this kind of units are: 1) A unit may be statically enabled by being symlinked from another unit's .wants/ or .requires/ directory. 2) A unit's purpose may be to act as a helper for some other unit which has a requirement dependency on it. 3) A unit may be started when needed via activation (socket, path, timer, D-Bus, udev, scripted systemctl call, ...). 4) In case of template units, the unit is meant to be enabled with some instance name specified. ===== | ||||
Additional Information | The "systemctl enable" returns exit code 0 and the symlink is created nevertheless. With the the "Also=..." line in the unit file commented out, systemctl enable works as expected without the error message. | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2020-08-11 07:45 | Yenya | New Issue |