Re: [Zotonic-Usr] Cannot add site

747 views
Skip to first unread message

Arjan Scherpenisse

unread,
Sep 23, 2012, 2:21:18 PM9/23/12
to zotoni...@googlegroups.com
You might have encountered a bug. The addsite command was change lately
to include a check whether or not zotonic is running.

What does the following command give you:

erl_call -name zotonic09@localhost -a "zotonic status"; echo $?

The output should be: ok0

Arjan

On 09/23/2012 07:42 PM, Alexey Marunin wrote:
> Hi, all!
>
> Try to create new site:
>
> cd bin
> ./zotonic addsite
>
> Zotonic is not running. You need to start zotonic first to use this command.
>
> But
> ps -fe | grep zotonic
> zotonic 28767 1 1 21:34 ? 00:00:03
> /usr/lib/erlang/erts-5.8/bin/beam -- -root /usr/lib/erlang -progname erl
> -- -home /home/zotonic -- -pa /home/zotonic/zotonic/0.9.0/ebin
> /home/zotonic/zotonic/0.9.0/deps/bert.erl/ebin
> /home/zotonic/zotonic/0.9.0/deps/dh_date/ebin
> /home/zotonic/zotonic/0.9.0/deps/gen_smtp/ebin
> /home/zotonic/zotonic/0.9.0/deps/iconv/ebin
> /home/zotonic/zotonic/0.9.0/deps/lager/ebin
> /home/zotonic/zotonic/0.9.0/deps/mimetypes/ebin
> /home/zotonic/zotonic/0.9.0/deps/mochiweb/ebin
> /home/zotonic/zotonic/0.9.0/deps/ua_classifier/ebin
> /home/zotonic/zotonic/0.9.0/deps/webzmachine/ebin
> /home/zotonic/zotonic/0.9.0/modules/mod_oauth/deps/erlang-oauth/ebin
> /home/zotonic/zotonic/0.9.0/priv/modules/*/deps/*/ebin
> /home/zotonic/zotonic/0.9.0/priv/sites/*/modules/*/deps/*/ebin -name
> zotonic09@localhost -boot start_sasl -heart -noshell -noinput -s zotonic
> zotonic 28768 28767 0 21:34 ? 00:00:00 heart -pid 28767
>
> What I do wrong?
>
> PS. Sorry for my bad English :)
>
>

Alexey Marunin

unread,
Sep 23, 2012, 4:51:03 PM9/23/12
to zotoni...@googlegroups.com

Hi  Arjan

What does the following command give you:

erl_call -name zotonic09@localhost -a "zotonic status"; echo $?

The output should be: ok0


Somehow changed hostname:

cd bin
./zotonic start

Starting zotonic zoton...@helentana-dev.local

./zotonic addsite

Zotonic is not running. You need to start zotonic first to use this command.

erl_call -name zoton...@helentana-dev.local -a "zotonic status"; echo $?

erl_call: can't get_hostent(helentana-dev.local)
1

sudo ps -fe | grep zotonic

zotonic   3457     1  1 00:35 ?        00:00:04 /usr/lib/erlang/erts-5.8/bin/beam -- -root /usr/lib/erlang -progname erl -- -home /home/zotonic -- -pa /home/zotonic/zotonic/0.9.0/ebin /home/zotonic/zotonic/0.9.0/deps/bert.erl/ebin /home/zotonic/zotonic/0.9.0/deps/dh_date/ebin /home/zotonic/zotonic/0.9.0/deps/gen_smtp/ebin /home/zotonic/zotonic/0.9.0/deps/iconv/ebin /home/zotonic/zotonic/0.9.0/deps/lager/ebin /home/zotonic/zotonic/0.9.0/deps/mimetypes/ebin /home/zotonic/zotonic/0.9.0/deps/mochiweb/ebin /home/zotonic/zotonic/0.9.0/deps/ua_classifier/ebin /home/zotonic/zotonic/0.9.0/deps/webzmachine/ebin /home/zotonic/zotonic/0.9.0/modules/mod_oauth/deps/erlang-oauth/ebin /home/zotonic/zotonic/0.9.0/priv/modules/*/deps/*/ebin /home/zotonic/zotonic/0.9.0/priv/sites/*/modules/*/deps/*/ebin -name zoton...@helentana-dev.local -boot start_sasl -config /home/zotonic/zotonic/0.9.0/priv/erlang.config -heart -noshell -noinput -s zotonic
zotonic   3458  3457  0 00:35 ?        00:00:00 heart -pid 3457

./zotonic status

Running: zoton...@helentana-dev.local

Sites Status:
=============
{"init terminating in do_boot",{function_clause,[{zotonic,'-status/1-lc$^0/1-0-',[{badrpc,nodedown}]},{zotonic,status,1},{init,start_it,1},{init,start_em,1}]}}

Crash dump was written to: erl_crash.dump
init terminating in do_boot ()

./zotonic stop

Stopping zotonic zoton...@helentana-dev.local
Stop:'zoton...@helentana-dev.local'
There is no node with this name


I stop zotonic by killing heart-process :)




Amiramix

unread,
Sep 23, 2012, 8:49:55 PM9/23/12
to zotoni...@googlegroups.com
It may not be enough to change hostname. It wasn't in my case at least. Zotonic required that the full qualified name is returned, e.g. that both forward and backward dns entries are present.

First of all check what "host YOURIP" returns. It should return the hostname. You can also try "nslookup YOURIP", e.g.:

host 192.168.1.68
or
nslookup 192.168.1.68

Where YOURIP or 192.168.1.68 in the example above is the IP of your server. With dig you could do:

dig youhostname.com
dig -x YOURIP

In Erlang shell, after starting Zotonic, you can try net_adm:localhost(). and inet:gethostname().

Please post outputs of those commands. I don't remember what the values were in my case but I do remember that until I sorted them out to return proper values the Erlang node couldn't resolve the hostname properly and be communicated with by commands like zotonic-addsite.


On Sunday, September 23, 2012 6:42:00 PM UTC+1, Alexey Marunin wrote:
Hi, all!

Try to create new site:

cd bin
./zotonic addsite

Zotonic is not running. You need to start zotonic first to use this command.

