alsactl/alsactl
alsactl/alsactl_init.7
+alsactl/alsa-state.service
alsaconf/alsaconf
alsamixer/alsamixer
amidi/amidi
ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", KERNELS=="card*", \
- RUN+="@sbindir@/alsactl restore $attr{number}"
+ RUN+="@sbindir@/alsactl nrestore $attr{number}"
EXTRA_DIST=alsactl.1 alsactl_init.xml
alsactl_SOURCES=alsactl.c state.c lock.c utils.c init_parse.c daemon.c
-alsactl_CFLAGS=$(AM_CFLAGS) -DSYS_ASOUNDRC=\"$(ASOUND_STATE_DIR)/asound.state\"
+alsactl_CFLAGS=$(AM_CFLAGS) -DSYS_ASOUNDRC=\"$(ASOUND_STATE_DIR)/asound.state\" -DSYS_PIDFILE=\"$(ALSACTL_PIDFILE_DIR)/alsactl.pid\"
noinst_HEADERS=alsactl.h list.h init_sysdeps.c init_utils_string.c init_utils_run.c init_sysfs.c
dist_udevrules_DATA = \
if HAVE_SYSTEMD
systemdsystemunit_DATA = \
- alsa-store.service \
- alsa-restore.service
+ alsa-state.service
install-data-hook:
$(MKDIR_P) -m 0755 \
edit = \
$(SED) -r 's,@sbindir\@,$(sbindir),g' < $< > $@ || rm $@
-alsa-store.service: alsa-store.service.in
- $(edit)
-
-alsa-restore.service: alsa-restore.service.in
+alsa-state.service: alsa-state.service.in
$(edit)
90-alsa-restore.rules: 90-alsa-restore.rules.in
$(edit)
EXTRA_DIST += \
- alsa-store.service.in \
- alsa-restore.service.in \
+ alsa-state.service.in \
90-alsa-restore.rules.in
CLEANFILES = \
- alsa-store.service \
- alsa-restore.service \
+ alsa-state.service \
90-alsa-restore.rules
%.7: %.xml
+++ /dev/null
-[Unit]
-Description=Restore Sound Card State
-DefaultDependencies=no
-After=sysinit.target
-Before=shutdown.target
-Conflicts=shutdown.target
-
-[Service]
-Type=oneshot
-ExecStart=-@sbindir@/alsactl restore
-StandardOutput=syslog
--- /dev/null
+[Unit]
+Description=Manage Sound Card State (restore and store)
+DefaultDependencies=no
+After=sysinit.target
+Before=shutdown.target
+Conflicts=shutdown.target
+
+[Service]
+Type=simple
+ExecStart=-@sbindir@/alsactl -s rdaemon
+ExecStop=-@sbindir@/alsactl -s rkill save_and_quit
+++ /dev/null
-[Unit]
-Description=Store Sound Card State
-DefaultDependencies=no
-Before=shutdown.target
-
-[Service]
-Type=oneshot
-ExecStart=@sbindir@/alsactl store
-StandardOutput=syslog
int init_fallback = 1; /* new default behavior */
int period = 5*60;
int background = 0;
+ int daemoncmd = 0;
struct arg *a;
struct option *o;
int i, j, k, res;
if ((a->sarg & 0xff) == 0)
continue;
o = &long_option[j];
- o->name = args->larg;
+ o->name = a->larg;
o->has_arg = (a->sarg & (ENVARG|FILEARG|INTARG)) != 0;
o->flag = NULL;
o->val = a->sarg & 0xff;
daemon(0, 0);
}
+ cmd = argv[optind];
+ daemoncmd = strcmp(cmd, "daemon") == 0 || strcmp(cmd, "rdaemon") == 0;
+
if (use_syslog) {
openlog("alsactl", LOG_CONS|LOG_PID, LOG_DAEMON);
- syslog(LOG_INFO, "alsactl " SND_UTIL_VERSION_STR " daemon started");
+ if (daemoncmd)
+ syslog(LOG_INFO, "alsactl " SND_UTIL_VERSION_STR " daemon started");
}
- cmd = argv[optind];
if (!strcmp(cmd, "init")) {
res = init(initfile, cardname);
snd_config_update_free_global();
snd_config_update_free_global();
if (use_syslog) {
- syslog(LOG_INFO, "alsactl daemon stopped");
+ if (daemoncmd)
+ syslog(LOG_INFO, "alsactl daemon stopped");
closelog();
}
return res < 0 ? -res : 0;
[ASOUND_STATE_DIR="/var/lib/alsa"])
AC_SUBST(ASOUND_STATE_DIR)
+AC_ARG_WITH([alsactl-pidfile-dir],
+ AS_HELP_STRING([--with-alsactl-pidfile-dir=DIR], [Directory to place alsactl.pid file in]),
+ [ALSACTL_PIDFILE_DIR="$withval"],
+ [ALSACTL_PIDFILE_DIR="/var/run"])
+AC_SUBST(ALSACTL_PIDFILE_DIR)
+
AC_OUTPUT(Makefile alsactl/Makefile alsactl/init/Makefile \
alsamixer/Makefile amidi/Makefile amixer/Makefile \
m4/Makefile po/Makefile.in \