mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-31 17:53:49 -04:00
[main] Add cmd line options to disable mdns announcements + update man page
This commit is contained in:
parent
b1c2a3bd8f
commit
4000d15778
@ -1,21 +1,21 @@
|
|||||||
.\" -*- nroff -*-
|
.\" -*- nroff -*-
|
||||||
.TH FORKED-DAAPD "8" "2015-12-30" "forked-daapd" "DAAP, MPD & RSP media server"
|
.TH FORKED-DAAPD "8" "2018-01-14" "forked-daapd" "DAAP, MPD, Chromecast & RSP media server"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
forked\-daapd \- iTunes\-compatible DAAP server with MPD and RSP support
|
forked\-daapd \- iTunes\-compatible DAAP server with MPD, Chromecast and RSP support
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B forked-daapd
|
.B forked-daapd
|
||||||
[\fIoptions\fR]
|
[\fIoptions\fR]
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
\fBforked\-daapd\fP is a Linux/FreeBSD DAAP (iTunes) media server with support
|
\fBforked\-daapd\fP is a Linux/FreeBSD DAAP (iTunes) media server with support
|
||||||
for AirPlay devices, Apple Remote (and compatibles), MPD, Spotify, mp3 streaming
|
for AirPlay devices, Apple Remote (and compatibles), MPD, Spotify, Chromecast,
|
||||||
and internet radio. It allows you to share your music collection over the local
|
mp3 streaming and internet radio. It allows you to share your music collection over
|
||||||
network.
|
the local network.
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.TP
|
.TP
|
||||||
\fB\-d\fR \fIlevel\fP
|
\fB\-d, \-\-debug=\fR\fIlevel\fP
|
||||||
Log level (0\-5).
|
Log level (0\-5).
|
||||||
.TP
|
.TP
|
||||||
\fB\-D\fR \fIdom,..,dom\fP
|
\fB\-D, \-\-logdomains=\fR\fIdom,..,dom\fP
|
||||||
Debug domains; available domains are: \fIconfig\fP, \fIdaap\fP,
|
Debug domains; available domains are: \fIconfig\fP, \fIdaap\fP,
|
||||||
\fIdb\fP, \fIhttpd\fP, \fImain\fP, \fImdns\fP, \fImisc\fP,
|
\fIdb\fP, \fIhttpd\fP, \fImain\fP, \fImdns\fP, \fImisc\fP,
|
||||||
\fIrsp\fP, \fIscan\fP, \fIxcode\fP, \fIevent\fP, \fIhttp\fP, \fIremote\fP,
|
\fIrsp\fP, \fIscan\fP, \fIxcode\fP, \fIevent\fP, \fIhttp\fP, \fIremote\fP,
|
||||||
@ -23,20 +23,32 @@ Debug domains; available domains are: \fIconfig\fP, \fIdaap\fP,
|
|||||||
\fIlaudio\fP, \fIdmap\fP, \fIfdbperf\fP, \fIspotify\fP, \fIlastfm\fP,
|
\fIlaudio\fP, \fIdmap\fP, \fIfdbperf\fP, \fIspotify\fP, \fIlastfm\fP,
|
||||||
\fIcache\fP, \fImpd\fP, \fIstream\fP, \fIcast\fP, \fIfifo\fP, \fIlib\fP.
|
\fIcache\fP, \fImpd\fP, \fIstream\fP, \fIcast\fP, \fIfifo\fP, \fIlib\fP.
|
||||||
.TP
|
.TP
|
||||||
\fB\-c\fR \fIfile\fP
|
\fB\-c, \-\-config=\fR\fIfile\fP
|
||||||
Use \fIfile\fP as the configuration file.
|
Use \fIfile\fP as the configuration file.
|
||||||
.TP
|
.TP
|
||||||
\fB\-P\fR \fIfile\fP
|
\fB\-P, \-\-pidfile=\fR\fIfile\fP
|
||||||
Write PID to \fIfile\fP.
|
Write PID to \fIfile\fP.
|
||||||
.TP
|
.TP
|
||||||
\fB\-f\fR
|
\fB\-f, \-\-foreground\fR
|
||||||
Run in the foreground.
|
Run in the foreground.
|
||||||
.TP
|
.TP
|
||||||
\fB\-b\fR \fIffid\fP
|
\fB\-b, \-\-ffid=\fR\fIffid\fP
|
||||||
\fIffid\fP to be broadcast in mDNS records.
|
\fIffid\fP to be broadcast in mDNS records.
|
||||||
.TP
|
.TP
|
||||||
\fB\-v\fR
|
\fB\-v, \-\-version\fR
|
||||||
Display version information.
|
Display version information.
|
||||||
|
.TP
|
||||||
|
\fB\-\-mdns-no-rsp\fR
|
||||||
|
Don't announce RSP service via mDNS.
|
||||||
|
.TP
|
||||||
|
\fB\-\-mdns-no-daap\fR
|
||||||
|
Don't announce DAAP service via mDNS.
|
||||||
|
.TP
|
||||||
|
\fB\-\-mdns-no-cname\fR
|
||||||
|
Don't register forked-daapd.local as CNAME via mDNS.
|
||||||
|
.TP
|
||||||
|
\fB\-\-mdns-no-web\fR
|
||||||
|
Don't announce web interface via mDNS.
|
||||||
.SH FILES
|
.SH FILES
|
||||||
.nf
|
.nf
|
||||||
\fI/etc/forked\-daapd.conf\fR
|
\fI/etc/forked\-daapd.conf\fR
|
||||||
|
56
src/main.c
56
src/main.c
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <stdbool.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@ -117,7 +118,7 @@ usage(char *program)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
daemonize(int background, char *pidfile)
|
daemonize(bool background, char *pidfile)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
pid_t childpid;
|
pid_t childpid;
|
||||||
@ -226,7 +227,7 @@ daemonize(int background, char *pidfile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
register_services(char *ffid, int no_rsp, int no_daap, int mdns_no_mpd)
|
register_services(char *ffid, bool no_web, bool no_rsp, bool no_daap, bool no_mpd)
|
||||||
{
|
{
|
||||||
cfg_t *lib;
|
cfg_t *lib;
|
||||||
cfg_t *mpd;
|
cfg_t *mpd;
|
||||||
@ -275,11 +276,13 @@ register_services(char *ffid, int no_rsp, int no_daap, int mdns_no_mpd)
|
|||||||
|
|
||||||
port = cfg_getint(lib, "port");
|
port = cfg_getint(lib, "port");
|
||||||
|
|
||||||
/* Register web server service - disabled since we have no web interface */
|
if (!no_web)
|
||||||
/* ret = mdns_register(libname, "_http._tcp", port, txtrecord);
|
{
|
||||||
|
ret = mdns_register(libname, "_http._tcp", port, txtrecord);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
*/
|
}
|
||||||
|
|
||||||
/* Register RSP service */
|
/* Register RSP service */
|
||||||
if (!no_rsp)
|
if (!no_rsp)
|
||||||
{
|
{
|
||||||
@ -328,7 +331,7 @@ register_services(char *ffid, int no_rsp, int no_daap, int mdns_no_mpd)
|
|||||||
/* Register MPD serivce */
|
/* Register MPD serivce */
|
||||||
mpd = cfg_getsec(cfg, "mpd");
|
mpd = cfg_getsec(cfg, "mpd");
|
||||||
mpd_port = cfg_getint(mpd, "port");
|
mpd_port = cfg_getint(mpd, "port");
|
||||||
if (!mdns_no_mpd && mpd_port > 0)
|
if (!no_mpd && mpd_port > 0)
|
||||||
{
|
{
|
||||||
ret = mdns_register(libname, "_mpd._tcp", mpd_port, NULL);
|
ret = mdns_register(libname, "_mpd._tcp", mpd_port, NULL);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@ -462,10 +465,12 @@ main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int option;
|
int option;
|
||||||
char *configfile;
|
char *configfile;
|
||||||
int background;
|
bool background;
|
||||||
int mdns_no_rsp;
|
bool mdns_no_rsp;
|
||||||
int mdns_no_daap;
|
bool mdns_no_daap;
|
||||||
int mdns_no_mpd;
|
bool mdns_no_cname;
|
||||||
|
bool mdns_no_web;
|
||||||
|
bool mdns_no_mpd;
|
||||||
int loglevel;
|
int loglevel;
|
||||||
char *logdomains;
|
char *logdomains;
|
||||||
char *logfile;
|
char *logfile;
|
||||||
@ -496,6 +501,8 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
{ "mdns-no-rsp", 0, NULL, 512 },
|
{ "mdns-no-rsp", 0, NULL, 512 },
|
||||||
{ "mdns-no-daap", 0, NULL, 513 },
|
{ "mdns-no-daap", 0, NULL, 513 },
|
||||||
|
{ "mdns-no-cname",0, NULL, 514 },
|
||||||
|
{ "mdns-no-web", 0, NULL, 515 },
|
||||||
|
|
||||||
{ NULL, 0, NULL, 0 }
|
{ NULL, 0, NULL, 0 }
|
||||||
};
|
};
|
||||||
@ -506,21 +513,31 @@ main(int argc, char **argv)
|
|||||||
loglevel = -1;
|
loglevel = -1;
|
||||||
logdomains = NULL;
|
logdomains = NULL;
|
||||||
logfile = NULL;
|
logfile = NULL;
|
||||||
background = 1;
|
background = true;
|
||||||
ffid = NULL;
|
ffid = NULL;
|
||||||
mdns_no_rsp = 0;
|
mdns_no_rsp = false;
|
||||||
mdns_no_daap = 0;
|
mdns_no_daap = false;
|
||||||
|
mdns_no_cname = false;
|
||||||
|
mdns_no_web = false;
|
||||||
|
|
||||||
while ((option = getopt_long(argc, argv, "D:d:c:P:fb:vw:", option_map, NULL)) != -1)
|
while ((option = getopt_long(argc, argv, "D:d:c:P:fb:vw:", option_map, NULL)) != -1)
|
||||||
{
|
{
|
||||||
switch (option)
|
switch (option)
|
||||||
{
|
{
|
||||||
case 512:
|
case 512:
|
||||||
mdns_no_rsp = 1;
|
mdns_no_rsp = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 513:
|
case 513:
|
||||||
mdns_no_daap = 1;
|
mdns_no_daap = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 514:
|
||||||
|
mdns_no_cname = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 515:
|
||||||
|
mdns_no_web = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'b':
|
case 'b':
|
||||||
@ -540,7 +557,7 @@ main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'f':
|
case 'f':
|
||||||
background = 0;
|
background = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'c':
|
case 'c':
|
||||||
@ -791,9 +808,9 @@ main(int argc, char **argv)
|
|||||||
ret = EXIT_FAILURE;
|
ret = EXIT_FAILURE;
|
||||||
goto mpd_fail;
|
goto mpd_fail;
|
||||||
}
|
}
|
||||||
mdns_no_mpd = 0;
|
mdns_no_mpd = false;
|
||||||
#else
|
#else
|
||||||
mdns_no_mpd = 1;
|
mdns_no_mpd = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef LASTFM
|
#ifdef LASTFM
|
||||||
@ -811,7 +828,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Register mDNS services */
|
/* Register mDNS services */
|
||||||
ret = register_services(ffid, mdns_no_rsp, mdns_no_daap, mdns_no_mpd);
|
ret = register_services(ffid, mdns_no_web, mdns_no_rsp, mdns_no_daap, mdns_no_mpd);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
ret = EXIT_FAILURE;
|
ret = EXIT_FAILURE;
|
||||||
@ -819,6 +836,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Register this CNAME with mDNS for OAuth */
|
/* Register this CNAME with mDNS for OAuth */
|
||||||
|
if (!mdns_no_cname)
|
||||||
mdns_cname("forked-daapd.local");
|
mdns_cname("forked-daapd.local");
|
||||||
|
|
||||||
#ifdef HAVE_SIGNALFD
|
#ifdef HAVE_SIGNALFD
|
||||||
|
Loading…
x
Reference in New Issue
Block a user