But
ps -fe | grep zotonic
zotonic  28767     1  1 21:34 ?        00:00:03 /usr/lib/erlang/erts-5.8/bin/beam -- -root /usr/lib/erlang -progname erl -- -home /home/zotonic -- -pa /home/zotonic/zotonic/0.9.0/ebin /home/zotonic/zotonic/0.9.0/deps/bert.erl/ebin /home/zotonic/zotonic/0.9.0/deps/dh_date/ebin /home/zotonic/zotonic/0.9.0/deps/gen_smtp/ebin /home/zotonic/zotonic/0.9.0/deps/iconv/ebin /home/zotonic/zotonic/0.9.0/deps/lager/ebin /home/zotonic/zotonic/0.9.0/deps/mimetypes/ebin /home/zotonic/zotonic/0.9.0/deps/mochiweb/ebin /home/zotonic/zotonic/0.9.0/deps/ua_classifier/ebin /home/zotonic/zotonic/0.9.0/deps/webzmachine/ebin /home/zotonic/zotonic/0.9.0/modules/mod_oauth/deps/erlang-oauth/ebin /home/zotonic/zotonic/0.9.0/priv/modules/*/deps/*/ebin /home/zotonic/zotonic/0.9.0/priv/sites/*/modules/*/deps/*/ebin -name zotonic09@localhost -boot start_sasl -heart -noshell -noinput -s zotonic
zotonic  28768 28767  0 21:34 ?        00:00:00 heart -pid 28767

Andreas Stenius

unread,
Sep 24, 2012, 3:25:13 AM9/24/12
to zotoni...@googlegroups.com
I think we ought to have some more diagnostics built in to try to pin point the issue when
there's a node we fail to communicate with, as this is rather basic, to be able to do anything else.

Ah, so I went ahead and opened an issue for it:  https://github.com/zotonic/zotonic/issues/423 

//Andreas

2012/9/24 Amiramix <li...@gjunka.com>

Arjan Scherpenisse

unread,
Sep 24, 2012, 5:24:04 AM9/24/12
to zotoni...@googlegroups.com
This issue started showing when I started using "erl_call" for certain
checks in the Zotonic scripts (as opposed to starting a node and then
using the rpc functions in zotonic.erl)

Maybe erl_call works differently?

Arjan

On 09/24/2012 09:25 AM, Andreas Stenius wrote:
> I think we ought to have some more diagnostics built in to try to pin
> point the issue when
> there's a node we fail to communicate with, as this is rather basic, to
> be able to do anything else.
>
> Ah, so I went ahead and opened an issue for it:
> https://github.com/zotonic/zotonic/issues/423
>
> //Andreas
>
> 2012/9/24 Amiramix <li...@gjunka.com <mailto:li...@gjunka.com>>
>
> It may not be enough to change hostname. It wasn't in my case at
> least. Zotonic required that the full qualified name is returned,
> e.g. that both forward and backward dns entries are present.
>
> First of all check what "host YOURIP" returns. It should return the
> hostname. You can also try "nslookup YOURIP", e.g.:
>
> host 192.168.1.68
> or
> nslookup 192.168.1.68
>
> Where YOURIP or 192.168.1.68 in the example above is the IP of your
> server. With dig you could do:
>
> dig youhostname.com <http://youhostname.com>
> dig -x YOURIP
>
> In Erlang shell, after starting Zotonic, you can try
> net_adm:localhost(). and inet:gethostname().
>
> Please post outputs of those commands. I don't remember what the
> values were in my case but I do remember that until I sorted them
> out to return proper values the Erlang node couldn't resolve the
> hostname properly and be communicated with by commands like
> zotonic-addsite.
>
>
> On Sunday, September 23, 2012 6:42:00 PM UTC+1, Alexey Marunin wrote:
>
> Hi, all!
>
> Try to create new site:
>
> cd bin
> ./zotonic addsite
>
> Zotonic is not running. You need to start zotonic first to use
> this command.
>
> But
> ps -fe | grep zotonic
> zotonic 28767 1 1 21:34 ? 00:00:03
> /usr/lib/erlang/erts-5.8/bin/__beam -- -root /usr/lib/erlang
> -progname erl -- -home /home/zotonic -- -pa
> /home/zotonic/zotonic/0.9.0/__ebin
> /home/zotonic/zotonic/0.9.0/__deps/bert.erl/ebin
> /home/zotonic/zotonic/0.9.0/__deps/dh_date/ebin
> /home/zotonic/zotonic/0.9.0/__deps/gen_smtp/ebin
> /home/zotonic/zotonic/0.9.0/__deps/iconv/ebin
> /home/zotonic/zotonic/0.9.0/__deps/lager/ebin
> /home/zotonic/zotonic/0.9.0/__deps/mimetypes/ebin
> /home/zotonic/zotonic/0.9.0/__deps/mochiweb/ebin
> /home/zotonic/zotonic/0.9.0/__deps/ua_classifier/ebin
> /home/zotonic/zotonic/0.9.0/__deps/webzmachine/ebin
> /home/zotonic/zotonic/0.9.0/__modules/mod_oauth/deps/erlang-__oauth/ebin
> /home/zotonic/zotonic/0.9.0/__priv/modules/*/deps/*/ebin
> /home/zotonic/zotonic/0.9.0/__priv/sites/*/modules/*/deps/*/__ebin

Grzegorz Junka

unread,
Sep 24, 2012, 6:20:15 AM9/24/12
to zotoni...@googlegroups.com
Yes, I think so, because as I said erl_call didn't work for me until my
host had a proper DNS name that could be forward and back resolved. Just
an entry in the host file wasn't enough.

Alexey Marunin

unread,
Sep 25, 2012, 11:53:57 AM9/25/12
to zotoni...@googlegroups.com
Hi, Amiramix!

First of all check what "host YOURIP" returns. It should return the hostname. You can also try "nslookup YOURIP", e.g.:

host 192.168.1.68
or
nslookup 192.168.1.68


$ host 134.0.117.105

105.117.0.134.in-addr.arpa domain name pointer helentana-dev.ru.


 
In Erlang shell, after starting Zotonic, you can try net_adm:localhost(). and inet:gethostname().

HOSTNAME=helentana-dev.ru zotonic debug

1> inet:gethostname().
{ok,"helentana-dev"}

2> net_adm:localhost().
 

Amiramix

unread,
Sep 25, 2012, 6:27:42 PM9/25/12
to zotoni...@googlegroups.com
Could you please start zotonic with the standard starting script WITHOUT setting the HOSTNAME variable:

./start.sh (from the Zotonic main folder)

Then do again inet:gethostname(). and net_adm:localhost().

The command zotonic addsite will in the end call erl_call, which will try to communicate with the node started from ./start.sh to add the new site. When erl_call is run it doesn't have the HOSTNAME environment variable set and this is probably why it can't communicate with the Zotonic node. The hostname must be set properly for the whole system, so it can be visible by erl_call as well, not only when starting the Zotonic site.

Alexey Marunin

unread,
Sep 26, 2012, 2:01:55 PM9/26/12
to zotoni...@googlegroups.com
zotonic@helentana-dev:~/zotonic/mainline$ ./start.sh

Erlang R14A (erts-5.8) [source] [64-bit] [rq:1] [async-threads:0] [hipe] [kernel-poll:true]

