Add the ability to set and delete system MotD (Message Of The Day)
using the cli.
This patch augments the standard ietf-system yang schema with
a new infix-system schema which contains a new motd leaf.
The default value is hard coded in two places, confd and the rootfs
file /etc/motd. The intention is to fix this in upcoming patches.
Introduces:
exec> configure> set system motd STRING
exec> configure> delete system motd
This is needed to confirm the new system configuration generation and
reload all affected services. E.g., when configuring an NTP server
and committing the candidate to running, the ietf-system plugin has
only enabled the service, as a last step we need to tell Finit to
actually start it.
This hook needs to run last since the enabled service(s) may depend on
other service(s), or networking, to be enabled in the proper order.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Really ugly handling here, needs to be reworked into sr_uint8() etc.,
adding as-is for big upcoming demo.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Declare deviation for /ietf-system:system/clock/timezone-utc-offset,
which we currently do not support.
Please note, when setting out to add support for timezone-utc-offset,
you need to ensure the user does not input both, that should be a
validation error. It's an either-or thing.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
How to verify, use the following command and paste the XML below:
$ sysrepocfg -R
<sys:set-current-datetime xmlns:sys="urn:ietf:params:xml:ns:yang:ietf-system">
<sys:current-datetime>2022-01-12T14:29:00-02:00</sys:current-datetime>
</sys:set-current-datetime>
Reuse code from mech, verified and working.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
When researching the systemd tmpfiles.d implementation I discovered the
effort to standarize on /usr/share/factory as a generic factory defaults
for Linux systems. This patch adds a small example factory.cfg file
that is installed as /usr/share/factory/cfg/startup-config.cfg. The
tmpfiles.d backend will then install it as /cfg/startup-config.cfg if
that file is missing at boot. Confd does the rest to bootstrap our
(by default) empty sysrepo db with this startup-config.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This change adds a hook to the startup datastore, we use the ietf-system
module because the module argument is mandatory. The hook runs when all
changes have been saved to the internal store. Since sysrepo has many
startup files in /etc/sysrepo, we saving a JSON copy of all these files
in /cfg/startup-config.cfg, which is persistent. On system bootstrap
this file is merged into the (empty) running datastore, which is what
the sysrepo maintainers recommend to be independent of any yang model
updates that might occur on image upgrades.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
- Call external programs safely with run()
- Use augeas to update /etc/hostname and /etc/hosts
- Add support for generating /etc/chrony.conf
- Update license copyright due to significant contrib.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The default is to use -d (debug), which changes logging to stdout, which
we do not want with Finit.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Infix integration of klish and klish-plugin-sysrepo.
Initially we add:
More flexible management of running vs. startup: Instead of always
committing changes both to running and startup, commit only modifies
running. To persist changes to startup, the copy command is
introduced. This lets the user copy from factory/startup/running to
startup/running at any time.
Well-known verbs like abort, leave, end, etc.
Drop the shortname yang aliases, installed they become copies of
their versioned counterpart, which is not the intention, but also,
no other yang consumer does this.
We'd like to use ly_ctx_load_module() directly, or a slim sysrepo
wrapper of the same, but no such API (load by yang module *name*
with optional revision) exists currently.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Extended evaluation of sysrepo due to problems parsing yang v1.1 models
with the built-in yang parser in Clixon. Problems not seen with libyang
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>