Bug 1373950 - systemctl preset prints extraneous message
Summary: systemctl preset prints extraneous message
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.3
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: systemd-maint
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-07 13:51 UTC by Michal Sekletar
Modified: 2016-11-04 00:56 UTC (History)
4 users (show)

Fixed In Version: systemd-219-30.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-04 00:56:45 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2216 0 normal SHIPPED_LIVE systemd bug fix and enhancement update 2016-11-03 13:24:51 UTC

Description Michal Sekletar 2016-09-07 13:51:51 UTC
Description of problem:
If systemctl preset is called on unit file that is disabled and its default preset state state is also disabled, then systemd will not alter current unit file state, but systemctl prints following 

The unit files have no [Install] section. 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, ...).

Version-Release number of selected component (if applicable):
systemd-219-27.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. yum install rsync (should provide /usr/lib/systemd/system/rsyncd.service)

2. systemctl daemon-reload

3. systemctl show -p UnitFileState,UnitFilePreset rsyncd.service

UnitFileState=disabled
UnitFilePreset=disabled

4. systemctl preset rsyncd.service

Actual results:
systemctl prints,

The unit files have no [Install] section. 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, ...).


Expected results:
No action is taken by systemd and systemctl prints no message and returns with exit code 0.

Additional info:
This is already fixed upstream,

https://github.com/systemd/systemd/commit/39207373dd638e548019ddb49929f15795b8b404

Comment 4 Frantisek Sumsal 2016-09-21 11:07:07 UTC
Verified with systemd-219-30.el7.

Old package:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: systemctl preset without [Install] section
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [  BEGIN   ] :: Running 'systemctl daemon-reload'
:: [   PASS   ] :: Command 'systemctl daemon-reload' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'systemctl preset rsyncd.service'
The unit files have no [Install] section. 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, ...).
:: [   PASS   ] :: Command 'systemctl preset rsyncd.service' (Expected 0, got 0)
:: [  BEGIN   ] :: Running '[[ -r /var/tmp/tmp.MFt51eAMlo && ! -s /var/tmp/tmp.MFt51eAMlo ]]'
:: [   FAIL   ] :: Command '[[ -r /var/tmp/tmp.MFt51eAMlo && ! -s /var/tmp/tmp.MFt51eAMlo ]]' (Expected 0, got 1)

New package:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: systemctl preset without [Install] section
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [  BEGIN   ] :: Running 'systemctl daemon-reload'
:: [   PASS   ] :: Command 'systemctl daemon-reload' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'systemctl preset rsyncd.service'
:: [   PASS   ] :: Command 'systemctl preset rsyncd.service' (Expected 0, got 0)
:: [  BEGIN   ] :: Running '[[ -r /var/tmp/tmp.jizxInWtIb && ! -s /var/tmp/tmp.jizxInWtIb ]]'
:: [   PASS   ] :: Command '[[ -r /var/tmp/tmp.jizxInWtIb && ! -s /var/tmp/tmp.jizxInWtIb ]]' (Expected 0, got 0)

Comment 6 errata-xmlrpc 2016-11-04 00:56:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2216.html


Note You need to log in before you can comment on or make changes to this bug.