Bug 878093

Summary: Extraneous rpm script warning when /etc/sysconfig/network doesn't exist.
Product: [Fedora] Fedora Reporter: Matthew Miller <mattdm>
Component: systemdAssignee: systemd-maint
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: rawhideCC: johannbg, lnykryn, metherid, msekleta, notting, plautrba, systemd-maint, vpavlin
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-11-23 07:39:01 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:
Attachments:
Description Flags
trivial patch to specfile none

Description Matthew Miller 2012-11-19 16:22:18 UTC
Created attachment 647860 [details]
trivial patch to specfile

Description of problem:


This is very minor, but there's a sed call in the preinstall scriptlet which fails harmlessly but with an error if  /etc/sysconfig/network doesn't exist.

The impact is simply an extraneous but harmless error message in the rpm output.

I think this should be moved into the "if" block immediately before.



Version-Release number of selected component (if applicable):

systemd-195-7


--- a/systemd.spec
+++ b/systemd.spec
@@ -452,8 +452,8 @@ if [ -e /etc/sysconfig/network -a ! -e /etc/hostname ]; then
         unset HOSTNAME
         . /etc/sysconfig/network 2>&1 || :
         [ -n "$HOSTNAME" ] && echo $HOSTNAME > /etc/hostname 2>&1 || :
+        /usr/bin/sed -i '/^HOSTNAME=/d' /etc/sysconfig/network 2>&1 || :
 fi
-/usr/bin/sed -i '/^HOSTNAME=/d' /etc/sysconfig/network 2>&1 || :
 
 %posttrans
 # Convert old /etc/sysconfig/desktop settings

Comment 1 Fedora Update System 2012-11-20 19:14:36 UTC
systemd-195-8.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/systemd-195-8.fc18

Comment 2 Matthew Miller 2012-11-20 19:55:15 UTC
it occurs to me that my recommendation might actually _not_ match the intention. It looks like it's actually meant to always delete a HOSTNAME line from /etc/sysconfig/network, even if /etc/hostname exists. To make that work, instead of moving it, it should have its own test.

But, I'm not sure if "mysteriously disappearing config file lines" or "I put hostname there and it's not working" is more confusing. It might be best to just leave the file alone when /etc/hostname does exist.

Comment 3 Fedora Update System 2012-11-21 20:53:28 UTC
Package systemd-195-9.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing systemd-195-9.fc18'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-18708/systemd-195-9.fc18
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2012-11-23 07:39:03 UTC
systemd-195-8.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.