Red Hat Bugzilla – Bug 249310
use of %pretrans cannot possibly work
Last modified: 2007-11-30 17:12:11 EST
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.
The simple thing to do here is to just listen to all the comments about using
the same named files :-)
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
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.
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.
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.
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.
I have removed %pretrans section, and moved hadling with sysklogd config files
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
rsyslog-1.17.2-3.fc8 was built