summaryrefslogtreecommitdiff
path: root/scripts/rabbitmq-env.bat
Commit message (Collapse)AuthorAgeFilesLines
* Re-enable CTL_ERL_ARGS and dist port settingsLuke Bakken2020-06-301-0/+17
| | | | Fixes #2394
* Support RABBITMQ_HOME paths containing brackets on windowsThomas Speckert2020-06-081-2/+2
| | | | | | | | | | If the environment variable RABBITMQ_HOME contained a path with either '(' or ')' (for example, a path under C:\Program Files (x86)\), then the script would unexpectedly exit with the error '\some\path was unexpected at this time'. This was caused by the parenthesis being interpreted as part of the batch 'if/else'. Adding quotes around the arguments to the SET command fixes the problem.
* Ensure powershell.exe runs without profileLuke Bakken2020-01-031-1/+1
| | | | | | Also ensure non-interactive behavior. Fixes issue where my powershell profile tries to start up ssh-agent.exe
* Move most of shell scripts to Erlang codeJean-Sébastien Pédron2019-12-111-366/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A large part of the rabbitmq-server(8) and CLI scripts, both Bourne-shell and Windows Batch versions, was moved to Erlang code and the RabbitMQ startup procedure was reorganized to be closer to a regular Erlang application. A new application called `rabbitmq_prelaunch` is responsible for: 1. Querying the environment variables to initialize important variables (using the new `rabbit_env` module in rabbitmq-common). 2. Checking the compatibility with the Erlang/OTP runtime. 3. Configuring Erlang distribution. 5. Writing the PID file. The application is started early (i.e. it is started before `rabbit`). The `rabbit` application runs the second half of the prelaunch sequence at the beginning of the application `start()` function. This second phase is responsible for the following steps: 1. Preparing the feature flags registry. 2. Reading and validating the configuration. 3. Configuring logging. 4. Running the various cluster checks. In addition to this prelaunch sequence, the `rabbit` application start procedure ends with a "postlaunch" sequence which takes care of starting enabled plugins. Thanks to this, RabbitMQ can be started with `application:start(rabbit)` as any other Erlang application. The only caveats are: * Mnesia must be stopped at the time `rabbit_prelaunch` is started, and must remain stopped when `rabbit` is started, to allow the Erlang distribution setup and cluster checks. `rabbit` takes care of starting Mnesia. * Likewise for Ra, because it relies on the `ra` application environment to be configured. Transitioning from scripts to Erlang code has the following benefits: * RabbitMQ start behavior should be identical between Unix and Windows. Also, features should be on par now. For instance, RabbitMQ now writes a PID file on Windows, like it always did on Unix-based systems. * The difference between published packages and a development environment are greatly reduced. In fact, we removed all the "if this is a dev working copy, then ..." blocks. As part of that, the `rabbit` application is now treated like its plugins: it is packaged as an `.ez` archive and written to the `plugins` directory (even though it is not technically a plugin). Also in a development copy, the CLI is copied to the top-level project. So when testing a plugin for instance, the CLI to use is `sbin/rabbitmqctl` in the current directory, not the master copy in `rabbit/scripts`. * As a consequence of the previous two points, maintaining and testing on Windows is now made easy. It should even be possible to setup CI on Windows. * There are less issues with paths containing non-US-ASCII characters, which can happen on Windows because RabbitMQ stores its data in user directories by default. This process brings at least one more benefit: we now have early logging during this prelaunch phase, which eases diagnostics and debugging. There are also behavior changes: * The new format configuration files used to be converted to an Erlang-term-based file by the Cuttlefish CLI. To do that, configuration schemas were copied to a temporary directory and the generated configuration file was written to RabbitMQ data directory. Now, Cuttlefish is used as a library: everything happens in memory. No schemas are copied, no generated configuration is written to disk. * The PID file is removed when the Erlang VM exits. * The `rabbit_config` module was trimmed significantly because most of the configuration handling is done in `rabbit_prelaunch_conf` now. * The RabbitMQ nodename does not appear on the command line, therefore it is missing from ps(1) and top(1) output. * The `rabbit:start()` function will probably behave differently in some ways because it defers everything to the Erlang application controller (instead of reimplementing it).
* scripts/rabbitmq-env.bat: Replace `where.exe` by a PowerShell commandJean-Sébastien Pédron2019-12-051-1/+1
| | | | | | | | | On Amazon AWS EC2 Windows Server 2019 image, `where.exe` is unavailable. Fortunately, we can achieve the same thing with a plain PowerShell oneliner which should work everywhere. PowerShell is provided with Windows since Windows 7 (2009) according to Wikipedia.
* Set ERL_MAX_ variables in rabbitmq-env.bat so they will be available in ↵Luke Bakken2019-09-231-0/+11
| | | | rabbitmq-server.bat and rabbitmq-service.bat
* rabbitmq-env.bat: Quote the expansion of %1 in `filter_path`Jean-Sébastien Pédron2019-08-281-2/+2
| | | | | | | | | | | | | | | Otherwise, paths containing parenthesis such as `C:/Program Files (x86)/...` get mis-interpreted and the function fails. In my testing, the error was: \Elixir\lib\elixir was unexpected ... based on the fact that Elixir is installed in `C:\Program Files (x86)\Elixir`. While here, explicitely calls `rabbitmqctl.bat`, not `rabbitmqctl`. The latter might be available and picked in a Git clone.
* Refer to rabbitmqctl.bat using .bat extension on win32Luke Bakken2019-08-281-3/+3
|
* Set RABBITMQ_FEATURE_FLAGS_FILE_source=environment correctly on win32Luke Bakken2019-08-281-0/+1
|
* Remove short name formattingLuke Bakken2019-08-131-67/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix missing quote in mkdir argument to handle directories with spaces properly on Windows Ensure paths are double-quoted when necessary Ensure all win32 paths have forward slashes. Use more typical escaping of double quotes Do not convert to a binary as that has bad effects when the msg store dir base has extended ASCII characters, as when setting RABBITMQ_BASE to C:/ProgramData/Tést Directory (frazzle)/RabbitMQ Add "t" modifier to format strings for values that may be unicode Remove use of unquote as it only works when the second arg is not double-quoted when called, but that version fails on paths with spaces. De-quote ALL THE THINGS Update rabbitmq-components.mk (cherry picked from commit a515903662566e0fc158918bc1c42fc1a0a8384a) Log file management suite: adapt to Lager 3.8 I observed no functional changes around log rotation. These assertions depend on internal file management aspects of Lager, so let's update them and see. References #2068, #2059. (cherry picked from commit d6e7c3841c5f01933e9182da1701bd2ac74eb1ff) (cherry picked from commit 6a9eb18ca1f1f3d5166e923f54f4ed349a1b95a2) Replace dequote function with replace syntax, which works with unicode characters
* New "Feature flags" subsystem to ease upgrades with breaking changesJean-Sébastien Pédron2019-02-011-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The goal is that each breaking change is implemented in way that a RabbitMQ node having that change can work in the same cluster as other nodes which do not know about it. The feature flags are here to indicate which breaking changes are "available" (i.e. the node knows about the breaking changes, but it still runs in a backward-compatible mode) and which ones are currently activated (i.e. the node uses the new code and older node can not be part of the cluster anymore). Enabling a feature flag (i.e. activating a breaking change) is a manual operation where the user validates that the cluster is ready to switch to the new world after the breaking change. Therefore the subsystem ensures RabbitMQ nodes can talk to each other even if they don't have the same code as long as they agree on using the common subset, and prevents RabbitMQ nodes from talking to each other once the new code is being used and one node does not understand it. The consequence is that if a breaking change is implemented using this new subsystem, a cluster can be upgraded one node at a time instead of shutting down the entire cluster to upgrade. Of course, the ability to implement a breaking change in such a way entirely depends on the nature of that change. This new subsystem does not guarantee that a cluster shutdown will never be required again. [#159298729]
* rabbitmq-env.bat: Define `$RABBITMQ_QUORUM_DIR`Jean-Sébastien Pédron2018-10-311-0/+9
| | | | | | | | | | | | | | | | | | | The variable was used in `rabbitmq-server.bat` & friends but not defined, leading to a broken RabbitMQ on Windows. Here is the crash logged early in RabbitMQ startup: 2018-10-31 10:34:23.672 [error] <0.42.0> application_controller: unterminated string starting with "\\=/RABBITMQ_SERV": "\\=/RABBITMQ_SERVER_START_ARGSRABBITMQ_DIST_ARGSTARVAR 2018-10-31 10:34:23.672 [error] <0.7.0> Error description: init:do_boot/3 line 819 init:start_em/1 line 1111 rabbit:start_it/1 line 460 rabbit:broker_start/0 line 336 rabbit:start_apps/2 line 518 app_utils:load_applications/1 line 41 app_utils:load_applications/2 line 110 throw:{error,{bad_environment_value,"\"\\\\=/RABBITMQ_SERVER_START_ARGSRABBITMQ_DIST_ARGSTARVAR"}}
* Add extension to default advanced config file name on windowsDaniil Fedotov2018-08-141-1/+1
|
* Set two environment variables in the same manner as on Unix systemsLuke Bakken2018-08-081-3/+10
| | | | | | SERVER_START_ARGS and SERVER_ADDITIONAL_ERL_ARGS from the rabbitmq-env-conf.bat file need to be honored here. [159602360]
* Ensure SERVER_ERL_ARGS are set on WindowsLuke Bakken2018-02-231-1/+1
|
* Variables in rabbitmq-env.conf and rabbitmq-env-conf.bat do not begin with ↵Luke Bakken2018-02-231-23/+29
| | | | RABBITMQ_, adjust Unix and Windows files accordingly
* Ensure RABBITMQ_USE_LONGNAME is set as that is what rabbitmqctl escript ↵Luke Bakken2018-02-201-3/+5
| | | | reads from the env
* Fix batch file issues with env variablesLuke Bakken2018-02-121-7/+6
| | | | Fixes #1508
* Set defaultsLuke Bakken2018-01-301-0/+6
|
* Add DIST_PORT settings to Windows batch filesLuke Bakken2018-01-301-1/+11
| | | | (cherry picked from commit 0cd2fbdda7e9dea7cd651020478d5981e714ad44)
* Merge branch 'stable'Daniil Fedotov2017-09-121-1/+0
|\
| * Fix typo in RABBITMQ_LOGS environment setupDaniil Fedotov2017-09-121-2/+2
| | | | | | | | | | | | | | | | The typo caused `-` configuration to be treated as a file name, not tty logging, like it should be. Fixes #1348 [#150808117]
* | Merge pull request #1322 from rabbitmq/rabbitmq-server-1255Daniil Fedotov2017-08-081-0/+5
|\ \ | | | | | | Set ERL_CRASH_DUMP location to rabbitmq log directory
| * | Set ERL_CRASH_DUMP location to rabbitmq log directoryDaniil Fedotov2017-08-031-0/+5
| | |
* | | Add upgrade log sink to windows scripts.Daniil Fedotov2017-08-041-1/+5
|/ / | | | | | | | | Upgrade sink is used for logging queue data upgrades. It should be configured in the start arguments of rabbitmq server.
* | Merge branch 'stable'Michael Klishin2017-07-281-2/+2
|\ \ | |/
| * Bump DEFAULT_DISTRIBUTION_BUFFER_SIZE to 128 MBMichael Klishin2017-07-271-2/+2
| | | | | | | | | | | | | | | | | | | | After 24 hours of testing we haven't observed any anomalities or regressions. With this change multicast (mirroring) processes should be suspended less frequently, resulting in less variable throughput for mirroring (with link throughput of 1 GBit/s or greater). Closes #1306. [#149220393]
* | Revert "Revert "Using square brackets could cause an error""Michael Klishin2017-06-171-0/+25
| | | | | | | | | | | | This reverts commit 836ae267e6a959a0243de38ce0ae4200f935b446. This revert was only necessary in stable.
* | Merge branch 'stable'Michael Klishin2017-06-171-25/+0
|\ \ | |/
| * Manually re-apply #1269Michael Klishin2017-06-171-1/+1
| |
| * Revert "Using square brackets could cause an error"Michael Klishin2017-06-171-26/+1
| | | | | | | | | | | | This reverts commit ce85ac7bb66203b19630317cc52fec81f3299cda. This includes some master-specific bits.
| * Using square brackets could cause an errorLuke Bakken2017-06-171-1/+26
| | | | | | | | | | Conflicts: scripts/rabbitmq-env.bat
| * Ensure ERL_LIBS starts with a valid pathEris Belew2017-05-021-1/+6
| |
* | Using square brackets could cause an errorLuke Bakken2017-06-161-2/+1
| |
* | Ensure ERL_LIBS starts with a valid pathEris Belew2017-04-301-1/+6
| |
* | Revert "Restore "Do not expand plugins anymore""rabbitmq_v3_7_0_milestone13Jean-Sébastien Pédron2017-02-221-0/+14
| | | | | | | | | | | | | | | | | | Loading a native library (eg. a NIF) from an .ez archive in unsupported by Erlang and the team decided to revert this change again. This reverts commit 0151abf37710dfc421523f9235514a438270e032. [#136622317]
* | Restore "Do not expand plugins anymore"Jean-Sébastien Pédron2017-02-201-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support for reading static files from Erlang .ez archives was added to Cowboy and various RabbitMQ plugins were updated to take advantage of the new API. So this commit restores the following commits: 7069f3b40daeb5095077bdac19f3837978bc2665 76a8c66c8092cc1c37bb4aa90a0a3d18b27f7d9d 2044cb1eed02e67c4ea749a807694c55ed574756 bc64ac16774aeb403cba87f7e48ad70329dd8b3b d616cc922dbd73eca7700c50f09e33e6b578b0d9 They were reverted in 72f7c8e70028209ee1c58074c087b4d0cb901e6c because Cowboy didn't have this support at the time. Signed-off-by: Gerhard Lazu <gerhard@rabbitmq.com> [#118562759, #136622317]
* | Revert "Do not expand plugins anymore"Jean-Sébastien Pédron2016-12-231-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This broke the management plugin: Cowboy assumes direct file access to resources in the `priv` directory. This reverts commits: 7069f3b40daeb5095077bdac19f3837978bc2665 76a8c66c8092cc1c37bb4aa90a0a3d18b27f7d9d 2044cb1eed02e67c4ea749a807694c55ed574756 bc64ac16774aeb403cba87f7e48ad70329dd8b3b d616cc922dbd73eca7700c50f09e33e6b578b0d9 [#118562759]
* | Do not set `plugins_expand_dir` from $RABBITMQ_PLUGINS_EXPAND_DIRJean-Sébastien Pédron2016-12-191-14/+0
| | | | | | | | | | | | | | | | The environment variable is now ignored. Signed-off-by: Gerhard Lazu <gerhard@rabbitmq.com> [#118562759]
* | Merge branch 'stable'Michael Klishin2016-09-121-1/+9
|\ \ | |/
| * Make VM distribution buffer size easier to configure, bump default to 32MBMichael Klishin2016-09-121-1/+9
| | | | | | | | Fixes #908.
* | Merge branch 'stable'Diana Corbacho2016-07-291-1/+1
|\ \ | |/
| * Bump default VM atom table size to 5MMichael Klishin2016-07-281-1/+1
| | | | | | | | | | | | See #895 for background and reasoning. Fixes #895.
* | Merge local `node_health_check` into `master`Alexey Lebedeff2016-07-141-7/+12
|\ \ | |/
| * use the default_bind bind typeKarl Nilsson2016-07-141-1/+1
| |
| * remove stale commentKarl Nilsson2016-07-141-5/+1
| |
| * Set scheduler bindings in rabbitmq-env.bat for windowsKarl Nilsson2016-07-141-5/+14
| | | | | | | | rename SCHEDULING to SCHEDULER in line with erlang documentation
* | Merge pull request #882 from rabbitmq/rabbitmq-server-859Michael Klishin2016-07-121-2/+2
|\ \ | | | | | | Handle paths with spaces on disk volumes with 8.3 name creation disabled
| * | Handle paths with spaces on disk volumes with 8.3 name creation disabledkjnilsson2016-07-121-2/+2
| |/
* | Unquoting and extension trimming in windows scriptsDaniil Fedotov2016-04-051-1/+2
| |