Init scripts on lucid have a pid file in /run which doesn't exist

Bug #1072641 reported by Rowan Wookey on 2012-10-29
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Nginx
High
Michael Lustfield

Bug Description

In nginx 1.2.4 from https://launchpad.net/~nginx/+archive/stable/ the lucid build is attempting to use the pid file in /run

start() {
  test_nginx_config
  # Check if the ULIMIT is set in /etc/default/nginx
  if [ -n "$ULIMIT" ]; then
   # Set the ulimits
   ulimit $ULIMIT
  fi
  start-stop-daemon --start --quiet --pidfile /run/$NAME.pid \
   --retry 5 --exec $DAEMON -- $DAEMON_OPTS || true
}

/run doesn't exist on lucid it should be reverted back to /var/run currently this build can't be restarted without killing nginx and the status check fails.

Changed in nginx:
status: New → Incomplete
status: Incomplete → In Progress
assignee: nobody → Michael Lustfield (michaellustfield)
importance: Undecided → High

/run has been added to nginx-common.dirs so whether or not /run is part of the normal file system layout, it will be sure to exist. I can understand that this might break some policies for lucid, but lucid is the only release that currently lacks /run. I don't plan to maintain yet another "special case". Especially not one that I can solve with this simple solution.

This resolution has been uploaded and published in the ppa.

Changed in nginx:
status: In Progress → Fix Released
Rowan Wookey (rwky) wrote :

It's still broken since the pid file never gets put in /run the pid file is set to
pid /var/run/nginx.pid

You could either update nginx.conf to use /run/nginx.pid or symlink /run to /var/run/ in lucid.

Are you using the latest PPA? Did you maybe make some modifications to
the init script before upgrading which prevented the new script from
being installed?

On Tue, Oct 30, 2012 at 9:05 AM, Rowan <email address hidden> wrote:
> It's still broken since the pid file never gets put in /run the pid file is set to
> pid /var/run/nginx.pid
>
> You could either update nginx.conf to use /run/nginx.pid or symlink /run
> to /var/run/ in lucid.
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/1072641
>
> Title:
> Init scripts on lucid have a pid file in /run which doesn't exist
>
> Status in Nginx:
> Fix Released
>
> Bug description:
> In nginx 1.2.4 from https://launchpad.net/~nginx/+archive/stable/ the
> lucid build is attempting to use the pid file in /run
>
>
> start() {
> test_nginx_config
> # Check if the ULIMIT is set in /etc/default/nginx
> if [ -n "$ULIMIT" ]; then
> # Set the ulimits
> ulimit $ULIMIT
> fi
> start-stop-daemon --start --quiet --pidfile /run/$NAME.pid \
> --retry 5 --exec $DAEMON -- $DAEMON_OPTS || true
> }
>
> /run doesn't exist on lucid it should be reverted back to /var/run
> currently this build can't be restarted without killing nginx and the
> status check fails.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/nginx/+bug/1072641/+subscriptions

Rowan Wookey (rwky) wrote :

I did a fresh install on lucid.

/etc/nginx/nginx.conf sets the pid file to /var/run/nginx.pid hence the init script can't get the pid from /run on lucid.

This is what I get for being too tired and working on things. I'll get this corrected as soon as I get home.

Changed in nginx:
status: Fix Released → In Progress

This should be resolved now... Could you please check?

Rowan Wookey (rwky) wrote :

Yep that works, I tested both a clean install and an upgrade. Thank you :)

Rowan Wookey (rwky) wrote :

Scratch that now logrotate is broken, the logrotate file needs to be checking /var/run/nginx.pid

/etc/cron.daily/logrotate:
cat: /run/nginx.pid: No such file or directory
kill: 2: Usage: kill [-s sigspec | -signum | -sigspec] [pid | job]... or
kill -l [exitstatus]
error: error running shared postrotate script for '/var/log/nginx/*.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1

Thomas Ward (teward) wrote :

I've uploaded a fix to the PPA that should fix the logrotate issue. Can you please check?

Rowan Wookey (rwky) wrote :

Yep that fixed, everything looks ok now.

Thomas Ward (teward) wrote :

Okay, marking as Fix Released, then.

Changed in nginx:
status: In Progress → Fix Released

Thomas, I'm still having this issue. What fix did you upload?

Thomas Ward (teward) wrote :

Michael, we only uploaded a fix to the PPA for nginx. Make sure you're using that. And of course, this could have been undone by a later update to the PPA. However, its usually customary to file a separate bug after one bug's been released/closed, can you do me a favor and tell me the package version(s) you're running, and whether or not they're from the PPA or not?

Thomas Ward (teward) wrote :

I've confirmed a regression exists that caused this bug to resurface. Please see this bug: https://bugs.launchpad.net/nginx/+bug/1131394

i'm running nginx version 1.2.7

Thomas Ward (teward) wrote :

The regression has been fixed in Bug 1131394.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers