mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-09-07 20:35:42 +02:00
alsactl: Move systemd unit start-up from basic.target to sound.target
Ensures soundcard is ready before restoring state. sound.target added to systemd in v18: https://cgit.freedesktop.org/systemd/systemd/commit/?id=88dfa2938af Simplify dependencies: - After=alsa-state.service is not needed because both units test for @daemonswitch@ with opposite outcomes. - After=sysinit.target is automatically added by systemd. First proposed by Tom Yan. Signed-off-by: Chris Mayo <aklhfex@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
dbd4fc84f8
commit
f72a296d23
5 changed files with 10 additions and 5 deletions
3
INSTALL
3
INSTALL
|
@ -10,6 +10,9 @@ the develop package additionally to link with this library.
|
|||
|
||||
alsaconf requires dialog or whiptail program to run properly.
|
||||
|
||||
If systemd (minimum version 18) is installed it will be used to run
|
||||
alsactl to store and restore settings.
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@ systemdsystemunit_DATA = \
|
|||
|
||||
install-data-hook:
|
||||
$(MKDIR_P) -m 0755 \
|
||||
$(DESTDIR)$(systemdsystemunitdir)/basic.target.wants
|
||||
( cd $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants && \
|
||||
$(DESTDIR)$(systemdsystemunitdir)/sound.target.wants
|
||||
( cd $(DESTDIR)$(systemdsystemunitdir)/sound.target.wants && \
|
||||
rm -f alsa-state.service alsa-restore.service && \
|
||||
$(LN_S) ../alsa-state.service alsa-state.service && \
|
||||
$(LN_S) ../alsa-restore.service alsa-restore.service)
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
Description=Save/Restore Sound Card State
|
||||
ConditionPathExists=!@daemonswitch@
|
||||
ConditionPathExistsGlob=/dev/snd/control*
|
||||
After=alsa-state.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
[Unit]
|
||||
Description=Manage Sound Card State (restore and store)
|
||||
ConditionPathExists=@daemonswitch@
|
||||
After=sysinit.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
|
|
|
@ -383,13 +383,17 @@ SAVE_UTIL_VERSION
|
|||
AC_SUBST(LIBRT)
|
||||
|
||||
dnl Check for systemd
|
||||
PKG_CHECK_MODULES(SYSTEMD, [systemd >= 18],
|
||||
[have_min_systemd="yes"],
|
||||
[have_min_systemd="no"])
|
||||
AC_ARG_WITH([systemdsystemunitdir],
|
||||
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
|
||||
[], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
|
||||
if test "x$with_systemdsystemunitdir" != xno; then
|
||||
AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
|
||||
AM_CONDITIONAL(HAVE_SYSTEMD, [test "$have_min_systemd" = "yes" \
|
||||
-a -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
|
||||
|
||||
AC_ARG_WITH([asound-state-dir],
|
||||
AS_HELP_STRING([--with-asound-state-dir=DIR], [Directory to place asound.state file in]),
|
||||
|
|
Loading…
Reference in a new issue