HOME is not set when running post-installation script on Ubuntu

168 views
Skip to first unread message

Rajul Vora

unread,
Nov 18, 2012, 2:36:17 PM11/18/12
to puppet...@googlegroups.com

Trying to install mcollective with RabbitMQ. The following package install produces the errors listed below in Bold.

I know exec resource unsets HOME and USER now starting with 3.0 and the workaround for that is to set "environment => 'HOME=/root'" for the exec resource.

It looks like it is the same situation when running post-installation script during package install. And there doesn't seem to be any workaround for that since one can not pass environment  parameter to package install.

Any ideas how to solve this?

  package { 'rabbitmq-server':
    ensure => installed
  }

  package { 'rabbitmq-stomp':
    ensure => installed,
    require => Package['rabbitmq-server']
  }



Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install rabbitmq-stomp' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  rabbitmq-erlang-client
The following NEW packages will be installed:
  rabbitmq-erlang-client rabbitmq-stomp
0 upgraded, 2 newly installed, 0 to remove and 9 not upgraded.
Need to get 21.1 kB of archives.
After this operation, 125 kB of additional disk space will be used.
Get:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/universe rabbitmq-erlang-client all 2.7.1-0ubuntu4 [10.4 kB]
Get:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/universe rabbitmq-stomp all 2.7.1-0ubuntu4 [10.6 kB]
Fetched 21.1 kB in 0s (130 kB/s)
Selecting previously unselected package rabbitmq-erlang-client.
(Reading database ... 36928 files and directories currently installed.)
Unpacking rabbitmq-erlang-client (from .../rabbitmq-erlang-client_2.7.1-0ubuntu4_all.deb) ...
Selecting previously unselected package rabbitmq-stomp.
Unpacking rabbitmq-stomp (from .../rabbitmq-stomp_2.7.1-0ubuntu4_all.deb) ...
Setting up rabbitmq-erlang-client (2.7.1-0ubuntu4) ...
erlexec: HOME must be set
dpkg: error processing rabbitmq-erlang-client (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of rabbitmq-stomp:
 rabbitmq-stomp depends on rabbitmq-erlang-client (= 2.7.1-0ubuntu4); however:
  Package rabbitmq-erlang-client is not configured yet.

jcbollinger

unread,
Nov 19, 2012, 9:50:25 AM11/19/12
to puppet...@googlegroups.com


On Sunday, November 18, 2012 1:36:18 PM UTC-6, Rajul Vora wrote:

Trying to install mcollective with RabbitMQ. The following package install produces the errors listed below in Bold.

I know exec resource unsets HOME and USER now starting with 3.0 and the workaround for that is to set "environment => 'HOME=/root'" for the exec resource.

It looks like it is the same situation when running post-installation script during package install. And there doesn't seem to be any workaround for that since one can not pass environment  parameter to package install.

Any ideas how to solve this?


Report the problem to the package provider; it is his.  No package should be sensitive to the environment in which the package manager runs.  If it is, that defeats a key objective of using packages in the first place: reliable, consistent installs.  Indeed, that's exactly what has happened to you.

In the meantime, your best alternative is to build a local, bugfixed version of the package, and to load it from your own local repository in preference to the buggy one.


John

Reply all
Reply to author
Forward
0 new messages