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

Bug #1072641 reported by Rowan Wookey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Nginx
Fix Released
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
Revision history for this message
Michael Lustfield (michaellustfield) wrote :

/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
Revision history for this message
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.

Revision history for this message
Michael Lustfield (michaellustfield) wrote : Re: [Bug 1072641] Re: Init scripts on lucid have a pid file in /run which doesn't exist

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

Revision history for this message
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.

Revision history for this message
Michael Lustfield (michaellustfield) wrote :

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
Revision history for this message
Michael Lustfield (michaellustfield) wrote :

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

Revision history for this message
Rowan Wookey (rwky) wrote :

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

Revision history for this message
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

Revision history for this message
Thomas Ward (teward) wrote :

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

Revision history for this message
Rowan Wookey (rwky) wrote :

Yep that fixed, everything looks ok now.

Revision history for this message
Thomas Ward (teward) wrote :

Okay, marking as Fix Released, then.

Changed in nginx:
status: In Progress → Fix Released
Revision history for this message
Michael Heuberger (michael.heuberger) wrote :

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

Revision history for this message
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?

Revision history for this message
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

Revision history for this message
Michael Heuberger (michael.heuberger) wrote :

i'm running nginx version 1.2.7

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.