Project

General

Profile

Actions

Feature #3667

closed

Hook for user shutdown script - "/etc/rc.custom_shutdown"

Added by Dreamcat Four over 10 years ago. Updated over 9 years ago.

Status:
Needs Patch
Priority:
Normal
Category:
Operating System
Target version:
-
Start date:
05/18/2014
Due date:
05/23/2014
% Done:

90%

Estimated time:
0.00 h
Plus Target Version:
Release Notes:

Description

There remains no simple feature for a user to run their custom rc scripts during shutdown. (without resorting to writing their own packages). Many of us don't have the wherewithal for all that fuss (packages, php, xml) for something very simple. But It's important to gracefully stop a service and release it's resources back.

The equivalent feature on other platforms (FreeNAS and NAS4Free) is to provide a simple GUI page where users can specify their own list of "POSTINIT" and "SHUTDOWN" scripts to run. It isn't hidden away or anything.

Anyway. Please find provided a small patch to enable executing a custom command during shutdown. It is the opposite partner of "/etc/rc.custom_boot_early", with the same behaviour as that. It is a hidden method. If the script isn't present (the file does not exist by default), then nothing will be executed. But if a user creates a file named "/etc/rc.custom_shutdown", and makes it executable, then that file will be executed at shutdown time. Right after stop_packages().

Please add this important functionality to the pfSense 2.2-beta codebase. I'm sending you the pull request today.

Actions

Also available in: Atom PDF