Bug #10978
closedrc.initial tries to execute rc.local.running even if it doesn't exist, and even if it is already running.
100%
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.
Updated by Renato Botelho almost 4 years ago
- Category set to Console Menu
- Status changed from New to Feedback
- Assignee set to Renato Botelho
- Target version set to 2.5.0
Updated by Renato Botelho almost 4 years ago
- % Done changed from 0 to 100
Applied in changeset 449fdf250171616d4865bfd5c865c64035e14496.
Updated by alzee bum almost 4 years 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.
Updated by Renato Botelho almost 4 years 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.
Updated by Jim Pingle almost 4 years 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.
Updated by alzee bum almost 4 years ago
I did create another issue for it a few days ago as requested.