Commit b0bf5e3c authored by Florent Revest's avatar Florent Revest

user services: Rework the way ceres services are launched in a cleaner...

user services: Rework the way ceres services are launched in a cleaner systemd-wide way. This also makes those recipes less asteroid-spcecific for systems with a different username.
parent 4e6eeb43
......@@ -2,6 +2,7 @@
Description=Starts the BLE synchronization daemon
Requires=dbus.socket
After=bluetooth.service
ConditionUser=!root
[Service]
Type=simple
......
......@@ -14,14 +14,14 @@ inherit qmake5 gsettings
DEPENDS += "qtbase glibmm qtmpris statefs-qt timed qttools-native"
RDEPENDS_${PN} += "glibmm qtmpris"
FILES_${PN} += "/usr/bin/ /usr/lib/systemd/user/ /usr/share/glib-2.0/schemas /usr/share/translations/ /home/ceres/.config/systemd/user/default.target.wants/"
FILES_${PN} += "/usr/bin/ /usr/lib/systemd/user/ /usr/share/glib-2.0/schemas /usr/share/translations/ /usr/lib/systemd/user/default.target.wants/"
do_install_append() {
install -d ${D}/usr/lib/systemd/user/
install -d ${D}/home/ceres/.config/systemd/user/default.target.wants/
install -d ${D}/usr/lib/systemd/user/default.target.wants/
cp ../asteroid-btsyncd.service ${D}/usr/lib/systemd/user/
if [ ! -f ${D}/home/ceres/.config/systemd/user/default.target.wants/asteroid-btsyncd.service ]; then
ln -s /usr/lib/systemd/user/asteroid-btsyncd.service ${D}/home/ceres/.config/systemd/user/default.target.wants/asteroid-btsyncd.service
if [ ! -f ${D}/usr/lib/systemd/user/default.target.wants/asteroid-btsyncd.service ]; then
ln -s /usr/lib/systemd/user/asteroid-btsyncd.service ${D}/usr/lib/systemd/user/default.target.wants/asteroid-btsyncd.service
fi
lrelease -idbased ${S}/i18n/asteroid-btsyncd.*.ts
......
[Unit]
Description=The wayland compositors and desktop of AsteroidOS
Requires=dbus.socket
ConditionUser=!root
[Service]
Type=notify
......
......@@ -15,7 +15,7 @@ inherit qmake5
DEPENDS += "lipstick qttools-native timed"
RDEPENDS_${PN} += "qtdeclarative-qmlplugins qml-asteroid qtwayland-plugins nemo-qml-plugin-time nemo-qml-plugin-contextkit nemo-qml-plugin-configuration asteroid-wallpapers ttf-asteroid-fonts"
FILES_${PN} += "/usr/share/asteroid-launcher/ /usr/lib/systemd/user/ /usr/share/translations/ /home/ceres/.config/systemd/user/default.target.wants/"
FILES_${PN} += "/usr/share/asteroid-launcher/ /usr/lib/systemd/user/ /usr/share/translations/ /usr/lib/systemd/user/default.target.wants/"
do_install_append() {
lrelease -idbased ${S}/i18n/asteroid-launcher.*.ts
......@@ -30,9 +30,9 @@ do_install_append() {
fi
install -d ${D}/usr/lib/systemd/user/
install -d ${D}/home/ceres/.config/systemd/user/default.target.wants/
install -d ${D}/usr/lib/systemd/user/default.target.wants/
cp ../asteroid-launcher.service ${D}/usr/lib/systemd/user/
if [ ! -f ${D}/home/ceres/.config/systemd/user/default.target.wants/asteroid-launcher.service ]; then
ln -s /usr/lib/systemd/user/asteroid-launcher.service ${D}/home/ceres/.config/systemd/user/default.target.wants/asteroid-launcher.service
if [ ! -f ${D}/usr/lib/systemd/user/default.target.wants/asteroid-launcher.service ]; then
ln -s /usr/lib/systemd/user/asteroid-launcher.service ${D}/usr/lib/systemd/user/default.target.wants/asteroid-launcher.service
fi
}
......@@ -2,6 +2,7 @@
Description=Sync FW daemon
Requires=dbus.socket booster-qt5.service
After=pre-user-session.target booster-qt5.service booster-qt5-signal.service
ConditionUser=!root
[Service]
# -G (--global-syms) so that msyncd's plugins can find symbols in msyncd and
......
......@@ -20,14 +20,14 @@ do_configure_prepend() {
do_install_append() {
cp ${WORKDIR}/msyncd.service ${D}/usr/lib/systemd/user/msyncd.service
install -d ${D}/home/ceres/.config/systemd/user/default.target.wants/
if [ ! -f ${D}/home/ceres/.config/systemd/user/default.target.wants/msyncd.service ]; then
ln -s /usr/lib/systemd/user/msyncd.service ${D}/home/ceres/.config/systemd/user/default.target.wants/msyncd.service
install -d ${D}/usr/lib/systemd/user/default.target.wants/
if [ ! -f ${D}/usr/lib/systemd/user/default.target.wants/msyncd.service ]; then
ln -s /usr/lib/systemd/user/msyncd.service ${D}/usr/lib/systemd/user/default.target.wants/msyncd.service
fi
}
DEPENDS = "libaccounts-qt5 libsignon-qt5 qtsystems nemo-keepalive"
FILES_${PN} += "/usr/share/glib-2.0/schemas /usr/share/accounts/services/ /usr/lib/systemd /home/ceres/.config/systemd/user/default.target.wants/"
FILES_${PN} += "/usr/share/glib-2.0/schemas /usr/share/accounts/services/ /usr/lib/systemd /usr/lib/systemd/user/default.target.wants/"
FILES_${PN}-dev += "/usr/lib/libbuteosyncfw5.prl"
FILES_${PN}-dbg += "/opt/tests/"
......@@ -2,6 +2,7 @@
Description=Application launch booster for Qt Components on QtQuick2
Requires=dbus.socket asteroid-launcher.service
After=asteroid-launcher.service
ConditionUser=!root
[Service]
Type=notify
......
......@@ -23,9 +23,9 @@ do_configure_prepend() {
}
do_install_append() {
install -d ${D}/home/ceres/.config/systemd/user/default.target.wants/
if [ ! -f ${D}/home/ceres/.config/systemd/user/default.target.wants/booster-qtcomponents-qt5.service ]; then
ln -s /usr/lib/systemd/user/booster-qtcomponents-qt5.service ${D}/home/ceres/.config/systemd/user/default.target.wants/booster-qtcomponents-qt5.service
install -d ${D}/usr/lib/systemd/user/default.target.wants/
if [ ! -f ${D}/usr/lib/systemd/user/default.target.wants/booster-qtcomponents-qt5.service ]; then
ln -s /usr/lib/systemd/user/booster-qtcomponents-qt5.service ${D}/usr/lib/systemd/user/default.target.wants/booster-qtcomponents-qt5.service
fi
install -d ${D}/var/lib/environment/mapplauncherd
......@@ -33,5 +33,5 @@ do_install_append() {
echo "QT_IM_MODULE=qtvirtualkeyboard" >> ${D}/var/lib/environment/mapplauncherd/qtcomponents-qt5.conf
}
FILES_${PN} += "/usr/libexec/mapplauncherd/ /usr/lib/systemd/user /usr/share/booster-qtcomponents-qt5 /home/ceres/.config/systemd/user/default.target.wants/"
FILES_${PN} += "/usr/libexec/mapplauncherd/ /usr/lib/systemd/user /usr/share/booster-qtcomponents-qt5 /usr/lib/systemd/user/default.target.wants/"
FILES_${PN}-dbg += "/usr/libexec/mapplauncherd/.debug"
......@@ -3,6 +3,7 @@ Description=Application launch booster for Qt5
After=dbus.socket
Requires=dbus.socket
Wants=booster-qt5-signal.service
ConditionUser=!root
[Service]
Type=notify
......
......@@ -22,12 +22,12 @@ do_configure_prepend() {
do_install_append() {
rm ${D}/usr/lib/systemd/user/booster-qt5-signal.service
install -d ${D}/home/ceres/.config/systemd/user/default.target.wants/
if [ ! -f ${D}/home/ceres/.config/systemd/user/default.target.wants/booster-qt5.service ]; then
ln -s /usr/lib/systemd/user/booster-qt5.service ${D}/home/ceres/.config/systemd/user/default.target.wants/booster-qt5.service
install -d ${D}/usr/lib/systemd/user/default.target.wants/
if [ ! -f ${D}/usr/lib/systemd/user/default.target.wants/booster-qt5.service ]; then
ln -s /usr/lib/systemd/user/booster-qt5.service ${D}/usr/lib/systemd/user/default.target.wants/booster-qt5.service
fi
}
FILES_${PN} += "/usr/lib/systemd/user /usr/libexec/mapplauncherd /home/ceres/.config/systemd/user/default.target.wants/"
FILES_${PN} += "/usr/lib/systemd/user /usr/libexec/mapplauncherd /usr/lib/systemd/user/default.target.wants/"
FILES_${PN}-dev += "/usr/share/mkspecs/features"
FILES_${PN}-dbg += "/usr/libexec/mapplauncherd/.debug"
[Unit]
Description=Generic application launch booster
After=dbus.socket
Requires=dbus.socket
ConditionUser=!root
[Service]
Type=notify
ExecStart=/usr/libexec/mapplauncherd/booster-generic --systemd
Restart=always
RestartSec=1
OOMScoreAdjust=-250
[Install]
WantedBy=user-session.target
......@@ -4,7 +4,8 @@ LICENSE = "LGPL-2.1+"
LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=243b725d71bb5df4a1e5920b344b86ad"
SRC_URI = "git://git.merproject.org/mer-core/mapplauncherd.git;protocol=https \
file://0001-booster-generic-Fix-path-to-tibapplauncherd.patch"
file://0001-booster-generic-Fix-path-to-tibapplauncherd.patch \
file://booster-generic.service"
SRCREV = "64396438670aa7ecf3de968d24c139c84b757eb2"
PR = "r1"
PV = "+git${SRCPV}"
......@@ -18,15 +19,16 @@ B = "${S}"
do_configure_prepend() {
sed -i '/Target for documentation/,$d' ${S}/CMakeLists.txt
sed -i 's@-L/lib -lsystemd-daemon@-lsystemd@' ${S}/src/launcherlib/CMakeLists.txt
cp ${WORKDIR}/booster-generic.service ${S}/src/booster-generic/booster-generic.service
}
do_install_append() {
install -d ${D}/home/ceres/.config/systemd/user/default.target.wants/
if [ ! -f ${D}/home/ceres/.config/systemd/user/default.target.wants/booster-generic.service ]; then
ln -s /usr/lib/systemd/user/booster-generic.service ${D}/home/ceres/.config/systemd/user/default.target.wants/booster-generic.service
install -d ${D}/usr/lib/systemd/user/default.target.wants/
if [ ! -f ${D}/usr/lib/systemd/user/default.target.wants/booster-generic.service ]; then
ln -s /usr/lib/systemd/user/booster-generic.service ${D}/usr/lib/systemd/user/default.target.wants/booster-generic.service
fi
}
FILES_${PN} += "/usr/lib/systemd/user /usr/libexec/mapplauncherd/ /usr/lib/libapplauncherd.so /home/ceres/.config/systemd/user/default.target.wants/"
FILES_${PN} += "/usr/lib/systemd/user /usr/libexec/mapplauncherd/ /usr/lib/libapplauncherd.so /usr/lib/systemd/user/default.target.wants/"
FILES_${PN}-dbg += "/usr/libexec/mapplauncherd/.debug"
FILES_${PN}-dev = "/usr/include/"
From b372b21dbf4dc7c4a523b17bd75d16292a8adff8 Mon Sep 17 00:00:00 2001
From: Florent Revest <revestflo@gmail.com>
Date: Sun, 2 Dec 2018 21:19:10 +0100
Subject: [PATCH] Use g_list_free_full as an alternative to g_list_foreach that
solves an invalid function pointer cast
---
src/ngf/core.c | 19 +++++--------------
src/plugins/profile/plugin.c | 3 +--
src/plugins/transform/plugin.c | 7 ++-----
3 files changed, 8 insertions(+), 21 deletions(-)
diff --git a/src/ngf/core.c b/src/ngf/core.c
index ba2e62c..a647589 100644
--- a/src/ngf/core.c
+++ b/src/ngf/core.c
@@ -322,10 +322,7 @@ n_core_free (NCore *core)
if (!core->shutdown_done)
n_core_shutdown (core);
- if (core->sink_order) {
- g_list_foreach (core->sink_order, (GFunc) g_free, NULL);
- g_list_free (core->sink_order);
- }
+ g_list_free_full (core->sink_order, g_free);
g_hash_table_destroy (core->key_types);
@@ -531,17 +528,11 @@ n_core_shutdown (NCore *core)
core->plugins = NULL;
}
- if (core->required_plugins) {
- g_list_foreach (core->required_plugins, (GFunc) g_free, NULL);
- g_list_free (core->required_plugins);
- core->required_plugins = NULL;
- }
+ g_list_free_full (core->required_plugins, g_free);
+ core->required_plugins = NULL;
- if (core->optional_plugins) {
- g_list_foreach (core->optional_plugins, (GFunc) g_free, NULL);
- g_list_free (core->optional_plugins);
- core->optional_plugins = NULL;
- }
+ g_list_free_full (core->optional_plugins, g_free);
+ core->optional_plugins = NULL;
core->shutdown_done = TRUE;
}
diff --git a/src/plugins/profile/plugin.c b/src/plugins/profile/plugin.c
index 4b60dfe..b4ee4e0 100644
--- a/src/plugins/profile/plugin.c
+++ b/src/plugins/profile/plugin.c
@@ -634,8 +634,7 @@ N_PLUGIN_UNLOAD (plugin)
g_free (file_search_path);
g_list_free_full (sound_levels, sound_levels_free_cb);
g_hash_table_destroy (profile_entries);
- g_list_foreach (request_keys, (GFunc) g_free, NULL);
- g_list_free (request_keys);
+ g_list_free_full (request_keys, g_free);
(void) plugin;
}
diff --git a/src/plugins/transform/plugin.c b/src/plugins/transform/plugin.c
index df01d71..e3df2ce 100644
--- a/src/plugins/transform/plugin.c
+++ b/src/plugins/transform/plugin.c
@@ -233,11 +233,8 @@ N_PLUGIN_UNLOAD (plugin)
{
(void) plugin;
- if (transform_allowed_keys) {
- g_list_foreach (transform_allowed_keys, (GFunc) g_free, NULL);
- g_list_free (transform_allowed_keys);
- transform_allowed_keys = NULL;
- }
+ g_list_free_full (transform_allowed_keys, g_free);
+ transform_allowed_keys = NULL;
g_hash_table_destroy (transform_key_map);
transform_key_map = NULL;
--
2.19.1
[Unit]
Description=Non Graphical Feedback Daemon
Requires=dbus.socket
ConditionUser=!root
[Service]
Type=simple
......
......@@ -8,7 +8,8 @@ SRC_URI = "git://git.merproject.org/mer-core/ngfd.git;protocol=https \
file://ngfd.service \
file://events.d/ \
file://50-ffmemless.ini \
file://0002-ffmemless-Reserve-enough-space-for-sprintf.patch"
file://0002-ffmemless-Reserve-enough-space-for-sprintf.patch \
file://0003-Use-g_list_free_full-as-an-alternative-to-g_list_for.patch"
SRCREV = "f400b0ade5ca13af7d7cca8d360117ca0b60f112"
PR = "r1"
PV = "+git${SRCPV}"
......@@ -25,10 +26,10 @@ do_install_append() {
cp ../ngfd.ini ${D}/usr/share/ngfd/ngfd.ini
install -d ${D}/usr/lib/systemd/user/
install -d ${D}/home/ceres/.config/systemd/user/default.target.wants/
install -d ${D}/usr/lib/systemd/user/default.target.wants/
cp ../ngfd.service ${D}/usr/lib/systemd/user/
if [ ! -f ${D}/home/ceres/.config/systemd/user/default.target.wants/ngfd.service ]; then
ln -s /usr/lib/systemd/user/ngfd.service ${D}/home/ceres/.config/systemd/user/default.target.wants/ngfd.service
if [ ! -f ${D}/usr/lib/systemd/user/default.target.wants/ngfd.service ]; then
ln -s /usr/lib/systemd/user/ngfd.service ${D}/usr/lib/systemd/user/default.target.wants/ngfd.service
fi
rm -r ${D}/usr/share/ngfd/events.d/
......@@ -42,4 +43,4 @@ do_install_append() {
inherit autotools pkgconfig
FILES_${PN}-dbg += "/usr/lib/ngf/.debug/"
FILES_${PN} += "/usr/lib/ngf /usr/share/dbus-1 /usr/lib/systemd/ /usr/share/sounds/ /home/ceres/.config/systemd/user/default.target.wants/"
FILES_${PN} += "/usr/lib/ngf /usr/share/dbus-1 /usr/lib/systemd/ /usr/share/sounds/ /usr/lib/systemd/user/default.target.wants/"
[Unit]
Description=StateFS FUSE filesystem
# statefs has not this dependency but some providers has
# TODO: make it smarter, maybe it is possible to make
# this dependency conditional
Requires=dbus.socket
ConditionUser=!root
[Service]
EnvironmentFile=/etc/sysconfig/statefs/session*.conf
ExecStartPre=/usr/bin/statefs-prerun
ExecStart=/usr/bin/statefs ${XDG_RUNTIME_DIR}/state -f -o allow_other,default_permissions,file_umask=${STATEFS_UMASK}
Restart=always
RestartSec=1
[Install]
WantedBy=pre-user-session.target
......@@ -3,7 +3,8 @@ HOMEPAGE = "https://git.merproject.org/mer-core/statefs"
LICENSE = "LGPL-2.1+"
LIC_FILES_CHKSUM = "file://LICENSE;md5=f16c63ad20517dd81888a9ee32c4a0d4"
SRC_URI = "git://git.merproject.org/mer-core/statefs.git;protocol=https"
SRC_URI = "git://git.merproject.org/mer-core/statefs.git;protocol=https \
file://statefs.service"
SRCREV = "ef73da6fc0721eebedc25c5a7d09ee4b5dc3ba85"
PR = "r1"
PV = "+git${SRCPV}"
......@@ -19,6 +20,7 @@ B = "${WORKDIR}/git"
do_configure_prepend() {
sed -i "/examples/d" CMakeLists.txt
cp ${WORKDIR}/statefs.service ${S}/statefs.service
}
do_install_append() {
......@@ -32,10 +34,10 @@ do_install_append() {
install -d ${D}/lib/systemd/system/multi-user.target.wants/
install -d ${D}/usr/lib/systemd/user/
install -d ${D}/home/ceres/.config/systemd/user/default.target.wants/
install -d ${D}/usr/lib/systemd/user/default.target.wants/
mv ${D}/usr/lib/systemd/system/statefs-system.service ${D}/lib/systemd/system/statefs-system.service
if [ ! -f ${D}/home/ceres/.config/systemd/user/default.target.wants/statefs.service ]; then
ln -s /usr/lib/systemd/user/statefs.service ${D}/home/ceres/.config/systemd/user/default.target.wants/statefs.service
if [ ! -f ${D}/usr/lib/systemd/user/default.target.wants/statefs.service ]; then
ln -s /usr/lib/systemd/user/statefs.service ${D}/usr/lib/systemd/user/default.target.wants/statefs.service
fi
if [ ! -f ${D}/lib/systemd/system/multi-user.target.wants/statefs-system.service ]; then
ln -s /lib/systemd/system/statefs-system.service ${D}/lib/systemd/system/multi-user.target.wants/statefs-system.service
......@@ -57,5 +59,5 @@ pkg_postinst_ontarget_${PN}() {
/usr/lib/statefs/provider-action register /etc/timed-statefs.conf inout
}
FILES_${PN} += "/lib/systemd/ /usr/lib/systemd /var/lib/statefs/ /etc/sysconfig/statefs/ /home/ceres/.config/systemd/user/default.target.wants/"
FILES_${PN} += "/lib/systemd/ /usr/lib/systemd /var/lib/statefs/ /etc/sysconfig/statefs/ /usr/lib/systemd/user/default.target.wants/"
FILES_${PN}-dbg += "/opt/"
[Unit]
Description=Time Daemon
Requires=dbus.socket
After=dbus.socket
ConditionUser=!root
# Service type should be dbus, but timed dbus API is on the system bus, which systemd does not detect
[Service]
Type=notify
ExecStart=/usr/bin/timed-qt5 --systemd
Restart=always
RestartSec=1
[Install]
WantedBy=pre-user-session.target
......@@ -5,7 +5,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
SRC_URI = "git://git.merproject.org/mer-core/timed.git;protocol=https \
file://0001-Fixes-build.patch \
file://timed-qt5.conf"
file://timed-qt5.conf \
file://timed-qt5.service"
SRCREV = "c7c1380fcc72390d59f1dc3e01b0cff29207f293"
PR = "r1"
PV = "+git${SRCPV}"
......@@ -19,12 +20,13 @@ do_configure_prepend() {
mkdir -p src/h/timed-qt5/
cp src/lib/qmacro.h src/h/timed-qt5/qmacro.h
sed -i "s@<policy user=\"nemo\">@<policy user=\"ceres\">@" src/server/timed-qt5.conf src/server/timed.conf tests/ut_networktime/fakeofono/org.fakeofono.conf
cp ${WORKDIR}/timed-qt5.service ${S}/src/server/timed-qt5.service
}
do_install_append() {
install -d ${D}/home/ceres/.config/systemd/user/default.target.wants/
if [ ! -f ${D}/home/ceres/.config/systemd/user/default.target.wants/timed-qt5.service ]; then
ln -s /usr/lib/systemd/user/timed-qt5.service ${D}/home/ceres/.config/systemd/user/default.target.wants/timed-qt5.service
install -d ${D}/usr/lib/systemd/user/default.target.wants/
if [ ! -f ${D}/usr/lib/systemd/user/default.target.wants/timed-qt5.service ]; then
ln -s /usr/lib/systemd/user/timed-qt5.service ${D}/usr/lib/systemd/user/default.target.wants/timed-qt5.service
fi
install -d ${D}/var/lib/timed/
ln -s /usr/share/zoneinfo/Etc/GMT ${D}/var/lib/timed/localtime
......@@ -37,7 +39,7 @@ pkg_postinst_ontarget_${PN}() {
DEPENDS += "pcre systemd tzdata libiodata-native libiodata statefs-qt qtbase tzdata-timed"
RDEPENDS_${PN} += "tzdata-timed libcap-bin tzdata"
FILES_${PN} += "/usr/lib/ /usr/share/contextkit /home/ceres/.config/systemd/user/default.target.wants/"
FILES_${PN} += "/usr/lib/ /usr/share/contextkit /usr/lib/systemd/user/default.target.wants/"
FILES_${PN}-dev += "/usr/share/mkspecs"
FILES_${PN}-dbg += "/opt"
INSANE_SKIP_${PN} += "dev-deps"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment