Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having a service (Sonatype's Nexus) which failed to init since it PID folder (/var/run/nexus) was deleted.

Any idea how that folder can be deleted? The nexus service, when gracefully stopped, does not remove the folder but only the pid file.

I'm using Ubuntu.

share|improve this question
up vote 1 down vote accepted

If you type:

$ df -hT | grep /var/run
none         tmpfs    3.9G   84K  3.9G   1% /var/run

you can see it is a tmpfs (temporary file system). This means all its contents will be removed after reboot.

To solve you problem, you can create the needed directory in the startup script, or create the pid file directly under /var/run.

share|improve this answer

Let me guess, this is the first reboot after you installed the service? If so, the PID directory didn't get deleted, per se -- rather, the directory that the PID directory lives in is a RAM disk, which gets unceremoniously wiped at each boot.

An Ubuntu-compliant init script is required to create any directory under /var/run that it needs in order to operate. Since, presumably, the init script for the service you want to run isn't doing that, you'll need to modify it yourself. It's (usually) as simple as adding mkdir /var/run/nexus to the top of the init script.

share|improve this answer

Your Answer


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.