]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Merge remote-tracking branch 'origin/pr/247'
authorAdam Sutton <dev@adamsutton.me.uk>
Thu, 21 Feb 2013 15:52:06 +0000 (15:52 +0000)
committerAdam Sutton <dev@adamsutton.me.uk>
Thu, 21 Feb 2013 15:52:06 +0000 (15:52 +0000)
Conflicts:
man/tvheadend.1

1  2 
man/tvheadend.1
src/main.c
src/tcp.c

diff --cc man/tvheadend.1
index c36e36b1c942b078254ff66c380b2d0c5046c673,7b1e03f3c4982aa002fd8a04c64e19069d36afd8..d48655b86d6c5b2d5d7fa6b0f7bfd37d169a0abf
@@@ -13,69 -13,25 +13,82 @@@ Media player
  .SH OPTIONS
  All arguments are optional.
  .TP
- \fB\-A\fR, \fB\-\-abort\fR
- Immediately abort on startup (for debug).
 -\fB\-b\fR \fIaddress\fR, \fB\-\-bindaddr\fR \fIaddress\fR
 -Specify an interface IP address on which incoming HTTP and HTSP connections
 -will be accepted. By default, connections are accepted on all interfaces.
++\fB\-v\fR, \fB\-\-version\fR
++Show version information.
 +.TP
- \fB\-a\fR, \fB\-\-adapters\fR
- Only use specified DVB adapters (comma separated).
++\fB\-h\fR, \fB\-\-help\fR
++Show built-in help information (may be more up to date).
 +.TP
 +\fB\-c\fR, \fB\-\-config\fR
 +Specify an alternate config path; the default is \fI${HOME}/.hts\fR
  .TP
 -\fB\-u \fR\fIusername\fR
+ \fB\-f
+ Fork and become a background process (deamon). Default no.
+ .TP
 -\fB\-g \fR\fIgroupname\fR
++\fB\-u\fR \fIusername\fR, \fB\-\-user\fR \fIusername\fR
+ Run as user \fIusername\fR. Only applicable if daemonizing. Default is to
+ use the uid of 1 (daemon on most systems).
+ .TP
 -\fB\-C 
++\fB\-g\fR \fIgroupname\fR, \fB\-\-group \fR\fIgroupname\fR
+ Run as group \fR\fIgroupname\fR. Only applicable if daemonizing. Default is to use the 'video' group. If the 'video' group does not exist, gid 1 (daemon) will be used.
+ .TP
++\fB\-p\fR \fIpidpath\fR, \fB\-\-pid \fR\fIpidpath\fR
++Specify alternative PID path file (default /var/run/tvheadend.pid).
++.TP
 +\fB\-C\fR, \fB\-\-firstrun\fR
  If no useraccount exist then create one with no username and no
  password. Use with care as it will allow world-wide administrative
  access to your Tvheadend installation until you edit the
  access-control from within the Tvheadend UI.
- \fB\-d\fR, \fB\-\-debug\fR
- Enable all debug.
 +.TP
- \fB\-f
- Fork and become a background process (deamon). Default no.
++\fB\-a\fR, \fB\-\-adapters\fR
++Only use specified DVB adapters (comma separated).
 +.TP
- \fB\-g\fR \fIgroupname\fR, \fB\-\-group \fR\fIgroupname\fR
- Run as group \fR\fIgroupname\fR. Only applicable if daemonizing. Default is to use the 'video' group. If the 'video' group does not exist, gid 1 (daemon) will be used.
++\fB\-6\fR, \fB\-\-ipv6\fR
++Listen on IPv6.
 +.TP
- \fB\-j\fR, \fB\-\-join\fR
- Subscribe to a service permanently.
- .TP
- \fB\-l\fR, \fB\-\-log\fR
- Log to file.
- .TP
- \fB\-r\fR, \fB\-\-rawts\fR
- Use rawts file to generate virtual services.
- .TP
- \fB\-R\fR, \fB\-\-dvbraw\fR
- Use rawts file to create virtual adapter.
++\fB\-b\fR \fIaddress\fR, \fB\-\-bindaddr\fR \fIaddress\fR
++Specify an interface IP address on which incoming HTTP and HTSP connections
++will be accepted. By default, connections are accepted on all interfaces.
 +.TP
 +\fB\-\-http_port
 +Specify alternative http port (default 9881).
 +.TP
 +\fB\-\-http_root
 +Specify alternative http webroot.
 +.TP
 +\fB\-\-htsp_port
 +Specify alternative htsp port (default 9882).
 +.TP
 +\fB\-\-htsp_port2
 +Specify extra htsp port.
 +.TP
