Why I ♥ Open Source

This post is from 2013, so some details may be out of date.

A couple of days ago I posted something stating that the Nginx init.d startup script used on many Debian & Ubuntu systems had a bug in it where if you add a comment with “pid” in it, the startup script would be unable to find the correct PID file of Nginx (which is critical for the script to terminate the Nginx process correctly).

So I created a pull request on GitHub on the Dotdeb repository (which many Debian users use as it’s always a bit newer than the main Debian stable repository) for the fix and not even an hour later the maintainer of Dotdeb, Guillaume Plessis, accepted it. As I follow Dotdeb on Twitter, I noticed they did another update (Nginx 1.4.0), so I decided to update one of my main servers. Then I noticed this…

Configuration file `/etc/init.d/nginx'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** nginx (Y/I/N/O/D/Z) [default=N] ?

I thought to myself wondering what was changed… so I looked at the file, and nevertheless I saw this:

#!/bin/sh

### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/nginx
NAME=nginx
DESC=nginx

...

PID=$(awk -F'[ ;]' '$1 !~ /^#/ && /pid/ {print $2}' /etc/nginx/nginx.conf)
if [ -z "$PID" ]
then
PID=/var/run/nginx.pid
fi

Now that is why I LOVE open source! Who knows how long until this tiny change will make it into the main Debian repository and maybe even in Ubuntu… :P

Find me elsewhere