I wrote a program that chroots for security reasons. After initialisation it doesn't need to open any more files or devices, so chrooting to an empty directory would work just fine. On FreeBSD and OpenBSD I have the /var/empty directory for exactly this reason. IIRC it's even protected with the system immutable flag to prevent accidental writes.

On my CentOS 7 machine I have a /var/empty, but that has an (empty) sshd directory in it (?) On Ubuntu 15.04 I don't have a /var/empty at all.

Do I need to create a useless and empty /var/run/myprogram directory? Or is there some equivalent?

__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.

My Slackware 14.0 has a /var/empty, with nothing in it. Perhaps none of the installed programs are configured to use it? You could create one if you need it. For chroot-ing I've also created /var/jails with subdirectories for dnscrypt-proxy, mail (sendmail) and named.

The thing with chroot-ing it to /var/tmp/ (or /tmp/) is that you don't know which files may be there, and that the chrooting program may accidentally expose information present in those directories, or even worse allow modification of those files!

With /var/empty/, I don't need to worry about any of that.

At any rate, my eventual solution was to create an empty /var/program_name/ directory. I later added some support for file caching, so I had to do that in the long run anyway :-)

__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.