- \fB\-u\fR \fIusername\fR, \fB\-\-user\fR \fIusername\fR
- Run as user \fIusername\fR. Only applicable if daemonizing. Default is to
- use the uid of 1 (daemon on most systems).
++\fB\-d\fR, \fB\-\-debug\fR
++Enable all debug.
 +.TP
 +\fB\-s\fR, \fB\-\-syslog\fR
 +Enable debug to syslog.
 +.TP
 +\fB\-\-uidebug
 +Enable web UI debug.
 +.TP
- \fB\-6\fR, \fB\-\-ipv6\fR
- Listen on IPv6.
++\fB\-l\fR, \fB\-\-log\fR
++Log to file.
 +.TP
- \fB\-v
- Show version information.
++\fB\-A\fR, \fB\-\-abort\fR
++Immediately abort on startup (for debug).
 +.TP
++\fB\-\-noacl
++Do not perform any access control checking.
++.TP
++\fB\-R\fR, \fB\-\-dvbraw\fR
++Use rawts file to create virtual adapter.
++.TP
++\fB\-r\fR, \fB\-\-rawts\fR
++Use rawts file to generate virtual services.
++.TP
++\fB\-j\fR, \fB\-\-join\fR
++Subscribe to a service permanently.
  .SH "LOGGING"
  All activity inside tvheadend is logged to syslog using log facility
  \fBLOG_DAEMON\fR.
diff --cc src/main.c
index 33db93b746ee6e1cdd1002b4e8b9952937786c67,e163e0296e150341a24c75c0c1f40aac0a8994b2..5f37ec09171e16d0790b1d5e512fc470e04b63b2
@@@ -400,6 -402,6 +401,7 @@@ main(int argc, char **argv
  #endif
      {   0, NULL,         "Server Connectivity",    OPT_BOOL, NULL         },
      { '6', "ipv6",       "Listen on IPv6",         OPT_BOOL, &opt_ipv6    },
++    { 'b', "bindaddr",   "Specify bind address",   OPT_STR,  &opt_bindaddr},
      {   0, "http_port",  "Specify alternative http port",
        OPT_INT, &tvheadend_webui_port },
      {   0, "http_root",  "Specify alternative http webroot",
diff --cc src/tcp.c
index 5ccf1bacef45a9ac6e1c7bca55d7767c4543d370,0a9dbd7a59b645b67ae006e90464f20656c1b4e9..fc134e4f38966508f6643a01c15fe7a448bdbb4a
+++ b/src/tcp.c
@@@ -518,11 -520,14 +520,14 @@@ tcp_server_create(const char *bindaddr
    hints.ai_family = AF_UNSPEC;
    hints.ai_socktype = SOCK_STREAM;
  
-   x = getaddrinfo(NULL, portBuf, &hints, &res);
+   x = getaddrinfo(bindaddr, portBuf, &hints, &res);
    free(portBuf);
  
-   if(x != 0)
+   if(x != 0) {
 -    fprintf(stderr, "getaddrinfo: %s: %s", bindaddr != NULL ? bindaddr : "*",
++    tvhlog(LOG_ERR, "tcp", "getaddrinfo: %s: %s", bindaddr != NULL ? bindaddr : "*",
+       x == EAI_SYSTEM ? strerror(errno) : gai_strerror(x));
      return NULL;
+   }
  
    ressave = res;
    while(res)
  
    if(x != 0)
    {
 -    fprintf(stderr, "bind: %s: %s", bindaddr != NULL ? bindaddr : "*", strerror(errno));
++    tvhlog(LOG_ERR, "tcp", "bind: %s: %s", bindaddr != NULL ? bindaddr : "*", strerror(errno));
      close(fd);
      return NULL;
    }