[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] 3 commits: daemon: Add "stop" argument to start-pulseaudio-x11 script
PulseAudio Marge Bot
gitlab at gitlab.freedesktop.org
Mon Jan 18 15:26:14 UTC 2021
PulseAudio Marge Bot pushed to branch master at PulseAudio / pulseaudio
Commits:
877889da by Carlos Garnacho at 2021-01-18T15:20:19+00:00
daemon: Add "stop" argument to start-pulseaudio-x11 script
As contradicting as it sounds, seems better than changing the script
name. This "stop" argument makes it unload all X11 related modules,
as opposed to the default behavior.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/467>
- - - - -
a155cf8c by Carlos Garnacho at 2021-01-18T15:20:19+00:00
daemon: Install start-pulseadio-x11 as a Xwayland-session.d script
The scripts in this directory are loaded (in GNOME sessions thus far)
at the time of starting Xwayland for X11 clients (may happen on session
start, or on demand whenever X11 clients are started).
This will ensure the relevant X11 modules are loaded as long as there's
a Xwayland instance, thus X11 clients that might make use of them.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/467>
- - - - -
4868fcf5 by Carlos Garnacho at 2021-01-18T15:20:19+00:00
daemon: Rely on systemd unit file for X11 plugin initialization
For GNOME X11 sessions, avoid relying on xdg autostart desktop files
to initialize the X11 plugins. This is now handled via a systemd unit
file.
The xdg autostart is still installed, but has been made to instruct
GNOME to skip it with X-GNOME-HiddenUnderSystemd. This is still the
primary way to initialize X11 plugins for other DEs.
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/467>
- - - - -
4 changed files:
- src/daemon/meson.build
- src/daemon/pulseaudio.desktop.in
- src/daemon/start-pulseaudio-x11.in
- + src/daemon/systemd/user/pulseaudio-x11.service.in
Changes:
=====================================
src/daemon/meson.build
=====================================
@@ -47,6 +47,14 @@ if x11_dep.found()
install_dir : bindir,
)
+ configure_file(
+ input : 'start-pulseaudio-x11.in',
+ output : '00-pulseaudio-x11',
+ configuration : conf,
+ install : true,
+ install_dir : join_paths(sysconfdir, 'xdg', 'Xwayland-session.d'),
+ )
+
desktop_file = i18n.merge_file(
input : 'pulseaudio.desktop.in',
output : 'pulseaudio.desktop',
@@ -144,6 +152,8 @@ endif
if systemd_dep.found()
sd_user_service_conf = configuration_data()
sd_user_service_conf.set('PA_BINARY', cdata.get_unquoted('PA_BINARY'))
+ sd_user_service_conf.set('PACTL_BINARY', join_paths(bindir, 'pactl'))
+ sd_user_service_conf.set('PA_X11_BINARY', join_paths(bindir, 'start-pulseaudio-x11'))
sd_user_service_file = configure_file(
input : 'systemd/user/pulseaudio.service.in',
@@ -153,6 +163,14 @@ if systemd_dep.found()
install_dir : systemduserunitdir,
)
+ sd_user_x11_service_file = configure_file(
+ input : 'systemd/user/pulseaudio-x11.service.in',
+ output : 'pulseaudio-x11.service',
+ configuration : sd_user_service_conf,
+ install : true,
+ install_dir : systemduserunitdir,
+ )
+
install_data('systemd/user/pulseaudio.socket',
install_dir: systemduserunitdir,
)
=====================================
src/daemon/pulseaudio.desktop.in
=====================================
@@ -6,4 +6,5 @@ Exec=start-pulseaudio-x11
Terminal=false
Type=Application
X-GNOME-Autostart-Phase=Initialization
+X-GNOME-HiddenUnderSystemd=true
X-KDE-autostart-phase=1
=====================================
src/daemon/start-pulseaudio-x11.in
=====================================
@@ -17,6 +17,25 @@
set -e
+if [ -n "$1" ] ; then
+ case $1 in
+ stop)
+ @PACTL_BINARY@ unload-module module-x11-publish > /dev/null
+ @PACTL_BINARY@ unload-module module-x11-cork-request > /dev/null
+ @PACTL_BINARY@ unload-module module-device-manager > /dev/null
+ @PACTL_BINARY@ unload-module module-x11-xsmp > /dev/null
+ exit 0
+ ;;
+ start)
+ # Let it continue further down
+ ;;
+ *)
+ echo "Unknown argument $1"
+ exit 1
+ ;;
+ esac
+fi
+
if [ x"$DISPLAY" != x ] ; then
@PACTL_BINARY@ load-module module-x11-publish "display=$DISPLAY xauthority=$XAUTHORITY" > /dev/null
=====================================
src/daemon/systemd/user/pulseaudio-x11.service.in
=====================================
@@ -0,0 +1,18 @@
+[Unit]
+Description=Sound Service (X11 Plugins)
+Requires=pulseaudio.service
+After=pulseaudio.service
+ConditionUser=!root
+PartOf=gnome-session-x11.target
+
+[Service]
+ExecStart=@PA_X11_BINARY@
+ExecStop=@PA_X11_BINARY@ stop
+LockPersonality=yes
+MemoryDenyWriteExecute=yes
+NoNewPrivileges=yes
+RestrictNamespaces=yes
+SystemCallArchitectures=native
+SystemCallFilter=@system-service
+Type=simple
+UMask=0077
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/compare/4f821adb550cfbe35ce3c5907bc4361caf09e150...4868fcf5f344af613172f61d9105c02f3f07e1ab
--
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/compare/4f821adb550cfbe35ce3c5907bc4361caf09e150...4868fcf5f344af613172f61d9105c02f3f07e1ab
You're receiving this email because of your account on gitlab.freedesktop.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20210118/3d55c2b2/attachment-0001.htm>
More information about the pulseaudio-commits
mailing list