Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boot script terminates and gives error (no error logger present)

Tags:

erlang

I made an Erlang application, that shall be started on booting of the operating system. The boot script is stored in /etc/init.d. It looks like this:

#!/bin/sh
cd $ROOT/lib/di
INET_ADDR=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
NODE_NAME=$(echo di@$INET_ADDR)
erl -pa $PWD/ebin -pa $PWD/deps/*/ebin -name $NODE_NAME -boot di $1 -setcookie agfeo

The script tries to determine the IP address of the machine, in order to give the node an unique name. When the machine boots, the script gets executed automatically. On the terminal I get the following output:

(no error logger present) error: "Error in process <0.1.0> with exit value:
{badarg,[{erlang,list_to_atom,[[<<2 bytes>>,<<5 bytes>>,46,98,111,111,116]]},
{init,get_boot,2},{init,do_boot,3}]}"
{"init terminating in do_boot",{badarg,[{erlang,list_to_atom,[[<<2 bytes>>,<<5 bytes>>,46,98,111,111,116]]},
{init,get_boot,2},{init,do_boot,3}]}}
init terminating in do_boot ()

This is what the shell prints out, when the script is loaded automatically. When I call the script manually, my application gets started normally, without any problems.

Could anybody please explain, what the error message above means?

like image 271
rweinbrecher Avatar asked Mar 21 '26 19:03

rweinbrecher


1 Answers

If we look at the stack trace the last function executed is init:get_boot/2 and the last instruction is erlang:list_to_atom([<<2 bytes>>, <<5 bytes>>, ".boot"]). In the init:get_boot/2 there are three lines with list_to_atom, so error should be one of the following:

  • 'cannot get bootfile';
  • 'bootfile format error';

I believe the error is 'cannot get bootfile'.

like image 78
hdima Avatar answered Mar 24 '26 16:03

hdima



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!