Bug 878093 - Extraneous rpm script warning when /etc/sysconfig/network doesn't exist.
Summary: Extraneous rpm script warning when /etc/sysconfig/network doesn't exist.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-19 16:22 UTC by Matthew Miller
Modified: 2012-11-23 07:39 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-11-23 07:39:01 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
trivial patch to specfile (535 bytes, patch)
2012-11-19 16:22 UTC, Matthew Miller
no flags Details | Diff

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.


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