Eshell V5.8  (abort with ^G)
(zoton...@helentana-dev.local)1> ** Found 0 name clashes in code paths
** Found 0 name clashes in code paths
21:53:38.908 [info] Application lager started on node 'zoton...@helentana-dev.local'
21:53:38.972 [info] Application mnesia started on node 'zoton...@helentana-dev.local'
21:53:38.978 [info] Application public_key started on node 'zoton...@helentana-dev.local'
21:53:38.986 [info] Application ssl started on node 'zoton...@helentana-dev.local'
21:53:39.013 [info] Application inets started on node 'zoton...@helentana-dev.local'
** Found 0 name clashes in code paths
21:53:39.098 [info] Application mimetypes started on node 'zoton...@helentana-dev.local'
21:53:39.139 [info] gen_smtp_server starting at 'zoton...@helentana-dev.local'

21:53:39.139 [info] listening on {0,0,0,0}:2525 via tcp

21:53:39.181 [info] Application zotonic started on node 'zoton...@helentana-dev.local'
inet:gethostname().
{ok,"helentana-dev"}
(zoton...@helentana-dev.local)2> net_adm:localhost().


In another console:
zotonic@helentana-dev:~/zotonic/mainline/bin$ ./zotonic addsite

Arjan Scherpenisse

unread,
Sep 26, 2012, 2:11:15 PM9/26/12
to zotoni...@googlegroups.com

One thing I see is that your Erlang version is too old...

You need r14b03 or newer.

Cheers, Arjan

Op 26 sep. 2012 20:01 schreef "Alexey Marunin" <gmar...@gmail.com> het volgende:

Marc Worrell

unread,
Sep 26, 2012, 2:41:09 PM9/26/12
to zotoni...@googlegroups.com
Added an issue about this https://github.com/zotonic/zotonic/issues/427

In short: don't start when running on R14B02 or older.

- Marc

Alexey Marunin

unread,
Sep 26, 2012, 3:45:40 PM9/26/12
to zotoni...@googlegroups.com

One thing I see is that your Erlang version is too old...

You need r14b03 or newer.

Cheers, Arjan


I updated Erlang to R15B02 

zotonic@helentana-dev:~/zotonic/mainline$ ./start.sh
Erlang R15B02 (erts-5.9.2) [source] [64-bit] [async-threads:0] [hipe] [kernel-poll:true]

Eshell V5.9.2  (abort with ^G)
(zoton...@helentana-dev.local)1> ** Found 0 name clashes in code paths
** Found 0 name clashes in code paths
23:10:29.579 [info] Application lager started on node 'zoton...@helentana-dev.local'
23:10:29.782 [info] Application mnesia started on node 'zoton...@helentana-dev.local'
23:10:29.789 [info] Application public_key started on node 'zoton...@helentana-dev.local'
23:10:29.805 [info] Application ssl started on node 'zoton...@helentana-dev.local'
23:10:29.840 [info] Application inets started on node 'zoton...@helentana-dev.local'
** Found 0 name clashes in code paths
23:10:29.943 [info] Application mimetypes started on node 'zoton...@helentana-dev.local'
23:10:30.011 [info] gen_smtp_server starting at 'zoton...@helentana-dev.local'

23:10:30.011 [info] listening on {0,0,0,0}:2525 via tcp

23:10:30.124 [info] Application zotonic started on node 'zoton...@helentana-dev.local'
inet:gethostname().
{ok,"helentana-dev"}
(zoton...@helentana-dev.local)2> net_adm:localhost().

Try add site:
zotonic@helentana-dev:~/zotonic/mainline/bin$ ./zotonic addsite
Zotonic is not running. You need to start zotonic first to use this command.


PS. Zotonic status output (may be useful):

zotonic@helentana-dev:~/zotonic/mainline/bin$ ./zotonic status
Running: zoton...@helentana-dev.local

Sites Status:
=============
{"init terminating in do_boot",{function_clause,[{zotonic,'-status/1-lc$^0/1-0-',[{badrpc,nodedown}],[]},{zotonic,status,1,[]},{init,start_it,1,[]},{init,start_em,1,[]}]}}

Amiramix

unread,
Sep 27, 2012, 11:23:04 AM9/27/12
to zotoni...@googlegroups.com
Hi Alexey,
I still think this is a problem with the domain name of the Erlang node. Specifically the script says that you started the node on zoton...@helentana-dev.local whereas net_adm:localhost(). returns helentana-dev.ru. Where does the .ru come from?

Could you please do a quick test and run this command:

erl_call -name zoton...@helentana-dev.local

and

erl_call -name zoton...@helentana-dev.ru

If erl_call can connect to the node then it doesn't return anything, and it returns an error if it can't.

And also, can you temporary edit zotonic/src/scripts/helpers/zotonic-debug script and add echo in front of the command, e.g.:

echo $ERL -env (...)

Then try to call ./start.sh as usually. This time instead of starting the node it will print to the terminal the command and its parameters that it's using to start the node.



On Wednesday, September 26, 2012 7:01:56 PM UTC+1, Alexey Marunin wrote:
zotonic@helentana-dev:~/zotonic/mainline$ ./start.sh

Erlang R14A (erts-5.8) [source] [64-bit] [rq:1] [async-threads:0] [hipe] [kernel-poll:true]

Eshell V5.8  (abort with ^G)
(zotonic001@helentana-dev.local)1> ** Found 0 name clashes in code paths
** Found 0 name clashes in code paths
21:53:38.908 [info] Application lager started on node 'zotonic001@helentana-dev.local'
21:53:38.972 [info] Application mnesia started on node 'zotonic001@helentana-dev.local'
21:53:38.978 [info] Application public_key started on node 'zotonic001@helentana-dev.local'
21:53:38.986 [info] Application ssl started on node 'zotonic001@helentana-dev.local'
21:53:39.013 [info] Application inets started on node 'zotonic001@helentana-dev.local'
** Found 0 name clashes in code paths
21:53:39.098 [info] Application mimetypes started on node 'zotonic001@helentana-dev.local'
21:53:39.139 [info] gen_smtp_server starting at 'zotonic001@helentana-dev.local'

21:53:39.139 [info] listening on {0,0,0,0}:2525 via tcp

21:53:39.181 [info] Application zotonic started on node 'zotonic001@helentana-dev.local'
inet:gethostname().
{ok,"helentana-dev"}
(zotonic001@helentana-dev.local)2> net_adm:localhost().

Alexey Marunin

unread,
Sep 27, 2012, 2:43:08 PM9/27/12
to zotoni...@googlegroups.com

Hi, Amiramix!

I still think this is a problem with the domain name of the Erlang node. Specifically the script says that you started the node on zoton...@helentana-dev.local whereas net_adm:localhost(). returns helentana-dev.ru. Where does the .ru come from?

Could you please do a quick test and run this command:

erl_call -name zoton...@helentana-dev.local

and

erl_call -name zoton...@helentana-dev.ru

If erl_call can connect to the node then it doesn't return anything, and it returns an error if it can't.


zotonic@helentana-dev:~$ erl_call -name zoton...@helentana-dev.local
bash: erl_call: command not found

But erl run successfully. 

zotonic@helentana-dev:~$ erl -version
Erlang (ASYNC_THREADS,HIPE) (BEAM) emulator version 5.9.2

zotonic@helentana-dev:~$ which erl
/srv/otp/r15b02/bin/erl

zotonic@helentana-dev:~$ ls -1 /srv/otp/r15b02/bin
ct_run
dialyzer
epmd
erl
erlc
escript
run_erl
run_test
start
start.boot
start_clean.boot
start_erl
start_sasl.boot
start.script
to_erl
typer


 
And also, can you temporary edit zotonic/src/scripts/helpers/zotonic-debug script and add echo in front of the command, e.g.:

echo $ERL -env (...)

I found shell-script zotonic-debug in zotonic/src/scripts directory, not zotonic/src/scripts/helpers

 
Then try to call ./start.sh as usually. This time instead of starting the node it will print to the terminal the command and its parameters that it's using to start the node.
 
zotonic@helentana-dev:~/zotonic/mainline$ ./start.sh
erl -env ERL_MAX_PORTS 1024 +P 10000000 +K true -pa /home/zotonic/zotonic/0.9.0/ebin /home/zotonic/zotonic/0.9.0/deps/bert.erl/ebin /home/zotonic/zotonic/0.9.0/deps/dh_date/ebin /home/zotonic/zotonic/0.9.0/deps/gen_smtp/ebin /home/zotonic/zotonic/0.9.0/deps/iconv/ebin /home/zotonic/zotonic/0.9.0/deps/lager/ebin /home/zotonic/zotonic/0.9.0/deps/mimetypes/ebin /home/zotonic/zotonic/0.9.0/deps/mochiweb/ebin /home/zotonic/zotonic/0.9.0/deps/ua_classifier/ebin /home/zotonic/zotonic/0.9.0/deps/webzmachine/ebin /home/zotonic/zotonic/0.9.0/modules/mod_oauth/deps/erlang-oauth/ebin /home/zotonic/zotonic/0.9.0/priv/modules/*/deps/*/ebin /home/zotonic/zotonic/0.9.0/priv/sites/*/modules/*/deps/*/ebin -name zoton...@helentana-dev.local -boot start_sasl -config /home/zotonic/zotonic/0.9.0/priv/erlang.config -sasl errlog_type error -s zotonic


PS. Maybe it's important - directory ~/zotonic/mainline is symlink to ~/zotonic/0.9.0 directory.

Alexey Marunin

unread,
Sep 27, 2012, 4:29:15 PM9/27/12
to zotoni...@googlegroups.com
I restarted my server.

zotonic@helentana-dev:~/zotonic/0.9.0/bin$ ./zotonic addsite -d helentana_zotonic -u grome -P ******** -s blog helentana
Warning!
Site: 'helentana' cannot be reached.
Command 'host helentana' must resolve to an IP address,
otherwise you won't be able to reach it after installing the site.
You can fix that by adding the following line to /etc/hosts:

127.0.0.1         helentana


==== Add site ====

 Site name: helentana
 Site directory: /home/zotonic/zotonic/0.9.0/priv/sites/helentana
 Skeleton site: blog

 Database host: 127.0.0.1
 Database port: 5432
 Database user: grome
 Database password: ********
 Database name: helentana_zotonic
 Database schema: public
 Admin password: ********

>>> Hit return to proceed...
~/zotonic/0.9.0/src/scripts ~/zotonic/0.9.0/src/scripts
~/zotonic/0.9.0/src/scripts
Building site...
/home/zotonic/zotonic/0.9.0/src/scripts/zotonic-addsite: line 85: erl_call: command not found
Starting...
/home/zotonic/zotonic/0.9.0/src/scripts/zotonic-addsite: line 93: erl_call: command not found

Added site helentana. Now go to http://helentana:8000/ to view it.
 
Then I edited config-file - set hostname as helentana-dev.ru


Now example site successfully load :) But no picture... I think because of old version ImageMagick

Last question - why erl_call not found? 


Amiramix

unread,
Sep 27, 2012, 4:46:39 PM9/27/12
to zotoni...@googlegroups.com
In my case erl_call could be found in this path:

/usr/local/lib/erlang/lib/erl_interface-3.7.5/bin/erl_call

whereas all other erlang binaries are in this path:

/usr/local/bin/

I think location of erl_call may be system specific. Did you compile Erlang yourself or downloaded as a package? I would try something like:

cd /
find . | grep erl_call

You could also try "man erl_call" to see if the system knows anything about it.

Andreas Stenius

unread,
Sep 27, 2012, 4:55:34 PM9/27/12
to zotoni...@googlegroups.com
As Greg pointed out, it's located in the bin dir of erl_interface.

On my system, it's in /usr/lib/erlang/lib/erl_interface-3.7.7/bin so a slightly different version...

Online docs for erl_call is here: http://www.erlang.org/doc/man/erl_call.html

And it was those docs that hinted for me where to look for it ;)

//Andreas

2012/9/27 Amiramix <li...@gjunka.com>

Arjan Scherpenisse

unread,
Sep 28, 2012, 3:03:45 AM9/28/12
to zotoni...@googlegroups.com
Strange, I always assumed erl_call was on the path. I guess we should do
some magic to determine where erl_call is when its not on the path...

On 09/27/2012 10:55 PM, Andreas Stenius wrote:
> As Greg pointed out, it's located in the bin dir of erl_interface.
>
> On my system, it's in /usr/lib/erlang/lib/erl_interface-3.7.7/bin so a
> slightly different version...
>
> Online docs for erl_call is here:
> http://www.erlang.org/doc/man/erl_call.html
>
> And it was those docs that hinted for me where to look for it ;)
>
> //Andreas
>
> 2012/9/27 Amiramix <li...@gjunka.com <mailto:li...@gjunka.com>>
>
> In my case erl_call could be found in this path:
>
> /usr/local/lib/erlang/lib/erl_interface-3.7.5/bin/erl_call
>
> whereas all other erlang binaries are in this path:
>
> /usr/local/bin/
>
> I think location of erl_call may be system specific. Did you compile
> Erlang yourself or downloaded as a package? I would try something like:
>
> cd /
> find . | grep erl_call
>
> You could also try "man erl_call" to see if the system knows
> anything about it.
>
>
> On Thursday, September 27, 2012 9:29:15 PM UTC+1, Alexey Marunin wrote:
>
> I restarted my server.
>
> zotonic@helentana-dev:~/__zotonic/0.9.0/bin$ ./zotonic addsite
> -d helentana_zotonic -u grome -P ******** -s blog helentana
> Warning!
> Site: 'helentana' cannot be reached.
> Command 'host helentana' must resolve to an IP address,
> otherwise you won't be able to reach it after installing the site.
> You can fix that by adding the following line to /etc/hosts:
>
> 127.0.0.1 helentana
>
>
> ==== Add site ====
>
> Site name: helentana
> Site directory: /home/zotonic/zotonic/0.9.0/__priv/sites/helentana
> Skeleton site: blog
>
> Database host: 127.0.0.1
> Database port: 5432
> Database user: grome
> Database password: ********
> Database name: helentana_zotonic
> Database schema: public
> Admin password: ********
>
> >>> Hit return to proceed...
> ~/zotonic/0.9.0/src/scripts ~/zotonic/0.9.0/src/scripts
> ~/zotonic/0.9.0/src/scripts
> Building site...
> /home/zotonic/zotonic/0.9.0/__src/scripts/zotonic-addsite: line
> 85: erl_call: command not found
> Starting...
> /home/zotonic/zotonic/0.9.0/__src/scripts/zotonic-addsite: line
> 93: erl_call: command not found
>
> Added site helentana. Now go to http://helentana:8000/ to view it.
> Then I edited config-file - set hostname as helentana-dev.ru
> <http://helentana-dev.ru>

Andreas Stenius

unread,
Sep 28, 2012, 3:19:06 AM9/28/12
to zotoni...@googlegroups.com
I take it It's on your path then... ?

Strange indeed. Perhaps if you installed it using some package manager, that the packager added a symlink or something for erl_call to a bin directory that's in your path.. ?

2012/9/28 Arjan Scherpenisse <ar...@scherpenisse.net>

Arjan Scherpenisse

unread,
Sep 28, 2012, 4:20:25 AM9/28/12
to zotoni...@googlegroups.com
Yes, I'm using the esl-erlang packages from Erlang solutions..

On 09/28/2012 09:19 AM, Andreas Stenius wrote:
> I take it It's on your path then... ?
>
> Strange indeed. Perhaps if you installed it using some package manager,
> that the packager added a symlink or something for erl_call to a bin
> directory that's in your path.. ?
>
> 2012/9/28 Arjan Scherpenisse <ar...@scherpenisse.net
> <mailto:ar...@scherpenisse.net>>
>
> Strange, I always assumed erl_call was on the path. I guess we
> should do some magic to determine where erl_call is when its not on
> the path...
>
>
> On 09/27/2012 10:55 PM, Andreas Stenius wrote:
>
> As Greg pointed out, it's located in the bin dir of erl_interface.
>
> On my system, it's in
> /usr/lib/erlang/lib/erl___interface-3.7.7/bin so a
> slightly different version...
>
> Online docs for erl_call is here:
> http://www.erlang.org/doc/man/__erl_call.html
> <http://www.erlang.org/doc/man/erl_call.html>
>
> And it was those docs that hinted for me where to look for it ;)
>
> //Andreas
>
> 2012/9/27 Amiramix <li...@gjunka.com <mailto:li...@gjunka.com>
> <mailto:li...@gjunka.com <mailto:li...@gjunka.com>>>
>
>
> In my case erl_call could be found in this path:
>
> /usr/local/lib/erlang/lib/erl___interface-3.7.5/bin/erl_call
>
> whereas all other erlang binaries are in this path:
>
> /usr/local/bin/
>
> I think location of erl_call may be system specific. Did
> you compile
> Erlang yourself or downloaded as a package? I would try
> something like:
>
> cd /
> find . | grep erl_call
>
> You could also try "man erl_call" to see if the system knows
> anything about it.
>
>
> On Thursday, September 27, 2012 9:29:15 PM UTC+1, Alexey
> Marunin wrote:
>
> I restarted my server.
>
> zotonic@helentana-dev:~/____zotonic/0.9.0/bin$
> ./zotonic addsite
>
> -d helentana_zotonic -u grome -P ******** -s blog helentana
> Warning!
> Site: 'helentana' cannot be reached.
> Command 'host helentana' must resolve to an IP address,
> otherwise you won't be able to reach it after
> installing the site.
> You can fix that by adding the following line to
> /etc/hosts:
>
> 127.0.0.1 helentana
>
>
> ==== Add site ====
>
> Site name: helentana
> Site directory:
> /home/zotonic/zotonic/0.9.0/____priv/sites/helentana
>
> Skeleton site: blog
>
> Database host: 127.0.0.1
> Database port: 5432
> Database user: grome
> Database password: ********
> Database name: helentana_zotonic
> Database schema: public
> Admin password: ********
>
> >>> Hit return to proceed...
> ~/zotonic/0.9.0/src/scripts ~/zotonic/0.9.0/src/scripts
> ~/zotonic/0.9.0/src/scripts
> Building site...
>
> /home/zotonic/zotonic/0.9.0/____src/scripts/zotonic-addsite: line
>
> 85: erl_call: command not found
> Starting...
>
> /home/zotonic/zotonic/0.9.0/____src/scripts/zotonic-addsite: line

Arjan Scherpenisse

unread,
Sep 28, 2012, 4:20:40 AM9/28/12
to zotoni...@googlegroups.com
> ls -la `which erl_call`
lrwxrwxrwx 1 root root 51 Sep 4 12:38 /usr/bin/erl_call ->
../lib/erlang//lib/erl_interface-3.7.8/bin/erl_call



On 09/28/2012 09:19 AM, Andreas Stenius wrote:
> I take it It's on your path then... ?
>
> Strange indeed. Perhaps if you installed it using some package manager,
> that the packager added a symlink or something for erl_call to a bin
> directory that's in your path.. ?
>
> 2012/9/28 Arjan Scherpenisse <ar...@scherpenisse.net
> <mailto:ar...@scherpenisse.net>>
>
> Strange, I always assumed erl_call was on the path. I guess we
> should do some magic to determine where erl_call is when its not on
> the path...
>
>
> On 09/27/2012 10:55 PM, Andreas Stenius wrote:
>
> As Greg pointed out, it's located in the bin dir of erl_interface.
>
> On my system, it's in
> /usr/lib/erlang/lib/erl___interface-3.7.7/bin so a
> slightly different version...
>
> Online docs for erl_call is here:
> http://www.erlang.org/doc/man/__erl_call.html
> <http://www.erlang.org/doc/man/erl_call.html>
>
> And it was those docs that hinted for me where to look for it ;)
>
> //Andreas
>
> 2012/9/27 Amiramix <li...@gjunka.com <mailto:li...@gjunka.com>
> <mailto:li...@gjunka.com <mailto:li...@gjunka.com>>>
>
>
> In my case erl_call could be found in this path:
>
> /usr/local/lib/erlang/lib/erl___interface-3.7.5/bin/erl_call
>
> whereas all other erlang binaries are in this path:
>
> /usr/local/bin/
>
> I think location of erl_call may be system specific. Did
> you compile
> Erlang yourself or downloaded as a package? I would try
> something like:
>
> cd /
> find . | grep erl_call
>
> You could also try "man erl_call" to see if the system knows
> anything about it.
>
>
> On Thursday, September 27, 2012 9:29:15 PM UTC+1, Alexey
> Marunin wrote:
>
> I restarted my server.
>
> zotonic@helentana-dev:~/____zotonic/0.9.0/bin$
> ./zotonic addsite
>
> -d helentana_zotonic -u grome -P ******** -s blog helentana
> Warning!
> Site: 'helentana' cannot be reached.
> Command 'host helentana' must resolve to an IP address,
> otherwise you won't be able to reach it after
> installing the site.
> You can fix that by adding the following line to
> /etc/hosts:
>
> 127.0.0.1 helentana
>
>
> ==== Add site ====
>
> Site name: helentana
> Site directory:
> /home/zotonic/zotonic/0.9.0/____priv/sites/helentana
>
> Skeleton site: blog
>
> Database host: 127.0.0.1
> Database port: 5432
> Database user: grome
> Database password: ********
> Database name: helentana_zotonic
> Database schema: public
> Admin password: ********
>
> >>> Hit return to proceed...
> ~/zotonic/0.9.0/src/scripts ~/zotonic/0.9.0/src/scripts
> ~/zotonic/0.9.0/src/scripts
> Building site...
>
> /home/zotonic/zotonic/0.9.0/____src/scripts/zotonic-addsite: line
>
> 85: erl_call: command not found
> Starting...
>
> /home/zotonic/zotonic/0.9.0/____src/scripts/zotonic-addsite: line

Marc Worrell

unread,
Sep 28, 2012, 1:38:36 PM9/28/12
to zotoni...@googlegroups.com
And now on my OS X 10.7 machine, where I installed R14B04 from source:

Lamma:~ marc$ which erl_call
Lamma:~ marc$ which erl
/usr/local/bin/erl
Lamma:~ marc$ which erl_call
Lamma:~ marc$ locate erl_call
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/usr/include/apache2/modperl_callback.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/apache2/modperl_callback.h
/Developer/SDKs/MacOSX10.5.sdk/usr/include/apache2/modperl_callback.h
/Developer/SDKs/MacOSX10.6.sdk/usr/include/apache2/modperl_callback.h
/usr/include/apache2/modperl_callback.h
/usr/local/lib/erlang/lib/erl_interface-3.7.3/bin/erl_call
/usr/local/lib/erlang/lib/erl_interface-3.7.3/src/prog/erl_call.c
/usr/local/lib/erlang/lib/erl_interface-3.7.4/bin/erl_call
/usr/local/lib/erlang/lib/erl_interface-3.7.4/src/prog/erl_call.c
/usr/local/lib/erlang/lib/erl_interface-3.7.5/bin/erl_call
/usr/local/lib/erlang/lib/erl_interface-3.7.5/src/prog/erl_call.c


Seems that erl_call is not always installed…. at least not in the same path when doing a 'make install'
Arjan, how did you install erlang on your machine?

- Marc

Alexey Marunin

unread,
Sep 28, 2012, 3:51:17 PM9/28/12
to zotoni...@googlegroups.com
Hi Amiramix

In my case erl_call could be found in this path:

/usr/local/lib/erlang/lib/erl_interface-3.7.5/bin/erl_call

whereas all other erlang binaries are in this path:

/usr/local/bin/

I think location of erl_call may be system specific. Did you compile Erlang yourself or downloaded as a package? I would try something like:

cd /
find . | grep erl_call

You could also try "man erl_call" to see if the system knows anything about it.

 

I updated my Erlang according by official documentation:

wget http://www.erlang.org/download/otp_src_R15B02.tar.gz 
gunzip -c otp_src_R15B02.tar.gz | tar xvf - 
cd otp_src_R15B02 
export ERL_TOP=$PWD 
./configure 
make 
make install

And I have erl_call in path:
/usr/local/lib/erlang/lib/erl_interface-3.7.8/bin/erl_call


To run erl_call easy I create symlink:
ln -s /usr/local/lib/erlang/lib/erl_interface-3.7.8/bin/erl_call /usr/local/bin/erl_call

Now:

zotonic@helentana-dev:~$ erl_call -name zoton...@helentana-dev.local; echo $?
erl_call: can't ei_gethostbyname(helentana-dev.local)
1

zotonic@helentana-dev:~$ erl_call -name zoton...@helentana-dev.ru; echo $?
0

 
Message has been deleted

Amiramix

unread,
Oct 1, 2012, 11:36:14 AM10/1/12
to zotoni...@googlegroups.com
So, the hostname is now OK. But as I understood from previous emails addsite does work for you now, doesn't it?

The lack of pictures is probably due to the fact that module Bootstrap isn't enabled by default. At least that was the reason for me.

Alexey Marunin

unread,
Oct 1, 2012, 5:48:14 PM10/1/12
to zotoni...@googlegroups.com
Hi Amiramix

So, the hostname is now OK. But as I understood from previous emails addsite does work for you now, doesn't it?


Yes, now all commands work fine. Seems problem was in the incorrect hostname


 
The lack of pictures is probably due to the fact that module Bootstrap isn't enabled by default. At least that was the reason for me.

 
How check status of this module? And how enable it?
I try to build latest ImageMagick on my server - but not enough RAM to do it. I think because of 64bit-architecture (on the same system but x86-architecture ImageMagick successfully built). So may be your advice helps me

 

Alain O'Dea

unread,
Oct 1, 2012, 9:07:43 PM10/1/12
to zotoni...@googlegroups.com
Hi Alexey:

You can enable modules under System | Modules in Admin.  It is also accessible at http://example.com/admin/modules where example.com is your domain name :)

Drop me a line if you need assistance.

Best,
Alain

Alexey Marunin

unread,
Oct 2, 2012, 3:27:04 PM10/2/12
to zotoni...@googlegroups.com
Hi Alain

 
You can enable modules under System | Modules in Admin.  It is also accessible at http://example.com/admin/modules where example.com is your domain name :)
 
This module activated in my admin. But pictures still don`t display correctly
 

 

Alain O'Dea

unread,
Oct 2, 2012, 9:35:12 PM10/2/12
to zotoni...@googlegroups.com
Hi Alexey:

I have run into this a few times.

Do you have the module for your site activated?  For me it is simply called "blog zotonic site".  If this is deactivated, you will not get a functional site.

Do you also have Zotonic Base activated?

I hope you don't mind the trial and error approach.  It can be quite difficult to know the specific issue sometimes :)

Best,
Alain

Alexey Marunin

unread,
Oct 3, 2012, 4:10:12 PM10/3/12
to zotoni...@googlegroups.com
Do you have the module for your site activated?  For me it is simply called "blog zotonic site".  If this is deactivated, you will not get a functional site.

Yes, green light :)
 

Do you also have Zotonic Base activated?

Yes

 
I hope you don't mind the trial and error approach.  It can be quite difficult to know the specific issue sometimes :)

I know sometimes difficult questions have a simple solution :)

Dawid Figiel

unread,
Oct 15, 2012, 8:28:30 PM10/15/12
to zotoni...@googlegroups.com
OK, I found the reason...

sudo su
echo "127.0.0.1 yoursite.local" >> /etc/hosts

This '.local' is confusing ;)

Good night!

D.

On Tue, Oct 16, 2012 at 2:15 AM, Dawid Figiel <dawid....@gmail.com> wrote:
> Hello,
>
> I also have some hostname related problems:
>
>
> dawid@asusek:$ cd bin
> dawid@asusek:$ ./zotonic start
> Starting zotonic zoton...@asusek.local
> dawid@asusek:$ ./zotonic status
> Running: zoton...@asusek.local
>
> Sites Status:
> =============
> {"init terminating in
> do_boot",{function_clause,[{zotonic,'-status/1-lc$^0/1-0-',[{badrpc,nodedown}],[{file,"src/zotonic.erl"},{line,83}]},{zotonic,status,1,[{file,"src/zotonic.erl"},{line,83}]},{init,start_it,1,[]},{init,start_em,1,[]}]}}
>
> Crash dump was written to: erl_crash.dump
> init terminating in do_boot ()
>
> dawid@asusek:$ erl_call -name zoton...@asusek.local
> erl_call: failed to connect to node zoton...@asusek.local
>
> dawid@asusek:$ ./zotonic stop
> Stopping zotonic zoton...@asusek.local
> Stopping:'zoton...@asusek.local'
> There is no node with this name
>
> (zoton...@asusek.local)3> zotonic:status().
> zotonic_status - running
> ok
>
> My environment:
>
> Zotonic - from git repository.
>
> host 127.0.0.1
> 1.0.0.127.in-addr.arpa domain name pointer localhost.
>
>
> /etc/hosts:
> 127.0.0.1 localhost
> 127.0.0.1 asusek
>
> nslookup 127.0.0.1Server: 127.0.0.1
> Address: 127.0.0.1#53
>
> 1.0.0.127.in-addr.arpa name = localhost.
>
> ALSO:
> (zoton...@asusek.local)4> net_adm:localhost().
> "asusek"
> (zoton...@asusek.local)5> inet:gethostname().
> {ok,"asusek"}
> (zoton...@asusek.local)6> erlang:get_cookie().
> 'LJAVWETBDROCJZORXVBI'
> (zoton...@asusek.local)7> node().
> 'zoton...@asusek.local'
>
> 2nd node:
> (zotonic002@asusek)1> erlang:get_cookie().
> 'LJAVWETBDROCJZORXVBI'
> (zotonic002@asusek)2> node().
> zotonic002@asusek
> (zotonic002@asusek)5> rpc:call('zoton...@asusek.local', z_sites_manager,
> get_sites_status, []).
>
> =ERROR REPORT==== 16-Oct-2012::01:52:26 ===
> ** System NOT running to use fully qualified hostnames **
> ** Hostname asusek.local is illegal **
> {badrpc,nodedown}
> (zotonic002@asusek)6> rpc:call('zotonic001@asusek', z_sites_manager,
> get_sites_status, []).
> {badrpc,nodedown}
>
>
> Probably I have some mismatches with DNS, or some hostsname issues...
>
> How can I fix this?
>
> Cheers,
>
> Dawid
>
>

Kunthar

unread,
Oct 15, 2012, 9:10:29 PM10/15/12
to zotoni...@googlegroups.com
One more seafarer saved the night in the ocean :-)
--
BR,
\|/ Kunthar

Arjan Scherpenisse

unread,
Oct 30, 2012, 4:21:28 PM10/30/12
to zotoni...@googlegroups.com
I just committed some changes which deal with the issues in this thread:

- Zotonic now uses code:priv_dir to locate the erl_call binary within the distribution, so that should always work (famous last words)
- Zotonic now runs using -sname by default; which prevents these hostname issues people were getting.  No more need to add foo.local to your hosts file!

Hopefully this makes everybody's life easier.

Arjan

On 09/23/2012 07:42 PM, Alexey Marunin wrote:
Hi, all!

Try to create new site:

cd bin
./zotonic addsite

Zotonic is not running. You need to start zotonic first to use this command.

But
ps -fe | grep zotonic
zotonic  28767     1  1 21:34 ?        00:00:03 /usr/lib/erlang/erts-5.8/bin/beam -- -root /usr/lib/erlang -progname erl -- -home /home/zotonic -- -pa /home/zotonic/zotonic/0.9.0/ebin /home/zotonic/zotonic/0.9.0/deps/bert.erl/ebin /home/zotonic/zotonic/0.9.0/deps/dh_date/ebin /home/zotonic/zotonic/0.9.0/deps/gen_smtp/ebin /home/zotonic/zotonic/0.9.0/deps/iconv/ebin /home/zotonic/zotonic/0.9.0/deps/lager/ebin /home/zotonic/zotonic/0.9.0/deps/mimetypes/ebin /home/zotonic/zotonic/0.9.0/deps/mochiweb/ebin /home/zotonic/zotonic/0.9.0/deps/ua_classifier/ebin /home/zotonic/zotonic/0.9.0/deps/webzmachine/ebin /home/zotonic/zotonic/0.9.0/modules/mod_oauth/deps/erlang-oauth/ebin /home/zotonic/zotonic/0.9.0/priv/modules/*/deps/*/ebin /home/zotonic/zotonic/0.9.0/priv/sites/*/modules/*/deps/*/ebin -name zotonic09@localhost -boot start_sasl -heart -noshell -noinput -s zotonic
zotonic  28768 28767  0 21:34 ?        00:00:00 heart -pid 28767

What I do wrong?

PS. Sorry for my bad English :)



Jan Willem Luiten

unread,
Nov 1, 2012, 8:30:23 AM11/1/12
to zotoni...@googlegroups.com
Hmmm,

I did a fresh clone and get the following error:

{error_logger,{{2012,11,1},{13,27,9}},"Can't set short node name!\nPlease check your configuration\n",[]}
{error_logger,{{2012,11,1},{13,27,9}},crash_report,[[{initial_call,{net_kernel,init,['Argument__1']}},{pid,<0.19.0>},{registered_name,[]},{error_info,{exit,{error,badarg},[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,320}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}},{ancestors,[net_sup,kernel_sup,<0.9.0>]},{messages,[]},{links,[<0.16.0>]},{dictionary,[{longnames,false}]},{trap_exit,true},{status,running},{heap_size,377},{stack_size,24},{reductions,206}],[]]}
{error_logger,{{2012,11,1},{13,27,9}},supervisor_report,[{supervisor,{local,net_sup}},{errorContext,start_error},{reason,{'EXIT',nodistribution}},{offender,[{pid,undefined},{name,net_kernel},{mfargs,{net_kernel,start_link,[['zoton...@combenoire.local',shortnames]]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]}
{error_logger,{{2012,11,1},{13,27,9}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,shutdown},{offender,[{pid,undefined},{name,net_sup},{mfargs,{erl_distribution,start_link,[]}},{restart_type,permanent},{shutdown,infinity},{child_type,supervisor}]}]}
{error_logger,{{2012,11,1},{13,27,9}},std_info,[{application,kernel},{exited,{shutdown,{kernel,start,[normal,[]]}}},{type,permanent}]}
{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}}"}

Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}})


