Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

2 Answers 2

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
add comment

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
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.