I'm trying to run multiple jvms (including tomcat) under different users on one linux box. I'm not seeing too many issues, but in catalina.out I keep seeing this:
May 30, 2014 1:16:16 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 7626 ms
May 30, 2014 1:16:37 PM java.util.prefs.FileSystemPreferences$2 run
WARNING: Could not create system preferences directory. System preferences are unusable.
May 30, 2014 1:16:55 PM java.util.prefs.FileSystemPreferences checkLockFile0ErrorCode
WARNING: Could not lock System prefs. Unix error code -158097957.
May 30, 2014 1:16:55 PM java.util.prefs.FileSystemPreferences syncWorld
WARNING: Couldn't flush system prefs: java.util.prefs.BackingStoreException: Couldn't get file lock.
I did some digging/reading and deduced the following:
An administrator with root access must create the system preferences directory /etc/.java/.systemPrefs with drwxr-xr-x access.
Java's looking for /etc/.java/.systemPrefs/.system.lock
and /etc/.java/.systemPrefs/.systemRootModFile
Manually creating the above files (use "touch" to create empty files) and their containing directories should fix. Rights to the files should be 544
, rights to their directories should be 755
, owner and group are root for all.
But
I am not root, getting someone to run root is expensive and I have multiple users running jvms, does that mean i have to create those files and set up permissions just so that all users have access with those privileges?
Has anyone ever run into this issue and if they have is there a simpler solution i am missing?
Set these settings per user:
Without creating the directories, some Java virtual machines default to
/etc/
.See also: Java - Setting Preferences backingstore directory
My thinking is that even though you have different users, the JVM still reads tomcat as one user since it's the same process. Perhaps what you need is a user management mechanism? Log in and log out
I fixed this by setting the permissions of my Bash program executing to 755