.TP
\fB\-g\fR, \fB\-\-debug\fR
enable debug logging
+.TP
+.BI \-P " PIDFILE" "\fR, \fB\-\-pid-file=" PIDFILE
+set location of file containing calypso process-id
.SH AUTHOR
Written by Keith Packard <keithp@keithp.com>
.SH COPYRIGHT
# TODO: Manage smart and configurable logs
import daemon
+from daemon import pidlockfile
import logging
import optparse
import os
"-g", "--debug", action="store_true",
default=False,
help="enable debug logging")
+parser.add_option(
+ "-P", "--pid-file", dest="pidfile",
+ default=calypso.config.get("server", "pidfile"),
+ help="set location of process-id file")
(options, args) = parser.parse_args()
# Otherwise, daemonize Calypso
context = daemon.DaemonContext()
context.umask = 0o002
+if options.pidfile:
+ # Generate a pidfile where requested
+ context.pidfile = pidlockfile.PIDLockFile(options.pidfile)
with context:
run_server()
"daemon": "False",
"ssl": "False",
"certificate": "/etc/apache2/ssl/server.crt",
- "key": "/etc/apache2/ssl/server.key"},
+ "key": "/etc/apache2/ssl/server.key",
+ "pidfile": "/var/run/calypso.pid",
+ },
"encoding": {
"request": "utf-8",
"stock": "utf-8"},
certificate = /etc/apache2/ssl/server.crt
# SSL private key (if needed)
key = /etc/apache2/ssl/server.key
+# File to store the PID of the running calypso instance
+# pidfile = /var/run/calypso.pid
[encoding]
# Encoding for responding requests