.B \-\-config \fIPATH\fR, \fB\-c \fIPATH
Set the configuration file.
The default is
+given by the
+.B DISORDER_CONFIG
+environment variable, defaulting to
.IR pkgconfdir/config .
.TP
.B \-\-debug\fR, \fB\-d
.B \-\-config \fIPATH\fR, \fB\-c \fIPATH
Set the configuration file.
The default is
+.B DISORDER_CONFIG
+environment variable, defaulting to
.IR /etc/disorder/config .
.TP
.B \-\-no\-setuid
.B \-\-config \fIPATH\fR, \fB\-C \fIPATH
Set the configuration file.
The default is
+given by the
+.B DISORDER_CONFIG
+environment variable, defaulting to
.IR pkgconfdir/config .
.TP
.B \-\-socket \fIPATH\fR, \fB\-s \fIPATH
.B \-\-config \fIPATH\fR, \fB\-c \fIPATH
Set the configuration file.
The default is
+given by the
+.B DISORDER_CONFIG
+environment variable, defaulting to
.IR pkgconfdir/config .
.TP
.B \-\-debug\fR, \fB\-d
be different locally.
.SH ENVIRONMENT
.TP
+.B DISORDER_CONFIG
+Main configuration file to use instead of
+.IR pkgconfdir/config .
+Overridden by the
+.B \-c
+.RB ( \-\-config )
+command-line option.
+.TP
+.B DISORDER_HOME
+Per-user configuration and state directory to use instead of
+.BR $HOME/.disorder .
+.TP
+.B DISORDER_PRIVCONFIG
+Private configuration file to use instead of
+.IR pkgconfdir/config.private .
+.TP
+.B DISORDER_USERCONFIG
+Per-user configuration file to use instead of
+.BR $DISORDER_HOME/passwd .
+.TP
+.B DISORDER_USERCONFIG_SYS
+System-provided per-user configuration file to use instead of
+.BR $DISORDER_HOME/passwd .
+.TP
.B HOME
The user's home directory.
.TP
Configuration files are read in the following order:
.TP
.I pkgconfdir/config
+Or
+.BR $DISORDER_CONFIG ,
+if that's set; overridden by
+.B \-c
+.RB ( \-\-config )
+command line option, except in
+.BR disrder-playrtp (1),
+which uses
+.BR \-C .
.TP
.I pkgconfdir/config.private
+Or
+.BR $DISORDER_PRIVCONFIG ,
+if that's set, else
+.BR $DISORDER_CONFIG.private .
Should be readable only by the jukebox group.
Not really useful any more and will be abolished in future.
.TP
.I ~\fRUSERNAME\fI/.disorder/passwd
+Or
+.BR $DISORDER_USERCONFIG ,
+if that's set; else
+.BR $DISORDER_HOME/passwd .
Per-user client configuration.
Optional but if it exists must be readable only by the relevant user.
Would normally contain a \fBpassword\fR directive.
.TP
.I pkgconfdir/config.\fRUSERNAME
+(Or
+.BR $DISORDER_USERCONFIG_SYS ,
+if that's set; else
+.BR $DISORDER_CONFIG.\fIUSERNAME .)
Per-user system-controlled client configuration.
Optional but if it exists must be readable only by the relevant user.
Would normally contain a \fBpassword\fR directive.
.B \-\-config \fIPATH\fR, \fB\-c \fIPATH
Set the configuration file.
The default is
+given by the
+.B DISORDER_CONFIG
+environment variable, defaulting to
.IR pkgconfdir/config .
See
.BR disorder_config (5)
This prevents multiple instances of DisOrder running simultaneously.
.SH ENVIRONMENT
.TP
+.B DISORDER_CONFIG
+Configuration file to use instead of
+.IR pkgconfdir/config .
+.TP
+.B DISORDER_PRIVCONFIG
+Private configuration file to use instead of
+.IR pkgconfdir/config.private .
+.TP
.B LC_ALL\fR, \fBLANG\fR, etc
Current locale.
See \fBlocale\fR(7).
/** @brief Set the default configuration file */
static void set_configfile(void) {
#if !_WIN32
- if(!configfile)
- byte_xasprintf(&configfile, "%s/config", pkgconfdir);
+ if(!configfile) {
+ configfile = getenv("DISORDER_CONFIG");
+ if(!configfile)
+ byte_xasprintf(&configfile, "%s/config", pkgconfdir);
+ }
#endif
}
/** @brief Return the path to user's personal configuration file */
char *config_userconf(void) {
+ char *t;
+ if((t = getenv("DISORDER_USERCONFIG"))) return xstrdup(t);
return profile_filename("passwd");
}
char *s;
set_configfile();
- if(!strchr(pw->pw_name, '/')) {
+ if((s = getenv("DISORDER_USERCONFIG_SYS")))
+ return xstrdup(s);
+ else if(!strchr(pw->pw_name, '/')) {
byte_xasprintf(&s, "%s.%s", configfile, pw->pw_name);
return s;
} else
char *t;
if(profiledir) return profiledir;
+ if((t = getenv("DISORDER_HOME")))
+ profiledir = t;
+ else {
#if _WIN32
- wchar_t *wpath = 0;
- char *appdata;
- if(SHGetKnownFolderPath(&FOLDERID_RoamingAppData, 0, NULL, &wpath) != S_OK) {
- disorder_error(0, "error calling SHGetKnownFolderPath");
- return 0;
- }
- t = win_wtomb(wpath);
- CoTaskMemFree(wpath);
- byte_xasprintf(&profiledir, "%s\\DisOrder", appdata);
+ wchar_t *wpath = 0;
+ char *appdata;
+ if(SHGetKnownFolderPath(&FOLDERID_RoamingAppData, 0, NULL, &wpath) != S_OK) {
+ disorder_error(0, "error calling SHGetKnownFolderPath");
+ return 0;
+ }
+ t = win_wtomb(wpath);
+ CoTaskMemFree(wpath);
+ byte_xasprintf(&profiledir, "%s\\DisOrder", appdata);
#else
- struct passwd *pw;
- if(!(t = getenv("HOME"))) {
- if(!(pw = getpwuid(getuid())))
- disorder_error(0, "user not found in password database");
- t = pw->pw_dir;
- }
- byte_xasprintf(&profiledir, "%s/.disorder", t);
+ struct passwd *pw;
+ if(!(t = getenv("HOME"))) {
+ if(!(pw = getpwuid(getuid())))
+ disorder_error(0, "user not found in password database");
+ t = pw->pw_dir;
+ }
+ byte_xasprintf(&profiledir, "%s/.disorder", t);
#endif
+ }
return profiledir;
}