OpenERP v5.0.0-2: bdist_rpm files missing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Incomplete
|
Undecided
|
Stephane Wirtel (OpenERP) |
Bug Description
The following files and directories are needed to make a complete server RPM:
/etc/logrotate.
/etc/openerp-
/etc/rc.
/var/log/openerp
/var/spool/openerp
UPDATE 2008-02-15: BUG IS NOW SOLVED. PATCHES ARE INCLUDED BELOW IN COMMENTS. - Gerry
Related branches
Gerry Reno (greno-verizon) wrote : | #1 |
Gerry Reno (greno-verizon) wrote : | #2 |
#!/bin/bash
# /etc/rc.
# openerp server
#
# chkconfig: - 95 05
# description: Starts openerp v4.x Server
#
# pidfile: /var/run/
# config: /etc/openerp-
PATH=/usr/
export PATH
# Source function library.
. /etc/rc.
svr="${2:+-$2}"
PIDFILE=
LOCKFILE=
LOGFILE=
OPTS="-
prog="openerp-
# check if the openerp-server conf file is present, then use it
if [ -f /etc/openerp-
OPTS="$OPTS -c /etc/openerp-
fi
# check the existence of the openerp-server script
[ -z "/usr/bin/
RETVAL=0
start() {
echo -n $"Starting $prog: "
daemon --user openerp --check openerp-server "/usr/bin/setsid /usr/bin/
RETVAL=$?
[ $RETVAL -eq 0 ] && touch $LOCKFILE
echo
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
kill -TERM `cat $PIDFILE` > /dev/null 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ] ; then
rm -f $LOCKFILE
echo
else
echo
fi
return $RETVAL
}
restart() {
stop
start
}
condrestart() {
[ -e $LOCKFILE ] && restart || :
}
rhstatus() {
if [ -f $PIDFILE ] ; then
checkpid `cat $PIDFILE`
RETVAL=$?
if [ $RETVAL -eq 0 ] ; then
echo $"$prog is running..."
else
echo $"$prog is stopped"
fi
else
echo $"$prog is stopped"
fi
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
condrestart)
condrestart
;;
status)
rhstatus
;;
probe)
exit 0
;;
*)
echo $"Usage: $0 {start|
echo $"Example: $0 start # default"
echo $"Example: $0 start devel # start named server from /etc/openerp-
exit 1
esac
exit $?
Gerry Reno (greno-verizon) wrote : | #3 |
Stephane,
Just a note about CONFIG files:
In order for config files to not get overwritten during an RPM update, they have to be located in a special macro in the SPEC file:
%config(
If you don't put the config files under this macro then whatever is in the RPM will just replace what is in the filesystem.
Google "RPM %config" for more info.
Regards,
Gerry
Gerry Reno (greno-verizon) wrote : | #4 |
# openerp-server.conf
[options]
without_demo = False
upgrade = False
verbose = False
xmlrpc = True
db_user = oerp
db_password = abcdef
root_path = None
soap = False
translate_modules = ['all']
db_name = template1
netrpc = True
demo = {}
interface =
db_host = False
db_port = False
port = 8069
addons_path = None
reportgz = False
Gerry Reno (greno-verizon) wrote : | #5 |
I have the RPM %config macro working for OpenERP configuration files, so now when a user upgrades their RPM, their config files will not be overwritten. The new config file will be written as CONFIGFILE.rpmnew and the user can then merge their existing config file with the new one.
=======
add the following files to your tree (contents are posted above):
etc/openerp-
etc/rc.
etc/logrotate.
add the following directories to your tree:
var/log/openerp
var/spool/openerp
=======
add the following lines to MANIFEST.in:
recursive-include etc *
recursive-include var *
=======
add the following lines to the end of rpminstall_sh.txt:
CONFIGFILES="\
%config(noreplace) /etc/openerp-
%config(noreplace) /etc/logrotate.
%config(noreplace) /etc/rc.
"
echo "$CONFIGFILES" | cat INSTALLED_FILES - > INSTALLED_FILES.new
mv INSTALLED_FILES.new INSTALLED_FILES
=======
add the following lines to setup.py in data_files() at about line 103:
=======
end
description: | updated |
Gerry Reno (greno-verizon) wrote : | #6 |
Ok, one small change to accommodate debian file locations:
In all above:
Change: /etc/rc.d/init.d/
To: /etc/init.d
RedHat and derivatives make a symlink between these two directories so you can use either but I don't think debian does that so this change is needed so that files are in correct location for debian as well.
Gerry Reno (greno-verizon) wrote : | #7 |
Correction to rpminstall_sh.txt:
Better way:
Instead of adding the previous lines listed above,
just add this one line after the existing 'sed' line:
sed "s!^\(/
Gerry Reno (greno-verizon) wrote : | #8 |
INCORPORATING THE CORRECTIONS, THE FILES SHOULD LOOK LIKE THIS:
=======
add the following files to your tree (contents are posted above):
etc/openerp-
etc/init.
etc/logrotate.
add the following directories to your tree:
var/log/openerp
var/spool/openerp
=======
add the following lines to MANIFEST.in:
recursive-include etc *
recursive-include var *
=======
add the following line after the existing 'sed' line in rpminstall_sh.txt:
sed "s!^\(/
=======
add the following lines to setup.py in data_files() at about line 103:
=======
end
Christophe Simonis (OpenERP) (kangol) wrote : | #9 |
can you provide a patch file ?
Gerry Reno (greno-verizon) wrote : | #10 |
- Patch file: deltas for working with OpenERP config files Edit (10.6 KiB, text/plain)
Here is the patch file. You still need to create the 'etc' and 'var' directory structures and populate with files.
-Gerry
Gerry Reno (greno-verizon) wrote : | #11 |
The patch is against revno 1728.
Gerry Reno (greno-verizon) wrote : | #12 |
Gerry Reno (greno-verizon) wrote : | #13 |
=======
MODIFIED SOLUTION: (needed because 'sdist' still cannot create empty directories after 8 years of bugs on this!!!)
This affected the 'var' empty directories and so what we do now is just check/create them in a %post section in SPEC file.
NEW SET OF FILES AND PATCHES FOLLOW.
=======
=======
add the following files to your tree (contents are posted above):
etc/openerp-
etc/init.
etc/logrotate.
=======
add the following lines to MANIFEST.in:
recursive-include etc *
=======
add the following line after the existing 'sed' line in rpminstall_sh.txt:
sed "s!^\(/
%post
[ ! -e /var/log/openerp ] && mkdir -p /var/log/openerp
[ ! -e /var/spool/openerp ] && mkdir -p /var/spool/openerp
=======
add the following lines to setup.py in data_files() at about line 103:
=======
end
PS. retested and upgraded RPM and everything worked fine.
Gerry Reno (greno-verizon) wrote : | #14 |
Gerry Reno (greno-verizon) wrote : | #15 |
Gerry Reno (greno-verizon) wrote : | #16 |
NEW patch is against revno 1728.
Gerry Reno (greno-verizon) wrote : | #17 |
=======
TWEAKED SOLUTION: (needed because certain file permissions were set generically which caused issues so I had to specifically set them)
PLUS: I added creation of 'openerp' user and group, and added install and run output showing location of important files.
NEW SET OF FILES AND PATCHES (vers 3) FOLLOW.
=======
=======
add the following files to your tree (contents are posted above):
etc/openerp-
etc/init.
etc/logrotate.
=======
add the following lines to MANIFEST.in:
recursive-include etc *
=======
add the following lines after the existing 'sed' line in rpminstall_sh.txt:
sed "s!^\(/
sed "s!^\(/
sed "s!^\(/
%post
echo "Checking 'openerp' user and group ..."
id openerp 2>/dev/null || ((groupadd -r openerp && useradd -r -g openerp openerp -c "OpenERP Server" -d /var/spool/openerp -s /sbin/nologin) && id openerp)
[ ! -e /var/log/openerp ] && mkdir -p /var/log/openerp
[ ! -e /var/spool/openerp ] && mkdir -p /var/spool/openerp
chown openerp:openerp /var/log/openerp /var/spool/openerp
echo "Config file: /etc/openerp-
echo "Log files under: /var/log/openerp"
echo "openerp home: /var/spool/openerp"
echo "If first install: Create a 'oerp' user and database in Postgresql; put database entries in config file."
echo "Control server: /etc/init.
=======
add the following lines to setup.py in data_files() at about line 103:
=======
end
PS. retested and upgraded RPM and everything worked fine.
Gerry Reno (greno-verizon) wrote : | #18 |
Gerry Reno (greno-verizon) wrote : | #19 |
- TWEAKED gzipped-tar of the 'etc' file tree. Edit (1.3 KiB, application/x-tar)
TWEAKED Patch is against revno 1728.
Gerry Reno (greno-verizon) wrote : | #20 |
Where it says above: add the following files to your tree (contents are posted above):
PLEASE TAKE THE CONTENTS FROM THE TWEAKED gzipped-tar ATTACHMENT.
Gerry Reno (greno-verizon) wrote : | #21 |
After you untar the files into your build tree and patch the files:
TO BUILD THE RPM:
In your patched tree:
$ python setup.py sdist
$ cp dist/openerp-
$ cd ~/build/python-dist
$ tar xvf openerp-
$ cd openerp-
$ python setup.py bdist_rpm
...
TO INSTALL THE RPM:
$ su -
# yum localinstall /home/greno/
Loading "fastestmirror" plugin
Loading "installonlyn" plugin
Setting up Local Package Process
Examining /home/greno/
Marking /home/greno/
Loading mirror speeds from cached hostfile
* fedora: download.
* updates: download.
Resolving Dependencies
--> Running transaction check
---> Package openerp-
Dependencies Resolved
=======
Package Arch Version Repository Size
=======
Installing:
openerp-server noarch 5.0.0-3 /home/greno/
Transaction Summary
=======
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 7.6 M
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: openerp-server #######
Checking 'openerp' user and group ...
uid=497(openerp) gid=496(openerp) groups=496(openerp) context=
Config file: /etc/openerp-
Log files under: /var/log/openerp
openerp home: /var/spool/openerp
If first install: Create a 'oerp' user and database in Postgresql; put database entries in config file.
Control server: /etc/init.
Installed: openerp-
Complete!
=======
AND TO START THE SERVER:
# /etc/init.
Starting openerp-server: [ OK ]
Config file: /etc/openerp-
Log file: /var/log/
PID file: /var/spool/
Lock file: /var/lock/
=======
And that's what you should see if everything is working.
Gerry Reno (greno-verizon) wrote : | #22 |
- TWEAKED-2 gzipped-tar of the 'etc' file tree plus bin/openerp-configuredb. Edit (2.4 KiB, application/x-tar)
Where it says above: add the following files to your tree (contents are posted above):
PLEASE TAKE THE CONTENTS FROM THE TWEAKED-2 gzipped-tar ATTACHMENT.
Gerry Reno (greno-verizon) wrote : | #23 |
- TWEAKED-2 Patch file: deltas for working with OpenERP config files Edit (6.4 KiB, text/plain)
TWEAKED-2 Patch is against revno 1759.
Gerry Reno (greno-verizon) wrote : | #24 |
- TWEAKED-3 gzipped-tar of the 'etc' file tree plus bin/openerp-configuredb Edit (2.4 KiB, application/x-tar)
TWEAKED-3 SOLUTION:
Found a small 'release' parse error where we need to use rsplit rather than split alone. So I ran a new diff patch and file set.
Where it says above: add the following files to your tree (contents are posted above):
PLEASE TAKE THE CONTENTS FROM THE TWEAKED-3 gzipped-tar ATTACHMENT.
Gerry Reno (greno-verizon) wrote : | #25 |
- TWEAKED-3 Patch file: deltas for working with OpenERP config files Edit (7.2 KiB, text/plain)
TWEAKED-3 Patch is against revno 1759.
Gerry Reno (greno-verizon) wrote : | #26 |
- TWEAKED-4 gzipped-tar of the 'etc' file tree plus bin/openerp-configuredb Edit (2.4 KiB, application/x-tar)
TWEAKED-4 SOLUTION:
Sorry. Forgot to set the 'release' back to '3' after testing since we don't want to change it.
Where it says above: add the following files to your tree (contents are posted above):
PLEASE TAKE THE CONTENTS FROM THE TWEAKED-4 gzipped-tar ATTACHMENT.
Gerry Reno (greno-verizon) wrote : | #27 |
- TWEAKED-4 Patch file: deltas for working with OpenERP config files Edit (6.6 KiB, text/plain)
TWEAKED-4 Patch is against revno 1759.
Stephane Wirtel (OpenERP) (stephane-openerp) wrote : | #28 |
Ok, I have created a new branch with the trunk version and your patch. Can you test this branch because I have got an error when I try to create the rpm package. In fact the "-ba" option is not recognized by the rpm command.
https:/
Thanks
Changed in openobject-server: | |
assignee: | nobody → stephane-openerp |
status: | New → Incomplete |
Gerry Reno (greno-verizon) wrote : | #29 |
Stephane,
Ok, I got the branch but all the files from TWEAKED-4 are not there, only the patches are there. We also need the files which will create a 'etc' directory structure. Right now there is no 'etc' directory just 'bin', 'doc' and 'man', 'pixmaps', 'win32'.
Regards,
Gerry
Stephane Wirtel (OpenERP) (stephane-openerp) wrote : Re: [Bug 329580] Re: OpenERP v5.0.0-2: bdist_rpm files missing | #30 |
greno wrote:
> Stephane,
> Ok, I got the branch but all the files from TWEAKED-4 are not there, only the patches are there. We also need the files which will create a 'etc' directory structure. Right now there is no 'etc' directory just 'bin', 'doc' and 'man', 'pixmaps', 'win32'.
>
> Regards,
> Gerry
>
I have applied your tar ball in this branch, can you check that ?
Sorry for the delay
Regards,
Stephane
--
Stephane Wirtel - "As OpenERP is OpenSource, please feel free to contribute."
Developper - Technical Lecturer OpenERP
OpenERP - Tiny SPRL
Chaussee de Namur, 40
B-1367 Gerompont
Tel: +32.81.81.37.00
Web: http://
Web: http://
Planet: http://
Blog: http://
Gerry Reno (greno-verizon) wrote : | #31 |
Stephane,
I pulled the server branch and the files are now there. I was able to run 'setrelease', then 'sdist', copy tarball to work area, run 'bdist_rpm' but the RPM build is still reporting "Installed but unpackaged files". I used my workaround for the /usr/lib/
Regards,
Gerry
Stephane Wirtel (OpenERP) (stephane-openerp) wrote : | #32 |
greno wrote:
> Stephane,
> I pulled the server branch and the files are now there. I was able to run 'setrelease', then 'sdist', copy tarball to work area, run 'bdist_rpm' but the RPM build is still reporting "Installed but unpackaged files". I used my workaround for the /usr/lib/
>
> Regards,
> Gerry
>
Gerry,
I don't have the time to solve this bug, can you provide a small patch and I
will apply to this branch ?
Regards,
Stephane
--
Stephane Wirtel - "As OpenERP is OpenSource, please feel free to contribute."
Developper - Technical Lecturer OpenERP
OpenERP - Tiny SPRL
Chaussee de Namur, 40
B-1367 Gerompont
Tel: +32.81.81.37.00
Web: http://
Web: http://
Planet: http://
Blog: http://
Gerry Reno (greno-verizon) wrote : | #33 |
Stephane,
The "Installed but unpackaged files" error was introduced again recently after another server bug was fixed.
After the server is fully working without error, we need to do the following for the client:
add 'setrelease' class and it's install cmd in 'setup()'
Regards,
Gerry
Gerry Reno (greno-verizon) wrote : | #34 |
- INSTALLED_FILES for Installed but unpackaged files error Edit (28.5 KiB, text/plain)
Stephane,
Here was the change introduced in revno 1685 that caused the "Installed but unpackaged files" error to occur for all .pyc/.pyo files under:
/usr/lib/
- innerfiles = filter(lambda file: os.path.
+ innerfiles = filter(lambda file: os.path.
I have forgotten what this 1685 fixed but I know that people were complaining about files missing in the forum so I don't think this fix should be rolled back. Do you remember what problem 1685 actually fixed? Is there another way to fix that problem without changing the innerfiles?
What has happened is this fix has changed the files[] list and that is the cause of the IBUF error. I've attached the generated INSTALLED_FILES file. In it you can see at the end that all the 'addons/base' files are listed and the .py files have no corresponding .pyc/.pyo as the other .py files do. So that is why the error occurs. I don't see how to fix this because I'm not familiar with the innerfiles logic in setup.py.
Regards,
Gerry
Gerry Reno (greno-verizon) wrote : | #35 |
Stephane,
In watching the rpm generation process I can see where all the byte-compiling is occurring and then AFTER that the openerp-
Regards,
Gerry
Gerry Reno (greno-verizon) wrote : | #36 |
- PATCH fixing the "Installed but unpackaged files" error introduced by bugfix 1685 Edit (1.8 KiB, text/plain)
Stephane,
I had a little time today so I investigated further the 'Installed by unpackaged files' problem introduced by bugfix 1685 and I found a solution. Patch is attached.
Everything is working now. Please test on your Fedora as well.
Regards,
Gerry
Gerry Reno (greno-verizon) wrote : | #37 |
Stephane,
After you apply the latest patch, please build on your Fedora as well. I see you were having a problem with building the RPM with no -ba option. This means that you do not have 'rpmbuild' installed. You cannot build an RPM with rpm. You have to use rpmbuild and setup.py will use rpmbuild if it is present.
You need to install the following on your Fedora:
yum groupinstall "Development Tools"
Also, we need to do something on the client as well: add 'setrelease' class and it's install cmd in 'setup()'.
Regards,
Gerry
Todd Johnson (todd-toddejohnson) wrote : | #38 |
It works great with openerp-
pheller (pheller) wrote : | #39 |
Any status on this? Likely to see it merged into the trunk anytime soon?
Changed in openobject-server: | |
milestone: | none → 5.0.10 |
Changed in openobject-server: | |
milestone: | 5.0.10 → 5.0.11 |
# /etc/logrotate. d/openerp- server openerp/ *.log {
/var/log/
copytruncate
missingok
notifempty
}