[xiph-cvs] cvs commit: ices/conf ices-live.xml ices-playlist.xml

Karl Heyes karl at xiph.org
Sat Dec 20 19:38:54 PST 2003



karl        03/12/20 22:38:54

  Modified:    src      cfgparse.c cfgparse.h ices.c
               conf     ices-live.xml ices-playlist.xml
  Log:
  Add pidfile option, and update email address

Revision  Changes    Path
1.7       +3 -1      ices/src/cfgparse.c

Index: cfgparse.c
===================================================================
RCS file: /usr/local/cvsroot/ices/src/cfgparse.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- cfgparse.c	9 Jul 2003 04:26:26 -0000	1.6
+++ cfgparse.c	21 Dec 2003 03:38:53 -0000	1.7
@@ -1,7 +1,7 @@
 /* cfgparse.c
  * - cfgparse file reading code, plus default settings.
  *
- * $Id: cfgparse.c,v 1.6 2003/07/09 04:26:26 brendan Exp $
+ * $Id: cfgparse.c,v 1.7 2003/12/21 03:38:53 karl Exp $
  *
  * Copyright (c) 2001 Michael Smith <msmith at labyrinth.net.au>
  *
@@ -350,6 +350,8 @@
             SET_INT(config->loglevel);
         else if (strcmp(node->name, "consolelog") == 0)
             SET_INT(config->log_stderr);
+        else if (strcmp(node->name, "pidfile") == 0)
+            SET_STRING(config->pidfile);
         else if (strcmp(node->name, "stream") == 0)
             _parse_stream(config, doc, node->xmlChildrenNode);
     } while ((node = node->next));

<p><p>1.5       +2 -1      ices/src/cfgparse.h

Index: cfgparse.h
===================================================================
RCS file: /usr/local/cvsroot/ices/src/cfgparse.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- cfgparse.h	9 Jul 2003 04:26:26 -0000	1.4
+++ cfgparse.h	21 Dec 2003 03:38:53 -0000	1.5
@@ -1,7 +1,7 @@
 /* config.h
  * - configuration, and global structures built from config
  *
- * $Id: cfgparse.h,v 1.4 2003/07/09 04:26:26 brendan Exp $
+ * $Id: cfgparse.h,v 1.5 2003/12/21 03:38:53 karl Exp $
  *
  * Copyright (c) 2001 Michael Smith <msmith at labyrinth.net.au>
  *
@@ -77,6 +77,7 @@
     int background;
     char *logpath;
     char *logfile;
+    char *pidfile;
     int loglevel;
     int log_stderr;
 

<p><p>1.13      +14 -2     ices/src/ices.c

Index: ices.c
===================================================================
RCS file: /usr/local/cvsroot/ices/src/ices.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ices.c	9 Jul 2003 02:45:22 -0000	1.12
+++ ices.c	21 Dec 2003 03:38:53 -0000	1.13
@@ -1,7 +1,7 @@
 /* ices.c
  * - Main startup, thread launching, and cleanup code.
  *
- * $Id: ices.c,v 1.12 2003/07/09 02:45:22 karl Exp $
+ * $Id: ices.c,v 1.13 2003/12/21 03:38:53 karl Exp $
  *
  * Copyright (c) 2001-2002 Michael Smith <msmith at labyrinth.net.au>
  *
@@ -39,7 +39,7 @@
         fprintf(stderr, PACKAGE_STRING "\n"
                 "  (c) Copyright 2001-2003 The IceS Development Team <team at icecast.org>\n"
                 "        Michael Smith <msmith at icecast.org>\n"
-                "        Karl Heyes    <karl at pts.tele2.co.uk>\n"
+                "        Karl Heyes    <karl at xiph.org>\n"
                 "        and others\n"
                 "\n"
                 "Usage: \"ices config.xml\"\n");
@@ -79,10 +79,22 @@
     ices_config->log_id = log;
 
     LOG_INFO0("ices started...");
+    if (ices_config->pidfile != NULL)
+    {
+        FILE *f = fopen (ices_config->pidfile, "w");
+        if (f)
+        {
+            fprintf (f, "%i", getpid());
+            fclose (f);
+        }
+    }
 
     /* Start the core streaming loop */
     input_loop();
 
+    if (ices_config->pidfile)
+        remove (ices_config->pidfile);
+
     LOG_INFO0("Shutdown complete");
 
     log_close(log);

<p><p>1.7       +3 -0      ices/conf/ices-live.xml

Index: ices-live.xml
===================================================================
RCS file: /usr/local/cvsroot/ices/conf/ices-live.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ices-live.xml	2 Jul 2003 20:26:51 -0000	1.6
+++ ices-live.xml	21 Dec 2003 03:38:54 -0000	1.7
@@ -7,6 +7,9 @@
         <loglevel>4</loglevel> <!-- 1=error,2=warn,3=info,4=debug -->
     <consolelog>1</consolelog> <!-- logfile is ignored if this is set to 1 -->
 
+    <!-- optional filename to write process id to -->
+    <!-- <pidfile>/home/ices/ices.pid</pidfile> -->
+
         <stream>
                 <!-- metadata used for stream listing (not currently used) -->
                 <metadata>

<p><p>1.5       +3 -0      ices/conf/ices-playlist.xml

Index: ices-playlist.xml
===================================================================
RCS file: /usr/local/cvsroot/ices/conf/ices-playlist.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ices-playlist.xml	29 Jan 2002 09:20:26 -0000	1.4
+++ ices-playlist.xml	21 Dec 2003 03:38:54 -0000	1.5
@@ -8,6 +8,9 @@
     <consolelog>0</consolelog> <!-- set this to 1 to log to the console instead
                                     of to the file above -->
 
+    <!-- optional filename to write process id to -->
+    <!-- <pidfile>/home/ices/ices.pid</pidfile> -->
+
         <stream>
                 <!-- metadata used for stream listing (not currently used) -->
                 <metadata>

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list