wildfly/wildfly-core — pull request #175 by jamezp (2014-09-13 00:22:43+00:00)
Title: [WFCORE-94] Facitilitate usage of -secmgr flag in startup scripts and propagate through domain

Replacement for #169 @kabir needs to approve this and anyone with interest/knowledge of the security manager should have a look. Also a good look at the scripts could be useful. I tested only on Fedora 20 and Windows 7.

## General
Passing `-secmgr` or `-Djava.security.manager` to any of the startup scripts will activate the security manager by passing `-secmgr` to jboss-modules. Optionally in the `*.conf[.bat]` files you can set the `SECMGR=true` environment variable to turn on the security manager too. Finally passing `-Djava.security.manager=com.example.CustomSecurityManager` will turn on the security manager, but will not initialize it with the `com.example.CustomSecurityManager`.

## Linux
`JAVA_OPTS` and `PROCESS_CONTROLLER_JAVA_OPTS` will be processed and rewritten if `-Djava.security.manager[=class]` is found. The security manager will be turned on, but again if a custom security manager is defined the value is ignored. This essentially translates `-Djava.security.manager` to `-secmgr`.

## Windows
`JAVA_OPTS` and `PROCESS_CONTROLLER_JAVA_OPTS` will be processed looking for `-Djava.security.manager[=class]`. In this case if it's found the script will fail with an error message indicating the `SECMGR=true` environment variable should be used. I could not find a way to reliably rewrite the `JAVA_OPTS`. The other option would be to just ignore it, pass the `-Djava.security.manager` as was done before.

If anyone with better Windows scripting skills than me wants to look, please feel free :+1: