Config::Model::Systemd (3)
Leading comments
Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) Standard preamble: ========================================================================
NAME
Config::Model::Systemd - Editor and validator for systemd configuration filesVERSION
version 0.232.7SYNOPSIS
command line
Requires App::Cme:Handle all user units:
$ cme edit systemd-user '*' $ cme check systemd-user '*'
Handles all user units that match 'foo':
$ cme edit systemd-user foo $ cme check systemd-user foo
Check all root units:
# cme check systemd '*'
Check all root units that match 'foo':
# cme check systemd foo
Edit override file of "foo.service":
# cme edit systemd foo.service
Handle a service file:
$ cme check systemd-service path/to/file.service $ cme edit systemd-service path/to/file.service
Timer and socket units are also supported:
$ cme check systemd-socket path/to/file.socket $ cme check systemd-timer path/to/file.timer
Perl program (experimental)
use Config::Model qw/cme/; cme(application => 'systemd-user' backend_arg => 'free') ->modify('socket:free-imap-tunnel Socket Accept=yes') ; cme(application => 'systemd-service', config_file => 'foo.service') ->modify('Unit Description="a service that does foo things"')
DESCRIPTION
This module provides a configuration editor for the configuration files of systemd, i.e. all files in "~/.config/systemd/user/" or all files in "/etc/systemd/system/"Ok. I simplified. In more details, this module provides the configuration models of Systemd configuration file that cme, Config::Model and Config::Model::TkUI use to provide a configuration editor ("cme edit") and checker ("cme check").
invoke editor
The following command loads user systemd files (from "~/.config/systemd/user/" and launch a graphical editor:
cme edit systemd-user foo
Likewise, the following command loads system systemd configuration files and launch a graphical editor to updated an override file (like "systemctl edit" command):
sudo cme edit systemd foo
A developer can also edit a systemd file shipped with a software:
cme edit systemd-service software-thing.service
Just check systemd configuration
You can also use cme to run sanity checks on systemd configuration files:
cme check systemd-user '*' cme check systemd '*' # may take time cme check systemd-service software-thing.service
Use in Perl program (experimental)
As of Config::Model 2.086, a ``cme(...)'' in cme function is exported to modify configuration in a Perl program. For instance:
use Config::Model qw/cme/; # also import cme function # call cme for systemd-user, modify ans save my-imap-tunnel.socket file. cme( application => 'systemd-user', backend_arg => 'my-imap-tunnel' )->modify('socket:my-imap-tunnel Socket Accept=yes') ;
Similarly, system Systemd files can be modified using "systemd" application:
use Config::Model qw/cme/; cme( application => 'systemd', backend_arg => 'foo' )->modify(...) ;
For more details and parameters, please see cme, modify, load and save documentation.
BUGS
The list of supported parameters is extracted from the xml documentation provided by systemd project. This list is expected to be rather complete.The properties of these parameters are inferred from the description of the parameters and are probably less accurate. In case of errors, please log a bug <github.com/dod38fr/config-model-systemd/issues>.
TODO
For now, only "unit", "socket" and "service" files are supported. Please log a wishlist bug if you need other unit types to be supported.SUPPORT
In case of issue, please log a bug on <github.com/dod38fr/config-model-systemd/issues>.Contributors
Mohammad S Anwar
Thanks for your contributions
SEE ALSO
- *
- cme
- *
- Config::Model
- *
- <github.com/dod38fr/config-model/wiki/Using-config-model>
AUTHOR
Dominique DumontCOPYRIGHT AND LICENSE
This software is Copyright (c) 2015-2017 by Dominique Dumont.This is free software, licensed under:
The GNU Lesser General Public License, Version 2.1, February 1999
SUPPORT
Websites
The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources.- *
-
Search CPAN
The default
CPANsearch engine, useful to viewPODinHTMLformat. - *
-
AnnoCPAN
The AnnoCPAN is a website that allows community annotations of Perl module documentation.
- *
-
CPANRatings
The
CPANRatings is a website that allows community ratings and reviews of Perl modules. - *
-
CPANTS
The
CPANTSis a website that analyzes the Kwalitee ( code metrics ) of a distribution. - *
-
CPANTesters
The
CPANTesters is a network of smokers who run automated tests on uploadedCPANdistributions. - *
-
CPANTesters Matrix
The
CPANTesters Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms. - *
-
CPANTesters Dependencies
The
CPANTesters Dependencies is a website that shows a chart of the test results of all dependencies for a distribution.
Bugs / Feature Requests
Please report any bugs or feature requests by email to "ddumont at cpan.org", or through the web interface at <github.com/dod38fr/config-model-systemd/issues>. You will be automatically notified of any progress on the request by the system.Source Code
The code is open to the world, and available for you to hack on. Please feel free to browse it and play with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull from your repository :)<github.com/dod38fr/config-model-systemd>
git clone git://github.com/dod38fr/config-model-systemd.git