The set and add commands modifies or adds an Erlang service, respectively. The simplest form of an add command is without any options in which case all default values (described above) apply. The service name is mandatory.
Every option can be specified without parameters, the default value is then applied. Values to the options are supplied only when the default is not to be used. For example, erlsrv set myservice -prio -arg sets the default priority and removes all arguments.
Service options:
- -st[opaction] [<erlang shell command>]
-
Defines the StopAction, the command given to the Erlang shell when the service is stopped. Default is none.
- -on[fail] [{reboot | restart | restart_always}]
-
The action to take when the Erlang emulator stops unexpectedly. Default is to ignore.
- -m[achine] [<erl-command>]
-
The complete path to the Erlang emulator. Never use the werl program for this. Defaults to the erl.exe in the same directory as erlsrv.exe. When release handling is used, this is to be set to a program similar to start_erl.exe.
- -e[nv] [<variable>[=<value>]] ...
-
Edits the environment block for the service. Every environment variable specified is added to the system environment block. If a variable specified here has the same name as a system-wide environment variable, the specified value overrides the system-wide. Environment variables are added to this list by specifying <variable>=<value> and deleted from the list by specifying <variable> alone. The environment block is automatically sorted. Any number of -env options can be specified in one command. Default is to use the system environment block unmodified (except for two additions, see section Environment below).
- -w[orkdir] [<directory>]
-
The initial working directory of the Erlang emulator. Defaults to the system directory.
- -p[riority] [{low|high|realtime}]
-
The priority of the Erlang emulator. Default to the Windows default priority.
- {-sn[ame] | -n[ame]} [<node-name>]
-
The node name of the Erlang machine. Distribution is mandatory. Defaults to -sname <service name>.
- -d[ebugtype] [{new|reuse|console}]
-
Specifies where shell output is to be sent. Default is that shell output is discarded. To be used only for debugging.
- -ar[gs] [<limited erl arguments>]
-
Extra arguments to the Erlang emulator. Avoid -noinput, -noshell, and -sname/-name. Default is no extra arguments. Remember that the services cookie file is not necessarily the same as the interactive users. The service runs as the local administrator. Specify all arguments together in one string, use double quotes (") to specify an argument string containing spaces, and use quoted quotes (\") to specify a quote within the argument string if necessary.
- -i[nternalservicename] [<internal name>]
-
Only allowed for add. Specifies a Windows-internal service name for the service, which by default is set to something unique (prefixed with the original service name) by erlsrv when adding a new service. Specifying this is a purely cosmethic action and is not recommended if release handling is to be performed. The internal service name cannot be changed once the service is created. The internal name is not to be confused with the ordinary service name, which is the name used to identify a service to erlsrv.
- -c[omment] [<short description>]
-
Specifies a textual comment describing the service. This comment shows up as the service description in the Windows service manager.