Project

General

Profile

Actions

Bug #11851

closed

/etc/rc.start_packages double-starts some packages

Added by Dave Tickem over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
Services
Target version:
-
Start date:
04/26/2021
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:
Default
Affected Version:
2.5.1
Affected Architecture:
All

Description

During boot process, /etc/rc.start_packages double starts some packages, slowing down boot significantly in some cases. An example in point is named/bind. Appears to be as the package internal name is different from the rc script name (bind vs named).

Explaining, using bind/named as an example:

  1. Package name is "bind"
  2. bind.xml configuration file has rcfile set as "named.sh"
  3. /etc/rc.start_packages then collects two lists: xml defined packages and all *.sh scripts
  4. runs each package rc file (which does include named.sh)
  5. subtracts the package name + ".sh" from the glob list (in this case tries to remove "bind.sh")
  6. runs the remaining files in the glob list. (which runs "named.sh" again)

The start_packages script does not use the name of the service startup script to determine what to remove from the "have run list", it creates a new file name using the package title, in this case, "bind" and tries to remove it from the array. "bind.sh" is not in the list, named.sh is. the "named.sh" is left in the ".sh" list and then run again - run twice during boot.

Specific line: /etc/rc.start_packages that tries to remove "bind.sh" instead of "named.sh" from the list of residual "*.sh" files in /usr/local/etc/rc.d/

unset($rcfiles[RCFILEPREFIX . strtolower($internal_name) . ".sh"]); #

Not 100% clear whether this is a bind package issue (name vs startup script vs xml config) or a pfsense startup script issue.

I propose this is a pfsense core issue with /etc/rc.start_packages as this script is not attempting to eliminate the actual scripts run from the remaining scripts list, it is making an assumption that the script name is the same as the package name - a wrong assumption. It should be using the "rcfile" xml element value from the package to determine which start scripts to eliminate from the "*.sh" glob list as already run.

--end--

Actions #1

Updated by Viktor Gurov over 3 years ago

these are pkg issues, see #11887 #11888 #11889

Actions #2

Updated by Jim Pingle over 3 years ago

  • Status changed from New to Closed

Closing this. If other packages need adjusted, a new issue can be opened for each affected package.

Actions

Also available in: Atom PDF