Skip to content

Commit

Permalink
Expose java configuration directories in the fakemachine
Browse files Browse the repository at this point in the history
openjdk, at least on debian, places its default profiles and security
configuration in /etc/java-<version>-openjdk. For some functionality of
java those files are required so add them into the fakemachine.

Note this adds all /etc/java* directories for robustness so we don't
regress if the path pattern somewhat changes.

Signed-off-by: Sjoerd Simons <[email protected]>
  • Loading branch information
sjoerdsimons committed Jan 10, 2024
1 parent 37e2eb0 commit 9c47059
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,15 @@ func NewMachineWithBackend(backendName string) (*Machine, error) {
m.AddVolume("/etc/ssl")
}

// Mounts for java VM configuration, especialy security policies
matches, _ := filepath.Glob("/etc/java*")
for _, path := range matches {
stat, err := os.Stat(path)
if err == nil && stat.IsDir() {
m.AddVolume(path)
}
}

// Dbus configuration
if _, err := os.Stat("/etc/dbus-1"); err == nil {
m.AddVolume("/etc/dbus-1")
Expand Down

0 comments on commit 9c47059

Please sign in to comment.