Project

General

Profile

Actions

Bug #3626

closed

rc.start_packages called twice on startup if WAN is set to DHCP

Added by Gunther Jauch over 10 years ago. Updated over 8 years ago.

Status:
Not a Bug
Priority:
Normal
Assignee:
-
Category:
Package System
Target version:
-
Start date:
04/26/2014
Due date:
% Done:

0%

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

Description

Hi,

rc.start_packages: Restarting/Starting all packages is called twice at boot!

Apr 22 17:23:26     php: rc.newwanip: rc.newwanip: Informational is starting sk0.
Apr 22 17:23:26     php: rc.newwanip: rc.newwanip: on (IP address: 192.168.178.45) (interface: wan) (real interface: sk0).
Apr 22 17:23:26     php: rc.newwanip: ,,1,dhcp, // thats my debug output of the if() false, false, true !
Apr 22 17:23:27     php: rc.newwanip: ROUTING: setting default route to 192.168.178.1
Apr 22 17:23:28     php: rc.bootup: ROUTING: setting default route to 192.168.178.1
Apr 22 17:23:29     check_reload_status: Updating all dyndns
Apr 22 17:23:32     php: rc.newwanip: Resyncing OpenVPN instances for interface WAN.
Apr 22 17:23:32     php: rc.newwanip: Creating rrd update script
Apr 22 17:23:33     php: rc.bootup: Creating rrd update script
Apr 22 17:23:33     syslogd: exiting on signal 15
Apr 22 17:23:33     syslogd: kernel boot file is /boot/kernel/kernel

Apr 22 17:23:34     php: rc.start_packages: Restarting/Starting all packages.
Apr 22 17:23:34     php: rc.newwanip: pfSense package system has detected an ip change 192.168.178.45 -> 192.168.178.45 ... Restarting packages.

See the last line...

pfSense package system has detected an ip change 192.168.178.45 -> 192.168.178.45 ... Restarting packages.

The IP is identical! There is no need for the restart!

The restart is caused by the following if-statement inside the /etc/rc.newwanip script

if (!is_ipaddr($oldip) || $curwanip != $oldip || !is_ipaddrv4($config['interfaces'][$interface]['ipaddr']))

The first 2 conditions are fine... the 3.rd returns true because the value of [b]$config['interfaces'][$interface]['ipaddr'][/b] is the string "dhcp"

cu gunther

Actions #1

Updated by Daniel Eckert over 10 years ago

According to a comment in /etc/rc.newwanip:

We need to force sync VPNs on such even when the IP is the same for dynamic interfaces.
Even with the same IP the VPN software is unhappy with the IP disappearing, and we
could be failing back in which case we need to switch IPs back anyhow.

It sounds like the correct solution here might be to add a check for whether VPNs are in use when checking for dynamic addresses vs. same IP.

Actions #2

Updated by Chris Buechler about 9 years ago

  • Category set to Package System
Actions #3

Updated by Chris Buechler over 8 years ago

  • Status changed from New to Not a Bug

It's correct that it does so. There is another ticket to improve which packages restart on dynamic WAN reconnection

Actions

Also available in: Atom PDF