Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

We have a machine that runs VMware Server. It constantly creates a file called not_configured in /etc/vmware/, which somehow makes our virtual machines not able to be started.

I wondered if there was any reliable way to prevent this file from ever being created in the first place.

The file itself doesn't contain anything, so I don't want to create and write-protect it. It shouldn't be there in the first place.

share|improve this question
2  
I know this sounds like an X/Y problem and I should rather look into solving the VMware Server issue, but the people on SF obviously couldn't help either and this is more of a general question I've had in mind. –  slhck Nov 27 '11 at 10:22
    
Hmm, fix the source, not the symptom. –  warl0ck Oct 30 '12 at 8:53
    
@warl0ck As I mentioned, this is easier said than done, and I'm very well aware of the fact that this is asking for fixing the symptoms. –  slhck Oct 30 '12 at 9:05
    
that's true, but I mean, submit a bug report to them... –  warl0ck Oct 30 '12 at 9:25
add comment

5 Answers

You can make the directory read-only in some way: with unix permissions (chmod a-w), or with more stringent measures such as mounting a read-only filesystem at that spot. I don't think Linux offers a built-in way of preventing a single file from being created, without making the directory read-only as a whole. There is of course the multipurpose tool FUSE but I don't know of an existing FUSE filesystem that lets you create a file blacklist in this way.

You can try creating a dangling symbolic link, especially one pointing to a nonexistent file in a read-only directory. Depending on how the one program checks for the file existence and the other program tries to create the file, this may or may not work.

I'd recommend figuring out what program is creating that file and shutting it off. See Determine which process is creating a file

share|improve this answer
    
I could be lucky and the directory does not need to be written to anyway. My fear is that the VMware service itself creates that file – but that's not really important here –, so we shall see if the symlink works out. Interesting approach nonetheless. –  slhck Nov 27 '11 at 22:48
    
+1 for FUSE. See also unix.stackexchange.com/questions/9332/…. –  Mechanical snail Sep 19 '12 at 17:51
add comment

In short, if you have any Vmware products that you haven't uninstalled cleanly it would create such a problem that you describe.
Follow the instructions at this link, I have had success with them:

I have had the same problem, and after I have followed the above guide it solved.

share|improve this answer
2  
You should probably post this on the question on Server Fault, and delete it here - it's not really the answer to this question. –  slhck Nov 27 '11 at 13:18
    
It may not be the answer the person is looking for, but it's definitely the one that solves the cause rather than ignoring it. Upvote for reply. –  laebshade Nov 28 '11 at 0:18
    
@laeb Probably, but it does not belong here at all. –  slhck Nov 28 '11 at 7:04
add comment

The only standard way to do this is to remove the write permission from the directory. This will, of course, prevent anything from creating files in this directory.

share|improve this answer
add comment

Not sure about VMWare Server flexibility in that area but assuming the /etc/vmware directory is allowed to be located on a remote file system shared under NFS or CIFS, that would be an easy task by using an OS supporting DTrace at the file server side (Solaris, OpenIndiana, FreeBSD, MacOS/X, ...).

A simple so called destructive script could force or simulate a failure on any attempt to open the not_configured file.

share|improve this answer
    
Could I even do that from the localhost? I don't think we have the capabilities to set up another machine for that. –  slhck Nov 27 '11 at 22:45
    
I'm afraid not. VMWare server seems to only run on Windows or Linux. Windows doesn't support DTrace and Linux ports aren't fully operational, as far as I know. –  jlliagre Nov 28 '11 at 6:24
add comment

I actually already do this.. you can make a listener in "watcher" or "incron" (I would use watcher, it's recursive) use that create trigger, write a script, wait 5 seconds (this is because all sorts of read only /tmp files can be "created" when a file is "created" - which you test for locked/read only and re pause if necessary) then in your script scan/move/delete any files in that folder you dislike..

NB: ensure your script is being intelligent for locked file/retry paradigm..

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.