DaemonForums  

Go Back   DaemonForums > Other Operating Systems > Other BSD and UNIX/UNIX-like

Other BSD and UNIX/UNIX-like Any other flavour of BSD or UNIX that does not have a section of its own.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 21st April 2016
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Bristol, UK
Posts: 2,169
Default /var/empty on Linux

Does anyone know what the equivalent of /var/empty is on Linux?

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.
Reply With Quote
  #2   (View Single Post)  
Old 21st April 2016
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 722
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
a strange package problem .. bash @name exists but plist empty daemonfowl OpenBSD Packages and Ports 25 11th April 2012 02:06 AM
Why does pkg_add sometimes report "packages is empty" ? sw2wolf OpenBSD Packages and Ports 2 22nd March 2012 12:51 AM
How do we verify if directory is empty? sharris FreeBSD General 8 4th January 2012 03:37 PM
Snapshot Packages Empty - part of commit? IronForge OpenBSD Packages and Ports 3 16th September 2011 10:32 PM
Other Another Linux Security Breach (this time at Linux Foundation) vermaden News 0 12th September 2011 07:00 AM


All times are GMT. The time now is 05:09 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick