* [PATCH] alsactl: Make homedir configurable
@ 2016-12-27 16:15 Paul Menzel
2016-12-28 16:06 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Paul Menzel @ 2016-12-27 16:15 UTC (permalink / raw)
To: alsa-devel; +Cc: Jordi Mallach
[-- Attachment #1.1: Type: text/plain, Size: 3650 bytes --]
Date: Sat, 19 Oct 2013 10:12:19 +0000
Add new configure switch to set alsactl's homedir. This is used to avoid
that a directory `.pulse` is created by the init script, when PulseAudio
is installed [1].
[1] https://bugs.debian.org/712980
"alsa-utils startup script creates /.pulse files ("Failed to create
secure directory") when pulseaudio is installed"
CC: Jordi Mallach <jordi@debian.org>
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
---
Please apply with `git am saved-messages.mbox`.
alsactl/90-alsa-restore.rules.in | 4 ++--
alsactl/Makefile.am | 1 +
alsactl/alsa-restore.service.in | 4 ++--
alsactl/alsa-state.service.in | 4 ++--
configure.ac | 6 ++++++
5 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/alsactl/90-alsa-restore.rules.in b/alsactl/90-alsa-restore.rules.in
index c0c1b23..95b26c4 100644
--- a/alsactl/90-alsa-restore.rules.in
+++ b/alsactl/90-alsa-restore.rules.in
@@ -2,7 +2,7 @@ ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", KERNELS!="card*", TEST==
GOTO="alsa_restore_end"
LABEL="alsa_restore_go"
-TEST!="@daemonswitch@", RUN+="@sbindir@/alsactl restore $attr{device/number}"
-TEST=="@daemonswitch@", RUN+="@sbindir@/alsactl nrestore $attr{device/number}"
+TEST!="@daemonswitch@", RUN+="@sbindir@/alsactl -E HOME=@alsactlhome@ restore $attr{device/number}"
+TEST=="@daemonswitch@", RUN+="@sbindir@/alsactl -E HOME=@alsactlhome@ nrestore $attr{device/number}"
LABEL="alsa_restore_end"
diff --git a/alsactl/Makefile.am b/alsactl/Makefile.am
index cac8094..d03137b 100644
--- a/alsactl/Makefile.am
+++ b/alsactl/Makefile.am
@@ -40,6 +40,7 @@ endif
edit = \
$(SED) -r -e 's,@sbindir\@,$(sbindir),g' \
-e 's,@mydatadir\@,$(mydatadir),g' \
+ -e 's,@alsactlhome\@,$(ALSACTL_HOME_DIR),g' \
-e 's,@daemonswitch\@,$(ALSACTL_DAEMONSWITCH),g' \
< $< > $@ || rm $@
diff --git a/alsactl/alsa-restore.service.in b/alsactl/alsa-restore.service.in
index 2884098..23dece8 100644
--- a/alsactl/alsa-restore.service.in
+++ b/alsactl/alsa-restore.service.in
@@ -12,6 +12,6 @@ After=alsa-state.service
[Service]
Type=oneshot
RemainAfterExit=true
-ExecStart=-@sbindir@/alsactl restore
-ExecStop=-@sbindir@/alsactl store
+ExecStart=-@sbindir@/alsactl -E HOME=@alsactlhome@ restore
+ExecStop=-@sbindir@/alsactl -E HOME=@alsactlhome@ store
StandardOutput=syslog
diff --git a/alsactl/alsa-state.service.in b/alsactl/alsa-state.service.in
index f1321d6..28e3043 100644
--- a/alsactl/alsa-state.service.in
+++ b/alsactl/alsa-state.service.in
@@ -10,5 +10,5 @@ After=sysinit.target
[Service]
Type=simple
-ExecStart=-@sbindir@/alsactl -s -n 19 -c rdaemon
-ExecStop=-@sbindir@/alsactl -s kill save_and_quit
+ExecStart=-@sbindir@/alsactl -E HOME=@alsactlhome@ -s -n 19 -c rdaemon
+ExecStop=-@sbindir@/alsactl -E HOME=@alsactlhome@ -s kill save_and_quit
diff --git a/configure.ac b/configure.ac
index 69ff2ab..8cbf798 100644
--- a/configure.ac
+++ b/configure.ac
@@ -409,6 +409,12 @@ AC_ARG_WITH([alsactl-pidfile-dir],
[ALSACTL_PIDFILE_DIR="/var/run"])
AC_SUBST(ALSACTL_PIDFILE_DIR)
+AC_ARG_WITH([alsactl-home-dir],
+ AS_HELP_STRING([--with-alsactl-home-dir=DIR], [Directory to use as homedir for alsactl]),
+ [ALSACTL_HOME_DIR="$withval"],
+ [ALSACTL_HOME_DIR="/var/run/alsa"])
+AC_SUBST(ALSACTL_HOME_DIR)
+
AC_ARG_WITH([alsactl-daemonswitch],
AS_HELP_STRING([--with-alsactl-daemonswitch=FILE], [File to test for the daemon mode]),
[ALSACTL_DAEMONSWITCH="$withval"],
--
2.11.0
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] alsactl: Make homedir configurable
2016-12-27 16:15 [PATCH] alsactl: Make homedir configurable Paul Menzel
@ 2016-12-28 16:06 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2016-12-28 16:06 UTC (permalink / raw)
To: Paul Menzel; +Cc: alsa-devel, Jordi Mallach
On Tue, 27 Dec 2016 17:15:27 +0100,
Paul Menzel wrote:
>
> Date: Sat, 19 Oct 2013 10:12:19 +0000
>
> Add new configure switch to set alsactl's homedir. This is used to avoid
> that a directory `.pulse` is created by the init script, when PulseAudio
> is installed [1].
>
> [1] https://bugs.debian.org/712980
> "alsa-utils startup script creates /.pulse files ("Failed to create
> secure directory") when pulseaudio is installed"
Hrm, how is PA triggered by alsactl?
Overriding $HOME sounds scary to me...
thanks,
Takashi
>
> CC: Jordi Mallach <jordi@debian.org>
> Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
> ---
> Please apply with `git am saved-messages.mbox`.
>
> alsactl/90-alsa-restore.rules.in | 4 ++--
> alsactl/Makefile.am | 1 +
> alsactl/alsa-restore.service.in | 4 ++--
> alsactl/alsa-state.service.in | 4 ++--
> configure.ac | 6 ++++++
> 5 files changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/alsactl/90-alsa-restore.rules.in b/alsactl/90-alsa-restore.rules.in
> index c0c1b23..95b26c4 100644
> --- a/alsactl/90-alsa-restore.rules.in
> +++ b/alsactl/90-alsa-restore.rules.in
> @@ -2,7 +2,7 @@ ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", KERNELS!="card*", TEST==
> GOTO="alsa_restore_end"
>
> LABEL="alsa_restore_go"
> -TEST!="@daemonswitch@", RUN+="@sbindir@/alsactl restore $attr{device/number}"
> -TEST=="@daemonswitch@", RUN+="@sbindir@/alsactl nrestore $attr{device/number}"
> +TEST!="@daemonswitch@", RUN+="@sbindir@/alsactl -E HOME=@alsactlhome@ restore $attr{device/number}"
> +TEST=="@daemonswitch@", RUN+="@sbindir@/alsactl -E HOME=@alsactlhome@ nrestore $attr{device/number}"
>
> LABEL="alsa_restore_end"
> diff --git a/alsactl/Makefile.am b/alsactl/Makefile.am
> index cac8094..d03137b 100644
> --- a/alsactl/Makefile.am
> +++ b/alsactl/Makefile.am
> @@ -40,6 +40,7 @@ endif
> edit = \
> $(SED) -r -e 's,@sbindir\@,$(sbindir),g' \
> -e 's,@mydatadir\@,$(mydatadir),g' \
> + -e 's,@alsactlhome\@,$(ALSACTL_HOME_DIR),g' \
> -e 's,@daemonswitch\@,$(ALSACTL_DAEMONSWITCH),g' \
> < $< > $@ || rm $@
>
> diff --git a/alsactl/alsa-restore.service.in b/alsactl/alsa-restore.service.in
> index 2884098..23dece8 100644
> --- a/alsactl/alsa-restore.service.in
> +++ b/alsactl/alsa-restore.service.in
> @@ -12,6 +12,6 @@ After=alsa-state.service
> [Service]
> Type=oneshot
> RemainAfterExit=true
> -ExecStart=-@sbindir@/alsactl restore
> -ExecStop=-@sbindir@/alsactl store
> +ExecStart=-@sbindir@/alsactl -E HOME=@alsactlhome@ restore
> +ExecStop=-@sbindir@/alsactl -E HOME=@alsactlhome@ store
> StandardOutput=syslog
> diff --git a/alsactl/alsa-state.service.in b/alsactl/alsa-state.service.in
> index f1321d6..28e3043 100644
> --- a/alsactl/alsa-state.service.in
> +++ b/alsactl/alsa-state.service.in
> @@ -10,5 +10,5 @@ After=sysinit.target
>
> [Service]
> Type=simple
> -ExecStart=-@sbindir@/alsactl -s -n 19 -c rdaemon
> -ExecStop=-@sbindir@/alsactl -s kill save_and_quit
> +ExecStart=-@sbindir@/alsactl -E HOME=@alsactlhome@ -s -n 19 -c rdaemon
> +ExecStop=-@sbindir@/alsactl -E HOME=@alsactlhome@ -s kill save_and_quit
> diff --git a/configure.ac b/configure.ac
> index 69ff2ab..8cbf798 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -409,6 +409,12 @@ AC_ARG_WITH([alsactl-pidfile-dir],
> [ALSACTL_PIDFILE_DIR="/var/run"])
> AC_SUBST(ALSACTL_PIDFILE_DIR)
>
> +AC_ARG_WITH([alsactl-home-dir],
> + AS_HELP_STRING([--with-alsactl-home-dir=DIR], [Directory to use as homedir for alsactl]),
> + [ALSACTL_HOME_DIR="$withval"],
> + [ALSACTL_HOME_DIR="/var/run/alsa"])
> +AC_SUBST(ALSACTL_HOME_DIR)
> +
> AC_ARG_WITH([alsactl-daemonswitch],
> AS_HELP_STRING([--with-alsactl-daemonswitch=FILE], [File to test for the daemon mode]),
> [ALSACTL_DAEMONSWITCH="$withval"],
> --
> 2.11.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-12-28 16:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-27 16:15 [PATCH] alsactl: Make homedir configurable Paul Menzel
2016-12-28 16:06 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.