Project

General

Profile

Actions

Bug #4885

closed
DB

squid3 chmod error at boot after reinstall post-upgrade

Bug #4885: squid3 chmod error at boot after reinstall post-upgrade

Added by Dave B about 11 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Squid
Target version:
-
Start date:
07/27/2015
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
Affected Architecture:

Description

when squid3 start
warning: chmod() expects parameter 2 to be long, string given in /usr/local/pkg/squid.inc on line 156
line 156 in squid.inc is: chmod("/var/squid/cache/swap.state", "a+rw");

moving a+rw to 666 seems to have fixed this one (at least I have no errors on the screen at package start)


Files

squid.inc.diff (456 Bytes) squid.inc.diff José de Paula Rodrigues Assis, 08/24/2015 02:52 PM

CB Updated by Chris Buechler about 11 years ago Actions #1

  • Subject changed from squid3 error at boot after upgrade from 2.2.3 to 2.2.4 to squid3 chmod error at boot after reinstall post-upgrade
  • Target version deleted (2.2.4)
  • Affected Version deleted (2.2.4)

no relation to base version

BC Updated by Bipin Chandra about 11 years ago Actions #2

im having same issue, setting to 0666 works fine

DB Updated by Dave B about 11 years ago Actions #3

2015/07/31 03:05:08 kid1| /var/run/squid/squid.pid: (1) Operation not permitted
2015/07/31 03:05:08 kid1| WARNING: Could not write pid file

JR Updated by José de Paula Rodrigues Assis about 11 years ago Actions #4

Squid3 on pfsense 2.1.5 used the command:

exec("chmod a+rw /var/squid/cache/swap.state");

on squid.inc.php. The version on pfsense 2.2.4, on the other hand, uses the syntax

chmod("/var/squid/cache/swap.state", "a+rw");

However, PHP's chmod doesn't accept literal modes as a chmod argument, only octal ones (look at http://php.net/chmod). The argument as it is causes PHP to emit an error message wherever it tries to call this function, also affecting Squid's XMLRPC syncing between two hosts. Simply changing the function call to use the correct argument type makes the errors go away:

chmod("/var/squid/cache/swap.state", 0666);

is correct (notice the leading 0, it is important). Attached is a simple patch against squid.inc that does that.

RB Updated by Renato Botelho about 11 years ago Actions #6

  • Status changed from New to Feedback

Merged

KB Updated by Kill Bill almost 11 years ago Actions #7

Fixed.

CB Updated by Chris Buechler over 10 years ago Actions #8

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom