It seems that what is happening is that squid forks twice to demonize,
but the "middle" process "forgets" to exit, and keeps hanging around.

# ps auxww | fgrep squid
root      2593  0.0  0.1  31792  4884 ?        S    01:27   0:03 /usr/bin/perl 
/usr/sbin/squid-prefetch
root     14719  0.0  0.0  24796  1076 ?        Ss   14:26   0:00 /usr/sbin/squid
proxy    14721  2.2  0.2  40212 10352 ?        Sl   14:26   0:00 (squid)
root     14753  0.0  0.0   7576   820 pts/0    S+   14:26   0:00 fgrep squid

# cat /var/run/squid.pid 
14721

Here, 14719 is the son of the process started by init. It forks yet
again, giving 14721, the program which does the actual work. Usually
daemons do this in order to become fully independent of the program
which launched them (so that they become inherited by init rather than
whatever script launched them). However, when doing this, the middle
process (14719) must exit, rather than staying around.

The result of this is that upstart becomes confused and thinks 14719 is
the actual daemon, and sends it the signals instead of 14721. However,
14719 is not prepared to handle any signal, including SIGHUP, and so it
exits without passing anything on to its child. Upstart notices 14719's
exit, and thinks that squid is now fully gone, but it is not, as 14721
still happily chuggs along.

Adding SQUID_ARGS=-N to /etc/default/squid, and commenting out expect
fork from /etc/init/squid fixes the issue.

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to squid in ubuntu.
https://bugs.launchpad.net/bugs/573853

Title:
  Cannot control squid "Unknown instance"

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to