[erlang-questions] Issues attaching to an Erlang process after hot code load

Technion technion@REDACTED
Mon Jul 6 01:11:50 CEST 2015


Hi,


I have found recently found out that Erlang questions in Stackoverflow earn a person a tumbleweed award [��]


Throughout development, I have in general had no issues starting a release, and running "attach". I have however found after performing a hot code load, this functionality appears to break.

I fully documented (https://github.com/technion/erlvulnscan) in the "Hot code upgrade" heading the process I used. This process appears to have worked correctly, however, I then lose the ability to attach, and more importantly, send "stop" commands when I later wish to perform maintenance on this process.


Using the old release directory:

$ ./erlvulnscan-1.02/bin/erlvulnscan attach
escript: Failed to open
file: /home/technion/erlvulnscan/rel/erlvulnscan-1.02/erts-6.4/bin/nodetool
Node is not running!

In the new one:

$ ./erlvulnscan-1.03/bin/erlvulnscan attach
pong
Can't access pipe
directory /tmp//home/technion/erlvulnscan/rel/erlvulnscan-1.03/:
No such file or directory

I did ultimately find I could connect using this command:

$ ./erlvulnscan-1.03/erts-6.4/bin/to_erl
/tmp/home/technion/erlvulnscan/rel/erlvulnscan-1.02/erlang.pipe.2

However this feels like an absurd workaround - like something is obviously broken to get into this state.

I can kill the process (using the kill command) after which it can be started and stopped without issue, suggesting something was done wrong, or got broken, during the code load process.


I'm not sure if it's an Erlangism I should get used to, but the location of these pipes in general feels very unusual. I don't see why an entire directory structure would be recreated under /tmp, I'd expect to either sit under the release' own directory, or one directory deep in /tmp. The fact it's a deterministic file and directory name could lead to security issues.




Any assistance appreciated (any comments on code or general design also appreciated, this is my first Erlang project).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150705/39826a06/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OutlookEmoji-??.png
Type: image/png
Size: 488 bytes
Desc: OutlookEmoji-??.png
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150705/39826a06/attachment.png>


More information about the erlang-questions mailing list