I have inherited a Java / Tomcat stack, running on Ubuntu. It has crashed and I am trying to restart it. The program code seems to be using a config file which I have found on the file system.The issue is I found this note in the handover:the app code is in /var/lib/tomcat6/webapps/PCRTilerconfig and helping files are in /var/cache/tomcat6/work/PCRTiler/work/PCRTiler is a symlink for /var/cache/tomcat6/work/PCRTilerThere is no tomcat6 directory under /var/cache. I also cannot find a symbolic link in / called work. Would the link be destroyed if the underlying directory was removed?Is it standard practice to keep program-specific code in /var/cache, and is this directory in any way permanent? EDITFound an install.sh script that seems to be copying to /var/cache and /var/lib#!/bin/bashrm -rf /var/lib/tomcat6/webapps/PCRTilerrm -rf /var/cache/tomcat6/work/PCRTilermkdir -p /var/lib/tomcat6/webapps/PCRTilermkdir -p /var/cache/tomcat6/work/PCRTilercp -r * /var/lib/tomcat6/webapps/PCRTilercp -r /var/lib/tomcat6/webapps/PCRTiler/cache_skel/* /var/cache/tomcat6/work/PCRTilerchown -R tomcat:tomcat /var/cache/tomcat6/work/PCRTilerchown -R root:root /var/lib/tomcat6/webapps/PCRTilerservice tomcat6 restart
Why store program code in /var/cache?
filesystems;symlink;tomcat
According to the guidelines of the Linux Filesystem Hierarchy:/var/cacheIs intended for cached data from applications. Such data is  locally generated as a result of time-consuming I/O or calculation.  This data can generally be regenerated or be restored. Unlike  /var/spool, files here can be deleted without data loss. This data  remains valid between invocations of the application and rebooting of  the system. The existence of a separate directory for cached data  allows system administrators to set different disk and backup policies  from other directories in /var.I'd presume that last sentence might provide a justification, although in this case it sounds contra to the primary description: Such data is locally generated as a result of time-consuming I/O or calculation. This may just have been an eccentric or ignorant choice by an individual.  It is not unusual to create application specific directories in /var/cache and they are persistent, but I think it is a bit unusual to place source or configuration files there.  A more normative place, if you want an out-of-path directory tree for application code, would be /opt.However, it is normal for webservers such as apache to keep some modular application code in a custom subdirectory of /var, so that is a precedent.   