Building a custom BSD version that supports only Java
Question
What is the process I should use to accomplish the goal of building a version of FreeBSD that is capable of running a Java VM but not capable of any other functionality including, but not limited to:
- Running any process other than the Java VM
- Disabling any/all shell access
- When the Java VM exits, the OS shuts down
I need to support JDK 1.6, so approaches such as SANOS do not work.
Solution
- Configure the init script to run the JVM after user authentication.
- Remove the line in one of the init scripts that spawns the shell, typically after user authentication.
- There should be a listener for Java processes, if it doesn't find any, fire "init 0" or "shutdown" or "poweroff"
OTHER TIPS
The Sanos Operating System Kernel is a project doing exactly that, except that it uses a Windows JVM instead of a FreeBSD JVM. Only the functionality needed by the JVM is provided by Sanos, nothing else.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow