Commit graph

44 commits

Author SHA1 Message Date
Roberto Aloi
0d5416218b Exit with proper status code if 'eval' fails 2015-01-23 08:31:58 +01:00
Сергей Прохоров
0a1961fb0d Fixed #133. Release upgrade handle long and short names properly.
Implemented, by moving upgrade functionality from install_upgrade.escript
to nodetool, which already supports both short and long names.
Make install_upgrade.escript as wrapper for nodetool for backward compatibility.
2015-01-20 10:18:10 +03:00
Roberto Aloi
93ccbf936c Implement eval command via nodetool 2014-10-21 14:22:37 +02:00
Habibutsu
12ca1fb126 Error 'Command not found' when sname is used
When a node is configured with -sname the REMSH_NAME_PART argument should be defined with using command 'hostname' but error occurs due extra space
2014-05-27 11:22:24 +03:00
Shunichi Shinohara
e4300bf88f Change nodetool path to under releases/<RELEASE_VERSION>/ 2014-03-09 15:55:52 +09:00
Shunichi Shinohara
12af16eb70 Add slim release support for runner script 2014-03-09 15:54:32 +09:00
Andrew Thompson
17fe5d6f1c Merge pull request #115 from mdaguete/simplenode.runner-remsh-fixes
Incorrect REMSH args when sname is used.
2014-03-05 15:22:28 -05:00
Manuel Durán Aguete
e1d218f99a Init RUNNER_SCRIPT var in simplenode.runner
RUNNER_SCRIPT variable is not initialized in simplenode.runner and it's
referenced when calling sudo.
2013-11-18 13:17:35 +01:00
Manuel Durán Aguete
cdfcc27087 Make REMSH node run in hidden mode
To avoid problems with REMSH node being visible from another nodes
starts it in hidden mode (erl -hidden).
2013-07-19 17:29:26 +02:00
Manuel Durán Aguete
5d4272baef Incorrect REMSH args when sname is used
When a node is configured with -sname in app.config or sys.config the
REMSH_NAME_ARG and REMSH_REMSH_ARG arguments are incorrect due the
assumption that the node name always contains '@'.

To fix the bug, the script tries to find '@' and then compose the
arguments acording to node name type. If in long name mode the
script can't compose a correct node name exits with warning.
2013-07-19 17:29:26 +02:00
olgeni
505458eecb Use "pwd -P" to get the current physical path.
It is a portable version of the realpath(1) utility that you can find on
Mac OS X and FreeBSD (see also The Open Group Base Specifications Issue
6, IEEE Std 1003.1).

Without the -P flag, pwd(1) might return different values when the
current path contains one or more symlinks, depending on how you got
into the current directory.

In simplenode.runner, this may cause PIPE_DIR to have different values
on each use, which will make it impossible to connect to the running
node unless you guess the correct path yourself.
2013-06-10 22:15:49 +02:00
Dave Smith
c057c7771e Remove unnecessary bar 2013-03-02 07:51:26 -07:00
Jared Morrow
c4989f0939 Change simplenode template files to work on more platforms
When developing Riak, we have found bugs and other issues due
to the number of platforms we support.

Here is an overview of the changes:
  -  Fix command-line syntax for commands to work on *BSD / Sun
  -  Add chkconfig and getpid to nodetool
  -  Replace platform specific 'kill' commands with a nodetool
	getpid method
  -  Fix RUNNER_USER settings to work on *BSD
2013-01-17 14:41:21 -07:00
Ulf Wiger
a8d11dc273 noderunner: add support for alt dir and boot file
This patch contains two additions to simplenode.runner:

1. Check if vm.args exists in CWD; if so, use it. This makes it
   easier to start multiple concurrent nodes on a single machine
   from one rebar-created release (starting each node from its
   own directory, with its own copy of vm.args and e.g.
   sys.config, log directory, database directory, etc.)

2. Add the targets start_boot <file> and console_boot <file>.
   This is used to select a different boot script. The 'setup'
   application (http://github.com/esl/setup) builds a special boot
   script for installation (all apps loaded but not started,
   making it possible to run install hooks with the full code path
   in place).
2012-07-14 00:26:09 +02:00
joewilliams
d726e598b5 Add support for using -remsh via runner script 2012-04-23 11:08:19 -07:00
Matt Campbell
6f85854414 Improvements to windows node runner script
* Typos and other minor bug fixes
* Add "attach" command (via -remsh)
* Add "upgrade" command to install a hot upgrade package
* Add "upgrade" subcommand to UNIX runner script as well
2012-04-17 19:56:41 +02:00
joewilliams
bdc1a85239 Add foreground as a runner start option 2012-04-10 17:34:00 -07:00
Yurin Slava
29d71e356c simplenode.runner: fix HEART_CMD arguments 2012-04-04 17:08:04 +02:00
Yurin Slava
cd1cc6dbee simplenode.runner: properly quote arguments
bin/<release_name> console -kernel test '[{"a","b"}]' fails, because
when $@ is inserted into CMD [{"a","b"}] is interpreted.
Fix the same issue for 'start' command and quote all arguments.
2012-04-04 17:08:04 +02:00
Steven Gravell
fbd26143bb fix vm.args checks by always using $VMARGS_PATH 2011-09-21 16:09:56 +01:00
joewilliams
cb5056b2e3 Get rid of app.config
app.config has been a long standing erroneous file in rebar. Erlang/OTP
documentation suggests a sys.config file instead. This file is stored in
the releases/VSN directory. This does a few things but most importantly
it ensures your config (contained in the application environment)
survives a hot upgrade. It also has the advantage of allowing the
configuration of the application to be versioned along side the
application code. This patch flips rebar to use sys.config rather than
app.config.

Additionally it makes this flip to vm.args as well, making them
versioned just like sys.config.

This patch also includes runner script changes to support the old
etc/app.config config file location and support for Windows.

Thanks to mokele for the initial work and kick in the pants to make this
finially happen.
2011-09-20 09:44:41 -07:00
Tuncer Ayaz
4e0ab4065f Fix grep portability (Reported-by: Andrew Thompson) 2011-07-14 13:03:54 +02:00
Tuncer Ayaz
12b26fab32 Change shebang lines to /bin/sh 2011-07-13 18:00:52 +02:00
Andrew Thompson
6749bb6ac0 Propagate exit status from nodetool to runner script 2011-07-13 17:59:49 +02:00
Andrew Gopienko
a8de2e91ba fix erlexec parameter 2011-07-05 12:47:25 +07:00
Tuncer Ayaz
3440d8183b Exact match name, cookie (reported-by Pablo Platt) 2011-06-04 10:33:30 +02:00
Alexey Romanov
9da87854f2 Support passing plain arguments to appname start
Currently with default simplenode template, `appname console other_args`
will pass ["console", "other_args"] as plain arguments. But
`appname start other_args` effectively calls `appname console`. This
patch replaces this call with `appname console other_args`.
2011-03-05 14:27:07 +03:00
Alexey Romanov
76a0fdffa7 Remove rejected commit 2011-03-05 14:16:41 +03:00
Alexey Romanov
48d23b90ac Add console_clean to usage message for simplenode. 2011-02-21 12:57:24 +03:00
Alexey Romanov
35a3391e7b Support passing plain arguments to simplenode.
`init:get_plain_arguments()` returns `["console", "more_args"]` when
started with `$APP_NAME console more_args`, but `["console"]` when
started with `$APP_NAME start more_args`. This patch makes `start`
behave like `console` in this respect.
2011-02-21 12:46:57 +03:00
Joseph Wayne Norton
1979da9ee2 Clarify trailing slash for PIPE_DIR
The trailing slash for PIPE_DIR is necessary for
both start and attach operations.
2011-02-15 17:05:38 +01:00
joewilliams
5298e93a18 Add 'generate-upgrade' command
To support OTP release upgrades I have added support for building
upgrade packages. Support for this is included in the
rebar_upgrade module, specifically generate_upgrade/2. It requires
one variable to be set on the command line 'previous_release' which
is the absolute path or relative path from 'rel/' to the previous
release one is upgrading from. Running an upgrade will create the
needed files, including a relup and result in a tarball containing
the upgrade being written to 'rel/'. When done it cleans up the
temporary files systools created.

Usage:
$ rebar generate-upgrade previous_release=/path/to/old/version

This also includes a dummy application that can be used to test
upgrades as well as an example.

Special thanks to Daniel Reverri, Jesper Louis Andersen and
Richard Jones for comments and patches.
2011-01-27 18:37:39 +01:00
Tuncer Ayaz
57e593a319 Fix possible export VAR=VALUE bashism 2010-12-17 12:39:31 +01:00
Tuncer Ayaz
6304c19180 Revert to using awk instead of cut 2010-12-13 13:07:33 +01:00
Tuncer Ayaz
90c5da8033 Extract column 2 on CYGWIN 2010-12-10 17:17:46 +01:00
Tuncer Ayaz
a6063692b2 Use cut instead of awk to extract 1st column 2010-12-10 17:12:50 +01:00
Tuncer Ayaz
5bb78f619e Change vm process search to include non-smp beam 2010-12-10 17:11:01 +01:00
Tuncer Ayaz
6a7e26e12a Disable printing of column headers in ps calls 2010-12-09 17:35:54 +01:00
Tuncer Ayaz
2ff81e5058 Fix portability of ps invocation 2010-12-07 11:55:34 +01:00
Tuncer Ayaz
2e0eab45cb Fix whitespace error and add file local variables 2010-12-07 00:16:14 +01:00
Tuncer Ayaz
9f5d35991f Fix bashism 2010-12-02 20:13:32 +01:00
Ryan Tilder
0df95cc7f2 The trailing slash is important enough to put it here directly since when it's
missing from the PIPE_DIR definition above, the application won't start and
doesn't log any thing to the expected locations.
2010-06-23 14:54:36 -07:00
Dave Smith
7cf7481a68 Fixing issue #3; make sure to properly escape simplenode related files. Patch provided by cstar..thanks! 2010-01-26 15:11:22 -07:00
Dave Smith
ec4e805898 Adding sketch of functionality for creating a reltool node from template 2010-01-08 12:16:57 -07:00