Op dinsdag 30 oktober 2012 21:21:30 UTC+1 schreef Arjan Scherpenisse het volgende:

Andreas Stenius

unread,
Nov 1, 2012, 8:42:32 AM11/1/12
to Zotonic users
There was a change recently regarding this ( https://github.com/zotonic/zotonic/commit/62b80da1d712ce1b91802450a5642870ad5d7f40 )

Commit message was:

core: Make configurable whether we run with -name or with -sname

This fixes the fact that Zotonic always required a FQDN and the
"zotonic shell" command was not working reliably.

Zotonic now defaults to running with "-sname". To use "-name", set the
envirnoment variable ZOTONIC_DISTRIBUTED=true. Distributed
mode *really* requires a proper FQDN as returned by "hostname -f".

A better way to determine if Zotonic is running has also been added,
using "erl_call", and we determine more reliably where the "erl_call"
binary is located.


//Andreas


2012/11/1 Jan Willem Luiten <janwille...@gmail.com>

Arjan Scherpenisse

unread,
Nov 1, 2012, 10:35:46 AM11/1/12
to zotoni...@googlegroups.com
This is an interesting one.

Do you start with "zotonic start" or "zotonic debug"?

With either of those, can you open src/scripts/zotonic-start (or zotonic-debug) and, on the last line of the file add an "echo" in frond of the call to $ERL?

so the line becomes something like:

echo $ERL -env ERL_MAX_PORTS $MAX_PORTS +P $MAX_PROCESSES +K $KERNEL_POLL -pa $PA $NAME_ARG $NODENAME@$HOSTNAME -boot start_sasl -config $ZOTONIC/priv/erlang.config -heart -detached -s zotonic

and then run zotonic start, copypaste that line here.

Hmm, come to think of it, does the -sname part need a hostname (-sname foo@bar) at all, or without? (just -sname foo)
Erlang gurus, are you listening? :)

