alsa-utils/alsactl/alsa-state.service.in
Takashi Iwai 7d6673cc13 alsactl: Manage both save and restore in a single unit
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>
2015-09-29 17:54:17 +02:00

15 lines
397 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=Manage Sound Card State (restore and store)
ConditionPathExists=@daemonswitch@
After=sysinit.target
[Service]
Type=simple
ExecStart=-@sbindir@/alsactl -s -n 19 -c rdaemon
ExecStop=-@sbindir@/alsactl -s kill save_and_quit