Project

General

Profile

Actions

Bug #10978

closed

rc.initial tries to execute rc.local.running even if it doesn't exist, and even if it is already running.

Added by alzee bum about 1 year ago. Updated 12 months ago.

Status:
Resolved
Priority:
Normal
Category:
Console Menu
Target version:
Start date:
10/15/2020
Due date:
% Done:

100%

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

Description

See code here: https://github.com/pfsense/pfsense/blob/master/src/etc/rc.initial#L33

Lines 33-46 check for rc.local and if it exists, try to execute it as well as rc.local.running if rc.local is not currently running. If rc.local is currently running, then rc.local.running is executed.

This results in an error on the console every time you log in if rc.local is present and rc.local.running is not, as well as executing the rc.local every time you log in via SSH -- instead of just once at boot as would be expected on a BSD based system. This point should probably be reported as a separate bug, I only just discovered the behavior while filling out this report.

Actions #1

Updated by Renato Botelho about 1 year ago

  • Category set to Console Menu
  • Status changed from New to Feedback
  • Assignee set to Renato Botelho
  • Target version set to 2.5.0
Actions #2

Updated by Renato Botelho about 1 year ago

  • % Done changed from 0 to 100
Actions #3

Updated by alzee bum about 1 year ago

Renato Botelho wrote:

Applied in changeset 449fdf250171616d4865bfd5c865c64035e14496.

Thanks Renato, that looks like it will work.

Should I open a different PR regarding .profile and rc.initial (and thus rc.local) being executed every time you log in on the console? I don't know why this is the case, but from a purely BSD perspective, its not what anyone would reasonably expect rc.local to do.

Actions #4

Updated by Renato Botelho about 1 year ago

  • Status changed from Feedback to Resolved

alzee bum wrote:

Renato Botelho wrote:

Applied in changeset 449fdf250171616d4865bfd5c865c64035e14496.

Thanks Renato, that looks like it will work.

Should I open a different PR regarding .profile and rc.initial (and thus rc.local) being executed every time you log in on the console? I don't know why this is the case, but from a purely BSD perspective, its not what anyone would reasonably expect rc.local to do.

To be honest with you I just realized it happens after you mentioned. There must be some historical reasons and we will need to figure it out. Please open a different bug for this one.

Actions #5

Updated by Jim Pingle 12 months ago

.profile is expected to be executed at each login, which it is.

.profile runs rc.initial during an interactive session for admin/root to present the menu, which is also expected.

I don't recall why rc.initial tries to run rc.local, though. At least not the way pfSense is currently running.

In the past I think it might have been set that way because rc.initial runs when the menu is displayed on the console at the end of the boot process, so it was a way to let users run custom commands at boot. Probably before we had things like shellcmd and so on.

It's probably safe to kill, but does need its own separate issue.

Actions #6

Updated by alzee bum 12 months ago

I did create another issue for it a few days ago as requested.

https://redmine.pfsense.org/issues/10980

Actions

Also available in: Atom PDF