Bug 249310

Summary: use of %pretrans cannot possibly work
Product: [Fedora] Fedora Reporter: Jeremy Katz <katzj>
Component: rsyslogAssignee: Peter Vrabec <pvrabec>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: sgrubb
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-07-25 14:30:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 235703    

Description Jeremy Katz 2007-07-23 17:32:14 UTC
When doing a new install, the use of bash for %pretrans cannot in any way
possibly work.  It'll get run before bash is installed.

Comment 1 Jeremy Katz 2007-07-23 17:33:07 UTC
The simple thing to do here is to just listen to all the comments about using
the same named files :-)

Comment 2 Peter Vrabec 2007-07-24 10:09:39 UTC
Is there any way how can we skip this section during new install?

I see there is also problem with %post section, isn't it?
# mv /bin/bash /bin/bash.backup
# rpm -U --force rsyslog-1.17.0-2.fc8.x86_64.rpm
error: %unknownscript(rsyslog-1.17.0-2.fc8.x86_64) scriptlet failed, exit 
status 255
error: %post(rsyslog-1.17.0-2.fc8.x86_64) scriptlet failed, exit status 255
# echo $?
1

I really don't like the idea of renaming rsyslog files to sysklogd files.


Comment 3 Steve Grubb 2007-07-24 13:19:25 UTC
Why can't it use either rsyslogd.conf or syslogd.conf? The daemon has a "-f"
option that the file name can be passed on. The init script can figure out which
file to use and we can skip all the extra work in the spec file.

Comment 4 Peter Vrabec 2007-07-24 13:42:29 UTC
so the scenario will be:
init script use syslog.conf.rpmsave or sysconfig/syslog.rpmsave if they 
exists, otherwise it use rsyslog.conf and sysconfig/rsyslog
right?

And init scipt can print warning that the old config files are being used.






Comment 5 Steve Grubb 2007-07-24 14:15:22 UTC
well, I'd go so far as to rename the save files so they don't get cleaned up as
orphaned files. %ghost can be used to indicate that the package will own the
syslog.conf file. I'd suggest something like:

1) if neither syslog.conf or syslog.conf.rpmsave exist, "-f" option is not
needed so it uses rsyslog.conf.
2) if syslog.conf doesn't exist and syslog.conf.rpmsave exists, rename it to
syslog.conf. In either case, use syslog.conf via "-f" option..

The daemon can simply log which config file its using if the "-f" option is
used, no need to write anything to the screen.

I also wonder if we can compare the config files and suggest deleting the
syslog.conf files if they match rsyslog's or were the default syslog.conf files.

Comment 6 Peter Vrabec 2007-07-24 16:19:13 UTC
I have removed %pretrans section, and moved hadling with sysklogd config files 
to %post. 
...
if [ -f /etc/syslog.conf ]; then
        mv -f /etc/rsyslog.conf /etc/rsyslog.conf.rpmnew
        mv -f /etc/syslog.conf  /etc/rsyslog.conf
fi
if [ -f /etc/sysconfig/syslog ]; then
        mv -f /etc/sysconfig/rsyslog /etc/sysconfig/rsyslog.rpmnew
        mv -f /etc/sysconfig/syslog  /etc/sysconfig/rsyslog
fi
...
Can we give one more chance to this solution. Before we start dealing with two 
config files for one daemon.

Change is in cvs(rsyslog-1.17.2-3.fc8), but I can build it, something with 
koji.


Comment 7 Peter Vrabec 2007-07-25 14:30:04 UTC
rsyslog-1.17.2-3.fc8 was built