diff --git a/INSTALL b/INSTALL index d95bb97..5f20814 100644 --- a/INSTALL +++ b/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 ------------ diff --git a/alsactl/Makefile.am b/alsactl/Makefile.am index cac8094..90fab9d 100644 --- a/alsactl/Makefile.am +++ b/alsactl/Makefile.am @@ -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) diff --git a/alsactl/alsa-restore.service.in b/alsactl/alsa-restore.service.in index 2583d4c..80fd5fd 100644 --- a/alsactl/alsa-restore.service.in +++ b/alsactl/alsa-restore.service.in @@ -7,7 +7,6 @@ Description=Save/Restore Sound Card State ConditionPathExists=!@daemonswitch@ ConditionPathExistsGlob=/dev/snd/control* -After=alsa-state.service [Service] Type=oneshot diff --git a/alsactl/alsa-state.service.in b/alsactl/alsa-state.service.in index f1321d6..5a8fe5e 100644 --- a/alsactl/alsa-state.service.in +++ b/alsactl/alsa-state.service.in @@ -6,7 +6,6 @@ [Unit] Description=Manage Sound Card State (restore and store) ConditionPathExists=@daemonswitch@ -After=sysinit.target [Service] Type=simple diff --git a/configure.ac b/configure.ac index 0ff4fad..a755e47 100644 --- a/configure.ac +++ b/configure.ac @@ -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]),