Project

General

Profile

Feature #5510

Need a simple way to enable/disable package-installed services

Added by Kill Bill over 1 year ago. Updated 2 months ago.

Status:
New
Priority:
Normal
Category:
Package System
Target version:
Start date:
11/21/2015
Due date:
% Done:

0%


Description

The current practice where people write the same code over and over again pretty much in every package that unlinks the rc script on disabling the package and recreates it on enabling is completely braindead and sucks big time. Some basic outline:

- use /etc/rc.conf.d/ with per-package files? (rc.conf.local is definitely a bad idea).
- a simple tag in the packages service definition pointing to the package configuration variable used to enable/disable it.
- extend the write_rcfile() accordingly to put the required variable to the generated rc script automagically.
- make /etc/rc.start_packages check for disabled packages and skip those.
- fix up the dashboard and Status - Services to show disabled state properly.

Or, if you have some better idea, just share it...

History

#1 Updated by Jim Thompson over 1 year ago

  • Tracker changed from Todo to Feature
  • Assignee set to Renato Botelho
  • Target version set to Future

Assigned to Renato, but really, the whole ball of string needs a serious re-think.

#2 Updated by Kill Bill 2 months ago

OK, some update here:

- a simple tag in the packages service definition pointing to the package configuration variable used to enable/disable it.

Well, the variable apparently already exists [1] but:
- this thing does not handle packages that install multiple services (e.g. Squid) particularly well
- most packages use either something else than "enable" or something else than "off" for this function.

- fix up the dashboard and Status - Services to show disabled state properly.

This apparently works when used properly in the package, e.g. https://github.com/pfsense/FreeBSD-ports/pull/309

Other than that, no progress.

[1] https://github.com/pfsense/pfsense/blob/master/src/etc/inc/service-utils.inc#L183

Also available in: Atom PDF