systemd / systemd

The systemd System and Service Manager
https://systemd.io
GNU General Public License v2.0
13.06k stars 3.74k forks source link

systemctl: display metadata about suitable graphical configuration tool for a unit #16345

Open nintyfan opened 4 years ago

nintyfan commented 4 years ago

Is your feature request related to a problem? Please describe. In past, some distribution allow to setup daemon during package installation. That's bad idea, but some admins may like to configure daemon/unit by fast tool.

Describe the solution you'd like I'm author of Bonsole - Browser console program and related libraries. To communicate with Bonsole, program must be linked with special library. This library supports many backends. One is native - it sends document tree to Bonsole. Another is console, which uses XSLT to translate document tree into string with escape sequences. Bonsole and app communicate via DBUS and file description passed via DBus or on process creation, so both tools could works with different rights.

Idea is to add field ConfigurationTool in unit files, so system administrators could call systemd-configure apache (for example). Additionally, there's should exists systemd-asks-for-configure [unit-name] to tell admin that this unit need to be configured. Admin could be informed via e-mail or in other ways.

Describe alternatives you've considered Add more general approach, language such like udev, to select which config tool ran. Systemd-configre will pass some environment variables to run configuration tool for console, Plasma5, GNOME, etc. It's harder and worse idea than previous, but maybe there's way to enhance it.

poettering commented 4 years ago

Hmm, this request reminds me of the Documentation= field we carry in units, i.e. which just carries some metadata for a unit we display in "systemctl status".

nintyfan commented 4 years ago

I never look at systemd sources.

I think, systemctl should compare window manager env variable with strings in configuration. User could also bypass own string. Syntax in unit could be: Configuration[GNOME3]=apache2-gtk3-config Configuration[Plasma5]=apache2-kde-config Configuration[TUI]=apache2-menu-console

nintyfan commented 2 years ago

Maybe integrate this with Flatpak? You need to:

  1. Give apps names in systemd unit like org.apache.ApacheConfigGTK/org.apache.ApacheConfigQt/org.apache.ApacheConfigCLI
  2. User can install one of above
  3. Flatpak package must set some files in /etc as writable and in /usr/etc as readable 4.Package manager will check to which packages these files belongs to and installation process of selected UI configuration tool will displays aggregated patch to these files + packages description + (eventually) given file description from manual. For example: /etc/passwd: (from manual): passwd - file contains user profile configurations (read more) /etc/shadow: (from manual): shadow - file contains users profile passwords (read more) Belongs to: base system This package is base system. Do not uninstall. Do not mess up You select to install some service GUI, which needs to edit passwords and profile configuration

Another example: /etc/apache2/httpd.conf: (from manual) - file contains basic www service configuration Belongs to: apache2 This package contains www server daemon + configuration You select to install apache2 configuration UI, written in GTK+, which needs to access apache2 configuration files.