Rudimentary support for setting login shell for new users. Currently
hard-coded from what's selected in the Buildroot config, if Bash is
available or not.
Follow-up to f5866ee
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
The writesf() API was hard coded to always open files in "r+" mode,
which fails if the file doesn't exist.
Add a mode option to writesf() and writedf().
Also, drop the default motd, we don't have one in NETCONF mode.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This change drops -nographic in favor of the more flexible virtconsole,
fixing the problem with loss of terminal history and reset.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Bringing down the current generation is a step of its own, so it makes
sense to let finit clear out all old services before setting up the
new ones.
For example, with avahi-autoipd, without this step, we would run the
following sequence when disabling it on an interface:
initctl disable zeroconf@iface
ip link set dev iface down
ip link set dev iface up
initctl reload
But we really want to stop the zeroconf service before the down/up
cycle on the interface, since that is likely to disrupt the
daemon. With this additional step, the sequence becomes:
initctl disable zeroconf@iface
initctl reload
ip link set dev iface down
ip link set dev iface up
initctl reload
Which means that finit won't try to restart zeroconf if it dies during
the down/up cycle, since the service is already gone at that point.
Saving running to startup follows the same pattern as config update of
candidate to running, so we must employ the same hook mechanism here.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Refactor register_change() wrapper, for sr_module_change_subscribe(),
with an additional twist of setting up a commit DONE event catcher.
This creates a global event hook that ensures we call 'initctl reload'
after all module callbacks have completed, regardless of the xpath and
without having to have "shadow" subscriptions to all new modules being
added to confd.
Based on on ideas from https://github.com/sysrepo/sysrepo/issues/2188
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Without --force-bind, the address is removed if another routable
address is added to the interface.
While this is likely something that should be configurable in the
future, we choose this mode as the default so that IPs used for
NETCONF connections are not dropped because other addresses are added.
A generic replacement for src/net with some advantages:
- Shell script is well-suited to these kinds of tasks, making this
implementation much simpler.
- Allow arbitrary number of actions (not just init/exit), this can be
used to implement things like `dagger exec up/down`.
- Allow arbitrary number of scripts for each action/node tuple. This
will let us handle more complex scenarios in confd without having to
fiddle about with src/net.
finit is not ready to accept the messages anyway, so we end up waiting
for the 2s timeout (2 times). Since finit won't setup a utmp entry
until it leaves runlevel S, we use that as the sync point for when
finit is ready to receive reloads.
This allows you to define a single "logical" config that can be
tailored to the specific system based on the available interfaces,
base MAC address etc.
This patch introduces basic user authentication support via sysrepo.
Namely it adds:
* The ability to create or delete a UNIX user.
* The ability to set or delete a UNIX user password.
The password needs to be hashed and in a UNIX shadow format, such as
"$ALG$SALT$HASH". We want to avoid the handling of clear text
passwords as much as possible. In the meanwhile, passwords
can be generated in the infix shell using mkpasswd.
CLI Examples:
Add a user:
configure> set system authentication user foo
Delete a user:
configure> delete system authentication user foo
Set a user password:
configure> set system authentication user foo password ...
Signed-off-by: Richard Alpe <richard@bit42.se>
This commit enables support for running custom startup scripts at boot,
allowing a mix of a NETCONF-based system and Classic /etc. For example,
use NETCONF to set up network interfaces, users, etc. and runparts for
enabling and configuring the device as an OSPF router.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
Some critical services must never be stopped, and with the unfortunate
separation of runlevel S and 0 in Finit recently, all affected service
definitions must be updated.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
For each build there is an infix-$ARCH-$VARIANT.img -> rootfs.squash
that we want to be a real file when extracting it. This to ease the
integration with testing frameworks like Qeneth.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>