summaryrefslogtreecommitdiffstats
path: root/src/daemon/cmdline.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-06-11 17:38:50 +0000
committerLennart Poettering <lennart@poettering.net>2008-06-11 17:38:50 +0000
commitac0f5275c5cbe72d5c81d9bb4aed4b9c2a5f5802 (patch)
tree7992890250cc83a91ad030768c8e54aa5c16bfb0 /src/daemon/cmdline.c
parentc33db3ce68197cfe93f1fdf1b6459b1c7afb9057 (diff)
add new switch --start to the PA binary which allows starting PA if it is not running yet. In contrast to normal startup an already running PA will not be considered an error. Also, take the autospawn lock so we can guarantee that after this call returns PA is ralive and running
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2513 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/daemon/cmdline.c')
-rw-r--r--src/daemon/cmdline.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/daemon/cmdline.c b/src/daemon/cmdline.c
index 97c75f37..03b1ac78 100644
--- a/src/daemon/cmdline.c
+++ b/src/daemon/cmdline.c
@@ -66,7 +66,8 @@ enum {
ARG_DISABLE_SHM,
ARG_DUMP_RESAMPLE_METHODS,
ARG_SYSTEM,
- ARG_CLEANUP_SHM
+ ARG_CLEANUP_SHM,
+ ARG_START
};
/* Tabel for getopt_long() */
@@ -91,6 +92,7 @@ static const struct option long_options[] = {
{"dl-search-path", 1, 0, ARG_DL_SEARCH_PATH},
{"resample-method", 1, 0, ARG_RESAMPLE_METHOD},
{"kill", 0, 0, ARG_KILL},
+ {"start", 0, 0, ARG_START},
{"use-pid-file", 2, 0, ARG_USE_PID_FILE},
{"check", 0, 0, ARG_CHECK},
{"system", 2, 0, ARG_SYSTEM},
@@ -119,6 +121,7 @@ void pa_cmdline_help(const char *argv0) {
" --dump-modules Dump list of available modules\n"
" --dump-resample-methods Dump available resample methods\n"
" --cleanup-shm Cleanup stale shared memory segments\n"
+ " --start Start the daemon if it is not running\n"
" -k --kill Kill a running daemon\n"
" --check Check for a running daemon\n\n"
@@ -207,6 +210,11 @@ int pa_cmdline_parse(pa_daemon_conf *conf, int argc, char *const argv [], int *d
conf->cmd = PA_CMD_KILL;
break;
+ case ARG_START:
+ conf->cmd = PA_CMD_START;
+ conf->daemonize = TRUE;
+ break;
+
case ARG_CHECK:
conf->cmd = PA_CMD_CHECK;
break;