I'm hosting quite a few servers, for customers and for our own usage. All these servers run Debian Stable. All of the servers are virtual servers. This is for the eventuality that an automatic update will kill one of the machines: Just replace it with the snapshot from last night, and everything will be peachy again.
Now, some of these servers run Tomcat applications. One of these Tomcat applications requires more memory than the default Tomcat allocation. So far, I've preferred to add the memory allocation to /etc/init.d/tomcat7, however, we also had servers where it was in the catalina.sh directly.
After having the problem that a Tomcat stopped today, we found that the memory allocations were suddenly gone. We thought of the configured automatic updates, and indeed, cron-apt log files showed that at the end of april, there was a tomcat update. So we think that this update most probably will have overwritten both files.
Now Tomcat is run under the user tomcat7 (and the group tomcat7 as well). The user has /usr/share/tomcat7 as a home and has no interactive shell to better place the memory allocations in).
Where would be the correct place to export the JAVA_OPTS variable for the tomcat7 user to set the memory while still being update-proof?