[erlang-questions] use only parts of a release

Pablo Platt pablo.platt@REDACTED
Sun Apr 24 15:06:47 CEST 2011


I guess I was complicating things just because something didn't work when I started.
At first I tried to copy the whole release to /usr/lib/myserver with the following line in the debian/install script:
../../myserver/rel/myserver/lib/ /usr/lib/myserver/lib

but when creating the deb package with debuildI got errors related to crypto and ssl.
Is it possible to fix the errors?

Please note that the dev and production machine will be identical.


The second question (which might deserve a separate thread) is about upgrade vs a new release.
When you install a deb package, it is smart enough to handle a fresh install or to upgrade a previous version.
Erlang release seem to distinguish between the two scenarios so you can't just have a single deb that handle both cases.

Someone suggested that the first release will be an upgrade of a bare runtime which might be an option:
http://engineering.yakaz.com/erlang-packaging-on-debian-and-live-upgrade.html

The debuild errors:

objdump: debian/myserver/usr/lib/myserver/lib/lib/crypto-2.0.2/priv/obj/crypto.o: not a dynamic object
objdump: debian/myserver/usr/lib/myserver/lib/lib/crypto-2.0.2/priv/obj/crypto.o: Invalid operation
dpkg-shlibdeps: warning: Couldn't parse dynamic symbol definition: no symbols
dpkg-shlibdeps: warning: dependency on libdl.so.2 could be avoided if "debian/myserver/usr/lib/myserver/lib/lib/runtime_tools-1.8.4.1/priv/lib/trace_file_drv.so debian/myserver/usr/lib/myserver/lib/lib/runtime_tools-1.8.4.1/priv/lib/trace_ip_drv.so debian/myserver/usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock" were not uselessly linked against it (they use none of its symbols).
dpkg-shlibdeps: warning: dependency on libm.so.6 could be avoided if "debian/myserver/usr/lib/myserver/lib/lib/runtime_tools-1.8.4.1/priv/lib/trace_file_drv.so debian/myserver/usr/lib/myserver/lib/lib/runtime_tools-1.8.4.1/priv/lib/trace_ip_drv.so debian/myserver/usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock" were not uselessly linked against it (they use none of its symbols).
dpkg-shlibdeps: warning: dependency on libutil.so.1 could be avoided if "debian/myserver/usr/lib/myserver/lib/lib/runtime_tools-1.8.4.1/priv/lib/trace_file_drv.so debian/myserver/usr/lib/myserver/lib/lib/runtime_tools-1.8.4.1/priv/lib/trace_ip_drv.so debian/myserver/usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock" were not uselessly linked against it (they use none of its symbols).
...

E: myserver: possible-gpl-code-linked-with-openssl
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /usr/ssl/lib
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /usr/local/lib
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /usr/local/openssl/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /usr/lib/ssl/lib
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /usr/openssl/lib
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /usr/pkg/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /usr/local/ssl/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /usr/local/openssl/lib
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /usr/local/ssl/lib
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /usr/sfw/lib
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /usr/lib
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /opt/local/lib
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /usr/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /usr/lib/ssl/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /usr/lib/openssl/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /usr/local/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /usr/openssl/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /opt/local/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /usr/pkg/lib
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /usr/sfw/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /usr/ssl/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/crypto-2.0.2/priv/lib/crypto.so /usr/lib/openssl/lib
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /usr/ssl/lib
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /usr/local/lib
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /usr/local/openssl/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /usr/lib/ssl/lib
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /usr/openssl/lib
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /usr/pkg/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /usr/local/ssl/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /usr/local/openssl/lib
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /usr/local/ssl/lib
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /usr/sfw/lib
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /usr/lib
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /opt/local/lib
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /usr/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /usr/lib/ssl/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /usr/lib/openssl/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /usr/local/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /usr/openssl/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /opt/local/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /usr/pkg/lib
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /usr/sfw/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /usr/ssl/lib64
E: myserver: binary-or-shlib-defines-rpath ./usr/lib/myserver/lib/lib/ssl-4.1.1/priv/bin/ssl_esock /usr/lib/openssl/lib



________________________________
From: Per Melin <per.melin@REDACTED>
To: Ulf Wiger <ulf.wiger@REDACTED>
Cc: Pablo Platt <pablo.platt@REDACTED>; erlang-questions <erlang-questions@REDACTED>
Sent: Sunday, April 24, 2011 3:39 PM
Subject: Re: [erlang-questions] use only parts of a release

On Sat, Apr 23, 2011 at 9:27 PM, Ulf Wiger
<ulf.wiger@REDACTED> wrote:
> I will admit that I haven't been following this thread - apologies. Also, I
> have yet to update my old knowledge of how to do this to understand how it's
> done using reltool et al.
> You can use a releases/ directory outside the OTP root.

Thanks. I was confused about the role of the -root flag.

It is used in three places that I can find:
- init uses it to locate stuff and to replace the default variable
$ROOT in the boot script.
- code_server uses it (in interactive mode only) as one of the
starting points to search for modules.
- release_handler uses it as the top directory of the installed release.

> When you build the boot script, use the {variables, Vars} option, and when
> starting, define the variables using the -boot_var command-line option.
> http://www.erlang.org/doc/man/systools.html#make_script-2
> E.g. {variables, [{"MYROOT", PathToMyRoot}, {"OTP_ROOT", ERL_TOP}]}
> init:get_argument(root) should point to the place where you have your .rel
> and .boot files etc. This can be entirely separate from where you keep your
> lib/ roots.

Pablo is using rebar. He would need to drop down a few levels to use
systools instead.

I can't find any support for boot variables in the doc for reltool. It
does look to me like reltool_target:gen_script/4 do support them, but
that is an internal function and is always called with a hardcoded
empty list of variables.

I guess one could let rebar generate the release and then use
systools:make_script/2 to rebuild the boot script with variables.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110424/56bd3e31/attachment.htm>


More information about the erlang-questions mailing list