Arjan

Arjan Scherpenisse

unread,
Nov 1, 2012, 10:36:12 AM11/1/12
to zotoni...@googlegroups.com
Oh, reporting your OS, OS version, erlang version, might also help :)


On 11/01/2012 01:30 PM, Jan Willem Luiten wrote:

Jan Willem Luiten

unread,
Nov 1, 2012, 10:44:48 AM11/1/12
to zotoni...@googlegroups.com

Hello Arjan,

Running Mac OS X version 10.7.5, erlang R15B02. Zotonic will start with the following command:

$ ZOTONIC_DISTRIBUTED=true bin/zotonic debug

But that was not the issue.

Here's the result from the echo:

erl -env ERL_MAX_PORTS 256 +P 10000000 +K true -pa /Users/janwillem/github/local/my_zotonic/ebin /Users/janwillem/github/local/my_zotonic/deps/bert.erl/ebin /Users/janwillem/github/local/my_zotonic/deps/dh_date/ebin /Users/janwillem/github/local/my_zotonic/deps/gen_smtp/ebin /Users/janwillem/github/local/my_zotonic/deps/iconv/ebin /Users/janwillem/github/local/my_zotonic/deps/lager/ebin /Users/janwillem/github/local/my_zotonic/deps/mimetypes/ebin /Users/janwillem/github/local/my_zotonic/deps/mochiweb/ebin /Users/janwillem/github/local/my_zotonic/deps/ua_classifier/ebin /Users/janwillem/github/local/my_zotonic/deps/webzmachine/ebin /Users/janwillem/github/local/my_zotonic/deps/z_stdlib/ebin /Users/janwillem/github/local/my_zotonic/modules/mod_oauth/deps/erlang-oauth/ebin /Users/janwillem/github/local/my_zotonic/priv/modules/*/deps/*/ebin /Users/janwillem/github/local/my_zotonic/priv/sites/*/modules/*/deps/*/ebin -sname zoton...@combenoire.local -boot start_sasl -config /Users/janwillem/github/local/my_zotonic/priv/erlang.config -heart -detached -s zotonic

Regards,

Jan Willem.

Op donderdag 1 november 2012 15:36:14 UTC+1 schreef Arjan Scherpenisse het volgende:

Andreas Stenius

unread,
Nov 1, 2012, 11:23:21 AM11/1/12
to Zotonic users
From: http://erlang.org/doc/man/erl.html

-sname Name

Makes the Erlang runtime system into a distributed node, similar to -name, but the host name portion of the node name Name@Host will be the short name, not fully qualified.

This is sometimes the only way to run distributed Erlang if the DNS (Domain Name System) is not running. There can be no communication between nodes running with the -sname flag and those running with the -name flag, as node names must be unique in distributed Erlang systems.


-name Name

Makes the Erlang runtime system into a distributed node. This flag invokes all network servers necessary for a node to become distributed. See net_kernel(3). It is also ensured that epmd runs on the current host before Erlang is started. See epmd(1).

The name of the node will be Name@Host, where Host is the fully qualified host name of the current host. For short names, use the -sname flag instead.





2012/11/1 Arjan Scherpenisse <ar...@scherpenisse.net>

Arjan Scherpenisse

unread,
Nov 1, 2012, 11:54:32 AM11/1/12
to zotoni...@googlegroups.com
Thanks!

In the chatroom we figured out what's wrong. I pushed a fix.

Arjan

Iván Martínez

unread,
Jun 2, 2014, 8:12:30 AM6/2/14
to zotoni...@googlegroups.com
Hello all,
What is the proper way of setting ZOTONIC_DISTRIBUTED to true in a file, so one doesn't have to do it when starting the server?
Thank you,
Ivan

El jueves, 1 de noviembre de 2012 15:44:48 UTC+1, Jan Willem Luiten escribió:

$ ZOTONIC_DISTRIBUTED=true bin/zotonic debug

Arjan Scherpenisse

unread,
Jun 2, 2014, 8:26:21 AM6/2/14
to zotoni...@googlegroups.com
This has to be part of the shell's environment that is starting zotonic.

You can do it in a few ways:

.profile or .bashrc of the user running zotonic:
export ZOTONIC_DISTRIBUTED=true

or when you use sudo when starting zotonic: (e.g. from an init script)

/usr/bin/sudo -u zotonic ZOTONIC_DISTRIBUTED=true -i /home/zotonic/zotonic-0.9/zotonic/bin/zotonic $@
--

---
You received this message because you are subscribed to the Google Groups "Zotonic users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotonic-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages