Bug 249310 - use of %pretrans cannot possibly work
use of %pretrans cannot possibly work
Product: Fedora
Classification: Fedora
Component: rsyslog (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Peter Vrabec
Fedora Extras Quality Assurance
Depends On:
Blocks: F8Blocker
  Show dependency treegraph
Reported: 2007-07-23 13:32 EDT by Jeremy Katz
Modified: 2007-11-30 17:12 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-07-25 10:30:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jeremy Katz 2007-07-23 13:32:14 EDT
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 13:33:07 EDT
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 06:09:39 EDT
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 $?

I really don't like the idea of renaming rsyslog files to sysklogd files.
Comment 3 Steve Grubb 2007-07-24 09:19:25 EDT
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 09:42:29 EDT
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

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

Comment 5 Steve Grubb 2007-07-24 10:15:22 EDT
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 12:19:13 EDT
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
if [ -f /etc/sysconfig/syslog ]; then
        mv -f /etc/sysconfig/rsyslog /etc/sysconfig/rsyslog.rpmnew
        mv -f /etc/sysconfig/syslog  /etc/sysconfig/rsyslog
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 
Comment 7 Peter Vrabec 2007-07-25 10:30:04 EDT
rsyslog-1.17.2-3.fc8 was built

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