mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-12-23 00:06:30 +01:00
7d6673cc13
With RemainAfterExit=true, we can manage both save and restore of the card state in a single unit file. This will fix also the case where systemd reloads the service; with two individual units, it will restore the previous state before saving, and may lead to inconsistent state suddenly. Also fix alsa-state.service as well to make both start and stop working in a simpler way. Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=929619 Signed-off-by: Takashi Iwai <tiwai@suse.de>
17 lines
446 B
SYSTEMD
17 lines
446 B
SYSTEMD
#
|
|
# Note that two different ALSA card state management schemes exist and they
|
|
# can be switched using a file exist check - /etc/alsa/state-daemon.conf .
|
|
#
|
|
|
|
[Unit]
|
|
Description=Save/Restore Sound Card State
|
|
ConditionPathExists=!@daemonswitch@
|
|
ConditionPathExistsGlob=/dev/snd/control*
|
|
After=alsa-state.service
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
RemainAfterExit=true
|
|
ExecStart=-@sbindir@/alsactl restore
|
|
ExecStop=-@sbindir@/alsactl store
|
|
StandardOutput=syslog
|