- lprintf(1, SERVER "\n"
-"Copyright (C) 1996-2004 by the Citadel/UX development team.\n"
-"This software is distributed under the terms of the GNU General Public\n"
-"License. If you paid for this software, someone is ripping you off.\n\n");
-
- if (chdir(WEBCITDIR) != 0)
- perror("chdir");
-
- /*
- * Set up a place to put thread-specific data.
- * We only need a single pointer per thread - it points to the
- * wcsession struct to which the thread is currently bound.
- */
- if (pthread_key_create(&MyConKey, NULL) != 0) {
- lprintf(1, "Can't create TSD key: %s\n", strerror(errno));
- }
+ syslog(1, "%s", PACKAGE_STRING);
+ syslog(1, "Copyright (C) 1996-2011 by the citadel.org team");
+ syslog(1, " ");
+ syslog(1, "This program is open source software: you can redistribute it and/or");
+ syslog(1, "modify it under the terms of the GNU General Public License as published");
+ syslog(1, "by the Free Software Foundation, either version 3 of the License, or");
+ syslog(1, "(at your option) any later version.");
+ syslog(1, " ");
+ syslog(1, "This program is distributed in the hope that it will be useful,");
+ syslog(1, "but WITHOUT ANY WARRANTY; without even the implied warranty of");
+ syslog(1, "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the");
+ syslog(1, "GNU General Public License for more details.");
+ syslog(1, " ");
+ syslog(1, "You should have received a copy of the GNU General Public License");
+ syslog(1, "along with this program. If not, see <http://www.gnu.org/licenses/>.");
+ syslog(1, " ");
+
+
+ /* initialize various subsystems */
+
+ initialise_modules();
+ InitTemplateCache();
+ if (DumpTemplateI18NStrings) {
+ FILE *fd;
+ StrBufAppendBufPlain(I18nDump, HKEY("}\n"), 0);
+ if (StrLength(I18nDump) < 50) {
+ syslog(1, "********************************************************************************\n");
+ syslog(1, "* No strings found in templates! Are you sure they're there? *\n");
+ syslog(1, "********************************************************************************\n");
+ return -1;
+ }
+ fd = fopen(I18nDumpFile, "w");
+ if (fd == NULL) {
+ syslog(1, "********************************************************************************\n");
+ syslog(1, "* unable to open I18N dumpfile [%s] *\n", I18nDumpFile);
+ syslog(1, "********************************************************************************\n");
+ return -1;
+ }
+ rv = fwrite(ChrPtr(I18nDump), 1, StrLength(I18nDump), fd);
+ fclose(fd);
+ return 0;
+ }
+
+
+ /* Tell libical to return an error instead of aborting if it sees badly formed iCalendar data. */
+ icalerror_errors_are_fatal = 0;
+
+ /* Use our own prefix on tzid's generated from system tzdata */
+ icaltimezone_set_tzid_prefix("/citadel.org/");
+
+ /*
+ * Set up a place to put thread-specific data.
+ * We only need a single pointer per thread - it points to the
+ * wcsession struct to which the thread is currently bound.
+ */
+ if (pthread_key_create(&MyConKey, NULL) != 0) {
+ syslog(1, "Can't create TSD key: %s\n", strerror(errno));
+ }
+ InitialiseSemaphores ();