/* Default configuration file */
#undef SILC_SERVER_CONFIG_FILE
+/* Default pid file */
+#undef SILC_SERVER_PID_FILE
+
/* Multi-thread support */
#undef SILC_THREADS
#undef SILC_HAVE_PTHREAD
silc_server_daemonise(silcd);
/* Set /var/run/silcd.pid */
- unlink("/var/run/silcd/pid");
+ unlink(SILC_SERVER_PID_FILE);
memset(pid, 0, sizeof(pid));
snprintf(pid, sizeof(pid) - 1, "%d\n", getpid());
- silc_file_writefile("/var/run/silcd.pid", pid, strlen(pid));
+ silc_file_writefile(SILC_SERVER_PID_FILE, pid, strlen(pid));
/* Run the server. When this returns the server has been stopped
and we will exit. */
#define SILC_SERVER_CONFIG_FILE "/etc/silc/silcd.conf"
#endif
+#ifndef SILC_SERVER_PID_FILE
+#define SILC_SERVER_PID_FILE "/var/run/silcd.pid"
+#endif
+
#define SILC_SERVER_PUBLIC_KEY_NAME "/silcd.pub"
#define SILC_SERVER_PRIVATE_KEY_NAME "/silcd.prv"
server [/etc/silc/silcd.conf]],
[ AC_DEFINE_UNQUOTED(SILC_SERVER_CONFIG_FILE, "$withval") ])
+AC_ARG_WITH(silcd-pid-file,
+[ --with-silcd-pid-file[=PATH]
+ Use PATH as default pid file in SILC
+ server [/var/run/silcd.pid]],
+[ AC_DEFINE_UNQUOTED(SILC_SERVER_PID_FILE, "$withval") ])
+
#
# Native WIN32 compilation under cygwin
#