Age | Commit message (Collapse) | Author |
|
If systemd is built with fdisk support[1] and the openssl and cryptsetup
PACKAGECONFIG are enabled, systemd-homed[1] is automatically enabled.
The org.freedesktop.home1.conf file was forgotten, so this commit adds
the file and make enabling homed a explicit choice.
systemd-homed.service and systemd-homed-activate.service have a Also= on
each other, so "systemctl" has been fixed to handle the circular
dependency.
userdb isn't strictly speaking needed for homed but "systemctl" can't
handle the missing unit file and upstream recommend enabling both[3].
[1] Automatically enabled if the fdisk dependency is installed which it
is as util-linux is pulled in by systemd
[2] https://www.freedesktop.org/software/systemd/man/systemd-homed.service.html
[3] https://github.com/systemd/systemd/commit/871dc8d644eef7542a5330f84c25b1db2617317c
Signed-off-by: Kristian Klausen <kristian@klausen.dk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
When systemctl fail it would throw an exception and
dump a traceback. Lets use a more controlled workflow.
[Yocto #14395]
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
In systemd.bbclass, it will replace criterion command 'type systemctl'
with 'systemctl' without any argument to judge whether command systemctl
is available. The change is to fix install/remove package error in
container when command systemctl exists but not callable.
Make native systemctl wrapper prints help mesages if called without any
argument to follow the update.
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
The script scans for services, parses them and makes sure those targets are still
there. The exists file check fails if the target is an alias, such as default.target
so add an additional test.
[YOCTO #13685]
Signed-off-by: Werner Grift <sky.captin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
It's possible for a service file to accidentally contain mixed line endings, but
the string cleanup code was assuming Unix endings.
[ YOCTO #13535 ]
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
systemd-systemctl-native
Support for serive-name.service.d/ folders containing .conf files
It don't support all the partial folder names
See https://www.freedesktop.org/software/systemd/man/systemd.unit.html
Signed-off-by: Frederic Ouellet <fredericouellet@eaton.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
Refactor so that SystemdUnit is its own class, then add support for the
enable command. This restores the ability of systemd.bbclass to create
instances using syntax such as:
SYSTEMD_SERVICE_${PN} = "serial-getty@ttyAMA0.service"
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
When creating images, for anything other than the explicitly stateless
case, touch /etc/machine-id so that the images can be booted without an
initramfs and with `ro` set on the kernel command line, otherwise system
refuses to start:
[ 7.222134] systemd[1]: No hostname configured.
[ 7.227266] systemd[1]: Set hostname to <localhost>.
[ 7.232622] systemd[1]: System cannot boot: Missing /etc/machine-id and /etc is mounted read-only.
[ 7.241750] systemd[1]: Booting up is supported only when:
[ 7.247362] systemd[1]: 1) /etc/machine-id exists and is populated.
[ 7.253752] systemd[1]: 2) /etc/machine-id exists and is empty.
[ 7.259757] systemd[1]: 3) /etc/machine-id is missing and /etc is writable.
If IMAGE_FEATURES includes `stateless-rootfs` then systemctl-native is
not run on the image leaving the image for population at runtime by
systemd.
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
Rewrite systemctl-native in Python so that extending/testing it is
easier.
Now that the systemd class sets up service presets instead of actively
enabling services, the 'enable' and 'disable' subcommands for systemctl
are not actually used anywhere. As such, we can remove these to make
sure that nobody inadvertently introduces new uses of them.
This implementation covers `preset-all` and `mask` which are the only
options used in the current code, but should be readily extensible to
other commands.
We use `preset-all` at image construction time to populate the symlinks
used by systemd.
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
Handle the %i wildcard appearing in a dependency in the Install section
of a template unit, e.g.
$ cat foo@.service
[Install]
WantedBy=bar@%i.target
Using the real systemctl something like:
$ systemctl enable foo@baz.service
will create a symlink in /etc/systemd/system/bar@baz.target.wants.
Detect wildcards in templates and make the appropriate substitution.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
The regex for acceptable systemd WantedBy/RequiredBy targets does not include
target.wants, so a line like this:
WantedBy=multi-user.target.wants
gets silently ignored, even though it works fine on a real system.
Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
The regexs were too strict and didn't allow for trailing whitespace.
[ YOCTO #9337 ]
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
|
Install section of a systemd service may contain RequiredBy dependency,
which is not handled currently. This means that symlinks to enable the
service are not created and the service may not be started.
Also fix debug output (all dependencies were printed instead of the one
which was enabled or disabled).
Signed-off-by: Tomas Novotny <tomas@novotny.cz>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
The systemctl script supports enabling template units by evaluating
"DefaultInstance" parameter. Unfortunately, due to the sed replacement
mechanism, all escaping used in the DefaultInstance string, e.g. for
giving path names with dashes, is expanded too early.
Thus for
DefaultInstance=-path\x2dwith\x2ddashes
a path unit `foobar@.path` will be installed with a symlink named
foobar@-path-with-dashed.path
that is interpreted as the path `/path/with/dashes` instead of the
intended path nam `/path-with-dashes`.
To fix this behavior additional escaping of the backslashes in the
`DefaultInstance` string is required so that sed does not expand the
escaped characters.
Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
Noticed in this log.do_rootfs error:
Started /OE/build/shr-core/tmp-glibc/sysroots/x86_64-linux/usr/bin/systemctl --root=/OE/build/shr-core/tmp-glibc/work/nokia900-oe-linux-gnueabi/shr-image/2.0-r20/rootfs disable bluetooth.service
Try to find location of bluetooth.service...
Found bluetooth.service in /lib/systemd/system/bluetooth.service
WantedBy=bluetooth.target found in bluetooth.service
rmdir: failed to remove '/OE/build/shr-core/tmp-glibc/work/nokia900-oe-linux-gnueabi/shr-image/2.0-r20/rootfs/etc/systemd/system/bluetooth.target.wants': No such file or directory
Disabled bluetooth.service for bluetooth.target.
Disabled bluetooth.service for dbus-org.bluez.service.
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
Template unit files (those with '@' in their names) are not handled with
native version of systemctl. This is usually not a problem, as the
native systemctl fails and systemctl command is executed during first
boot. But some early boot template units may fail during first boot
because opkg configure for first boot is pulled too late for them
(although I encouter it only with some of my services, not with oe-core
ones).
Handling of template unit files is same as in original systemctl. Also
DefaultInstance directive in template is respected. As with original
systemctl, enabling of template without instance and DefaultInstance
does nothing.
Signed-off-by: Tomas Novotny <tomas@novotny.cz>
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
|
systemd has presets as described here
http://lists.freedesktop.org/archives/systemd-devel/2011-July/002830.html
This patch will let distros define presets file
which will override the enable/disable specified
by recipes.
systemctl preset without any argument will run presents
on all services
systemctl preset service1 service2 will run presets on
specified pervice.
something like enable * or disable *
would mean that all services will be either enabled or
disabled by default.
If no user-presets are specified then 'enable' is default
systemd allows basic globs but we do not implement them
except '*'
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
|
|
The Alias and WantedBy directives can accept all valid unit types when
using the systemctl from systemd. And since the systemctl script should
match the behavior of systemd as much as possible, add the current set
of unit types listed at
http://www.freedesktop.org/software/systemd/man/systemd.unit.html
to the Alias and WantedBy directives.
The deficiency was exposed when trying to use:
Alias=default.target
in a foo.target. No symlink was created by running
"systemctl enable foo.target" during the package's postinst.
Signed-off-by: Randy Witt <rewitt@declaratino.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
|
|
Old script failed to parse unit files containing comments like
| #Alias=some-alias
or whitespaces like
| WantedBy = foo
correctly. Patch changes script to interpret keywords only when they
are at the beginning of a line and ignores whitespaces before the '='.
Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
|
|
Add systemd recipes and associated support recipes.
Mostly based on meta-oe/meta-systemd, so almost all credit should go to:
Andreas Müller <schnitzeltony@googlemail.com>
Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
Holger Hans Peter Freyther <holger@moiji-mobile.com>
Khem Raj <raj.khem@gmail.com>
Koen Kooi <koen@dominion.thruhere.net>
Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Radu Moisan <radu.moisan@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|