summaryrefslogtreecommitdiffstats
path: root/src/daemon/cmdline.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-08-06 19:39:12 +0200
committerLennart Poettering <lennart@poettering.net>2008-08-06 19:39:12 +0200
commit756fac8d0433d02819d3910238ebf1b7a33a3046 (patch)
tree92da910d93ed3741d2629ea124f009546bcc629e /src/daemon/cmdline.c
parentf1d2bf84089b1e5b5988a5e5d6d571a507a52337 (diff)
add new switch --disallow-exit
Diffstat (limited to 'src/daemon/cmdline.c')
-rw-r--r--src/daemon/cmdline.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/daemon/cmdline.c b/src/daemon/cmdline.c
index 3121da60..fbd6dc32 100644
--- a/src/daemon/cmdline.c
+++ b/src/daemon/cmdline.c
@@ -50,6 +50,7 @@ enum {
ARG_HIGH_PRIORITY,
ARG_REALTIME,
ARG_DISALLOW_MODULE_LOADING,
+ ARG_DISALLOW_EXIT,
ARG_EXIT_IDLE_TIME,
ARG_MODULE_IDLE_TIME,
ARG_SCACHE_IDLE_TIME,
@@ -82,6 +83,7 @@ static const struct option long_options[] = {
{"high-priority", 2, 0, ARG_HIGH_PRIORITY},
{"realtime", 2, 0, ARG_REALTIME},
{"disallow-module-loading", 2, 0, ARG_DISALLOW_MODULE_LOADING},
+ {"disallow-exit", 2, 0, ARG_DISALLOW_EXIT},
{"exit-idle-time", 2, 0, ARG_EXIT_IDLE_TIME},
{"module-idle-time", 2, 0, ARG_MODULE_IDLE_TIME},
{"scache-idle-time", 2, 0, ARG_SCACHE_IDLE_TIME},
@@ -134,7 +136,9 @@ void pa_cmdline_help(const char *argv0) {
" --realtime[=BOOL] Try to enable realtime scheduling\n"
" (only available as root, when SUID or\n"
" with elevated RLIMIT_RTPRIO)\n"
- " --disallow-module-loading[=BOOL] Disallow module loading after startup\n"
+ " --disallow-module-loading[=BOOL] Disallow module user requested module\n"
+ " loading/unloading after startup\n"
+ " --disallow-exit[=BOOL] Disallow user requested exit\n"
" --exit-idle-time=SECS Terminate the daemon when idle and this\n"
" time passed\n"
" --module-idle-time=SECS Unload autoloaded modules when idle and\n"
@@ -286,6 +290,13 @@ int pa_cmdline_parse(pa_daemon_conf *conf, int argc, char *const argv [], int *d
}
break;
+ case ARG_DISALLOW_EXIT:
+ if ((conf->disallow_exit = optarg ? pa_parse_boolean(optarg) : TRUE) < 0) {
+ pa_log(_("--disallow-exit boolean argument"));
+ goto fail;
+ }
+ break;
+
case ARG_USE_PID_FILE:
if ((conf->use_pid_file = optarg ? pa_parse_boolean(optarg) : TRUE) < 0) {
pa_log(_("--use-pid-file expects boolean argument"));