Project

General

Profile

Actions

Feature #3667

closed

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

Added by Dreamcat Four almost 10 years ago. Updated over 8 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 #1

Updated by Dreamcat Four almost 10 years ago

Pull request:

https://github.com/pfsense/pfsense/pull/1197

The proposed solution also solves another similar issue I raised previously: https://redmine.pfsense.org/issues/3615.

So please consider that fulfilled also.

Actions #2

Updated by Dreamcat Four almost 10 years ago

Signed up to Contributor License Agreement.

Actions #3

Updated by Jim Thompson almost 10 years ago

  • Assignee set to Renato Botelho

assigned to Renato for evaluation.

Actions #4

Updated by Renato Botelho almost 10 years ago

  • Status changed from New to Needs Patch

As Ermal mentioned on pull request comment, it needs to be improved. We can keep the technical discussion there.

Actions #5

Updated by Chris Buechler over 8 years ago

  • Target version deleted (2.2)
Actions

Also available in: Atom PDF