Samba and cups are examples of applications that will not work unless they find certain directories, eg /var/locks, that can be empty as long as they exist.
I've been using "touch /var/locks/placeholder" to be able to add the directory to my backup (but avoid saving all of the files that might created in the directory) and to indicate in a *.dsl extension that this directory is required.
Quote
I've been using "touch /var/locks/placeholder"
I'd say this is probably the best solution overall, of those that I've heard. I use something similar to this in one or two extensions that want certain personal configuration files in the user's home directory. Rather than include these files in user.tar.gz, they are installed to the application directory, and the application is run from a wrapper script. The wrapper checks for the existence of the needed files/directories, and copies/creates them only if necessary before running the application. This method allows you to store an original file that can be used in the event of a configuration mishap, it allows the same behavior if you happen to run the program as a different user, and allows you to indiscriminately delete all directories in a package without causing application failure. The drawback, of course, is that it requires the use of a wrapper script.
Using wrappers is a fairly common practice even outside of DSL, though. Apps such as Firefox that are intended to be essentially self-contained will often use wrappers to prepare the environment to run the app, just as we do for many uci and tar.gz mydsl packages.
original here.