.deb package installation issues

Started by steak, December 17, 2010, 12:10:59 PM

Previous topic - Next topic

steak

Hello all,

I would like to try this monitoring system, but so far I am encountering some issues during installation with .deb packages.

I tried installing them on my Ubuntu 8.04 server, in this order:

netxms-base_1.0.8_i386.deb
netxms-agent_1.0.8_i386.deb
netxms-server_1.0.8_i386.deb
netxms-server-mysql_1.0.8_i386.deb

the base package installation went fine, but as soon as I started installing the agent I ran into this issue:

root@pxmonitor:/root/netxms# dpkg -i netxms-agent_1.0.8_i386.deb
Selecting previously deselected package netxms-agent.
(Reading database ... 47061 files and directories currently installed.)
Unpacking netxms-agent (from netxms-agent_1.0.8_i386.deb) ...
Setting up netxms-agent (1.0.8) ...
Cannot open file /etc/nxagentd.conf

though, the package gets installed properly, as I can find the binary file under /usr/bin/nxagentd and the relative /etc/init.d/nxagentd startup script.

Tried to subsequently install the server and the mysql package, both of them get installed properly but the configuration file is still missing.

The last tentative I made was to get the nxagentd.conf-dist from the source tarball and manually copy it to /etc/nxagentd.conf, then tried to reinstall the agent,
but the error message is still there AND the configuration file disappeared.

I suppose there are some issues in the .deb package post installation scripts, I will open them up now and see if I can find the cause.

regards,
stk.

steak

I ran lintian on the agent package just to see the errors that would possibly come up...
Discarding all the debian "policy" messages, there are IMHO a couple which are worth noting:


E: netxms-agent: file-in-etc-not-marked-as-conffile /etc/init.d/nxagentd
W: netxms-agent: script-in-etc-init.d-not-registered-via-update-rc.d /etc/init.d/nxagentd



steak

Ok, at the end I understood what is that missing file error.... The file is indeed not part of the package, but the error is coming up because the postinst script is actually trying to start the nxagentd as soon as it is installed.
This of course happens for all the .deb packages like the agent, the server and (in my case) the MySql extension.

When I manually copied the file from the source tarball, I think I might have removed and reinstalled the agent (the postrm in fact deletes the configuration file from /etc), so this is possibly the reason why it could not find it.

Now that it is installed, I will try to do the manual copy again and see if it starts properly.

My 2 cents: wouldn't be better to put a "dist" config file with the .deb package? if not, what about a message telling the user that he has to remember to supply a configuration file?

Stk.

Victor Kirhenshtein

Hi!

It's my first try to create .deb files. I plan to add interactive configurator later which will be started if configuration files are absent. I agree that for now at least a warning message is necessary. Will fix it for 1.0.9 release.

Best regards,
Victor

steak

Hi Victor,

thank you for your reply. I work with .deb files quite often, so if you might have some questions please feel free to ask :)

One tool you should definitely use is "lintian", which is the debian .deb packages policy checker - maybe you don't need/want to be completely compliant to the Debian policies, but it is a valuable tool to
check out for omissions or errors.

You just execute it with the .deb package as a parameter and it will report you errors and warnings.

stk

Victor Kirhenshtein

Hi!

Question about debian packages to experts: currently, my postrm script looks like following:


#!/bin/sh

if test "x$1" = "xpurge"; then
        rm -f /etc/nxagentd.conf
        rm -f /etc/nxagentd.conf.backup
        rm -f /etc/nxagentd.conf.sample
fi


It supposed to remove configuration files only when package uninstalled completely. However, during upgrade configuration files also got removed. What I am doing wrong?

Best regards,
Victor