1

I'm attempting to install Openmaint on ubuntu 20.04. I'm almost at the final hurdle and I cant solve this.

At the openmaint database configuration page, I can succesfully connect to the database but then cannot save the database.conf file. This is the error

java.lang.RuntimeException: error saving config to file for namespace = org.cmdbuild.database, caused by: org.apache.commons.configuration.ConfigurationException: Unable to save to file /var/lib/tomcat9/conf/openmaint/database.conf, caused by: java.io.FileNotFoundException: /var/lib/tomcat9/conf/openmaint/database.conf (Read-only file system)

The file is definitely there and it's already configured with correct variables. Tomcat user definitely has write permission. If I delete the file, I only get an error about read-only file system.

Can anyone help please?

Andy
  • 11
  • 1
  • 1
    Why is the filesystem read only? – Michael Hampton Jan 25 '21 at 21:32
  • It's not. I actually managed to solve this by editing the systemd service file for tomcat. Systemd sandboxes file access and it's necessary to place an explicit file path in the service file to allow access. – Andy Jan 26 '21 at 23:04

2 Answers2

0

Solved by editing the systemd service file for tomcat. Systemd sandboxes file access and it's necessary to place an explicit file path in the service file to allow access.

Andy
  • 11
  • 1
0

Thank you so much! I'll leave the change i did to mine tomcat service file:

# Security
User=tomcat
Group=tomcat
PrivateTmp=yes
AmbientCapabilities=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
CacheDirectory=tomcat9
CacheDirectoryMode=750
ProtectSystem=strict
ReadWritePaths=/etc/tomcat9/Catalina/
ReadWritePaths=/var/lib/tomcat9/webapps/
ReadWritePaths=/var/lib/tomcat9/conf/  <---- ADDED
ReadWritePaths=/var/log/tomcat9/
Samabo
  • 1