~mil/sxmo-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH sxmo-utils] avoid conflicting with systemd services

Details
Message ID
<20220515210310.143531-1-aren@peacevolution.org>
DKIM signature
pass
Download raw message
Patch: +30 -12
Arch, Debian, and probably most other systemd based ditros, enable
pipewire / mmsd / vvmd by default. If we start them with superd either
it or systemd will think the services failed to start.

If we want to manage these services (e.g. mmsdconfig & vvmdconfig) we
need to know which service manager is being used, to do this we should
allow systemd to manage the service because we can't easily disable it.

Also rename the mmsd service to mmsd-tng; most distributions use
mmsd-tng for the service name, following this will make it easier to
integrate with them.
---
depends on https://lists.sr.ht/~mil/sxmo-devel/patches/32303

 configs/default_hooks/sxmo_hook_start.sh      | 22 ++++++++++++-------
 .../{mmsd.service => mmsd-tng.service}        |  0
 scripts/core/sxmo_mmsdconfig.sh               | 10 +++++++--
 scripts/core/sxmo_vvmdconfig.sh               | 10 +++++++--
 4 files changed, 30 insertions(+), 12 deletions(-)
 rename configs/superd/services/{mmsd.service => mmsd-tng.service} (100%)

diff --git a/configs/default_hooks/sxmo_hook_start.sh b/configs/default_hooks/sxmo_hook_start.sh
index 277646a..79612ea 100644
--- a/configs/default_hooks/sxmo_hook_start.sh
+++ b/configs/default_hooks/sxmo_hook_start.sh
@@ -46,12 +46,15 @@ case "$SXMO_WM" in
		;;
esac

if [ -f "${SXMO_MMS_BASE_DIR:-"$HOME"/.mms/modemmanager}/mms" ]; then
	superctl start mmsd
fi
# Systemd runs these by default, don't conflict
if ! command -v systemctl > /dev/null; then
	if [ -f "${SXMO_MMS_BASE_DIR:-"$HOME"/.mms/modemmanager}/mms" ]; then
		superctl start mmsd-tng
	fi

if [ -f "${SXMO_VVM_BASE_DIR:-"$HOME"/.vvm/modemmanager}/vvm" ]; then
	superctl start vvmd
	if [ -f "${SXMO_VVM_BASE_DIR:-"$HOME"/.vvm/modemmanager}/vvm" ]; then
		superctl start vvmd
	fi
fi

# Start the desktop widget (e.g. clock)
@@ -74,9 +77,12 @@ superctl start sxmo_notificationmonitor
# To setup initial lock state
sxmo_hook_unlock.sh

superctl start pipewire
superctl start pipewire-pulse
superctl start wireplumber
# Systemd runs these by default, don't conflict
if ! command -v systemctl > /dev/null; then
	superctl start pipewire
	superctl start pipewire-pulse
	superctl start wireplumber
fi

# Verify modemmanager and eg25-manager are running
if ! sxmo_modemdaemons.sh status; then
diff --git a/configs/superd/services/mmsd.service b/configs/superd/services/mmsd-tng.service
similarity index 100%
rename from configs/superd/services/mmsd.service
rename to configs/superd/services/mmsd-tng.service
diff --git a/scripts/core/sxmo_mmsdconfig.sh b/scripts/core/sxmo_mmsdconfig.sh
index 78d9378..aea0c45 100644
--- a/scripts/core/sxmo_mmsdconfig.sh
+++ b/scripts/core/sxmo_mmsdconfig.sh
@@ -75,10 +75,16 @@ newfile() {

mkdir -p "$MMS_BASE_DIR"

superctl stop mmsd
if command -v systemctl > /dev/null; then
	SERVICE="systemctl --user"
else
	SERVICE=superctl
fi

$SERVICE stop mmsd-tng

finish() {
	superctl start mmsd
	$SERVICE start mmsd-tng
}
trap 'finish' EXIT

diff --git a/scripts/core/sxmo_vvmdconfig.sh b/scripts/core/sxmo_vvmdconfig.sh
index ab14e4e..335b595 100644
--- a/scripts/core/sxmo_vvmdconfig.sh
+++ b/scripts/core/sxmo_vvmdconfig.sh
@@ -65,10 +65,16 @@ newfile() {

mkdir -p "$VVM_BASE_DIR"

superctl stop vvmd
if command -v systemctl > /dev/null; then
	SERVICE="systemctl --user"
else
	SERVICE=superctl
fi

$SERVICE stop vvmd

finish() {
	superctl start vvmd
	$SERVICE start vvmd
}
trap 'finish' EXIT

-- 
2.36.1

[sxmo-utils/patches/.build.yml] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CK0N1VDFW16A.NE4XNDQEB5EQ@cirno2>
In-Reply-To
<20220515210310.143531-1-aren@peacevolution.org> (view parent)
DKIM signature
missing
Download raw message
sxmo-utils/patches/.build.yml: SUCCESS in 27s

[avoid conflicting with systemd services][0] from [ArenM][1]

[0]: https://lists.sr.ht/~mil/sxmo-devel/patches/32304
[1]: aren@peacevolution.org

✓ #758949 SUCCESS sxmo-utils/patches/.build.yml https://builds.sr.ht/~mil/job/758949
Details
Message ID
<3F4QCH7LZLL3C.2GZLGTSFB1MS0@stacyharper.net>
In-Reply-To
<20220515210310.143531-1-aren@peacevolution.org> (view parent)
DKIM signature
pass
Download raw message
> Arch, Debian, and probably most other systemd based ditros, enable
> pipewire / mmsd / vvmd by default. If we start them with superd either
> it or systemd will think the services failed to start.

Arch, Debian and probably most other systemd based distros have to not
enable systemd daemons for things sxmo will manage.

> If we want to manage these services (e.g. mmsdconfig & vvmdconfig) we
> need to know which service manager is being used, to do this we should
> allow systemd to manage the service because we can't easily disable it.

Not we support superd and not systemd. Yes it is easily to disable
systemd daemons.

> Also rename the mmsd service to mmsd-tng; most distributions use
> mmsd-tng for the service name, following this will make it easier to
> integrate with them.

If we want to integrate with them.

I'm sorry I reject this patch. We dont want to support other service
managers. User can either disable the system provided manager or edit
their hooks. There is enough good alternative in my opinion.

Anyway thanks for trying :D
Reply to thread Export thread (mbox)