~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to start-loggerhead

  • Committer: Jelmer Vernooij
  • Date: 2009-06-02 00:09:55 UTC
  • mto: (359.3.1 hpss-writes)
  • mto: This revision was merged to the branch mainline in revision 367.
  • Revision ID: jelmer@samba.org-20090602000955-91nohd46pktp8j8k
Support serving branches over HTTP using the smart server protocol.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
# along with this program; if not, write to the Free Software
14
14
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
15
15
 
16
 
"""
17
 
WARNING! This script has been deprecated and will go away soon!
18
 
A script for starting the loggerhead process.
19
 
"""
 
16
"""A script for starting the loggerhead process."""
20
17
 
21
18
 
22
19
import logging
 
20
import logging.handlers
23
21
from optparse import OptionParser
24
22
import os
25
23
import sys
34
32
 
35
33
from loggerhead import daemon
36
34
from loggerhead.apps.config import Root
37
 
from loggerhead.trace import setup_logging
 
35
from loggerhead.trace import make_handler, setup_logging
38
36
from loggerhead.apps.error import ErrorHandlerApp
39
37
 
40
38
 
41
39
def main():
42
 
    sys.stderr.write('\n\n')
43
 
    sys.stderr.write('WARNING!!! This script has been deprecated by '
44
 
                     'serve-branches, and will be removed in the next '
45
 
                     'release. Please migrate to serve-branches and report '
46
 
                     'any missing features.\n')
47
 
    sys.stderr.write('\n\n')
48
 
 
49
40
    home = os.path.realpath(os.path.dirname(__file__))
50
41
    default_pidfile = os.path.join(home, 'loggerhead.pid')
51
42
    default_configfile = os.path.join(home, 'loggerhead.conf')
102
93
    if not options.foreground:
103
94
        sys.stderr.write('\n')
104
95
        sys.stderr.write('Launching loggerhead into the background.\n')
105
 
        sys.stderr.write('PID file: %s\n' % (options.pidfile,))
 
96
        sys.stderr.write('PID file: %s\n' % options.pidfile)
106
97
        sys.stderr.write('\n')
107
98
 
108
99
        daemon.daemonize(options.pidfile, home)