comparison roundup/scripts/roundup_server.py @ 1249:6c24a86a12ae

Fixes for SourceForge tracker bugs. - fixed filter() with no sort/group [SF#618614] - fixed register with no session [SF#618611] - fixed log / pid file path handling in roundup-server [SF#617981] - fixed old gadfly compatibiltiy problem, for sure this time [SF#612873]
author Richard Jones <richard@users.sourceforge.net>
date Mon, 07 Oct 2002 00:52:51 +0000
parents 08a13a84ed43
children 347657425a10
comparison
equal deleted inserted replaced
1248:5b419b02c169 1249:6c24a86a12ae
14 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 14 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
15 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 15 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
16 # 16 #
17 """ HTTP Server that serves roundup. 17 """ HTTP Server that serves roundup.
18 18
19 $Id: roundup_server.py,v 1.12 2002-09-23 06:48:35 richard Exp $ 19 $Id: roundup_server.py,v 1.13 2002-10-07 00:52:51 richard Exp $
20 """ 20 """
21 21
22 # python version check 22 # python version check
23 from roundup import version_check 23 from roundup import version_check
24 24
223 devnull = os.open('/dev/null', 0) 223 devnull = os.open('/dev/null', 0)
224 os.dup2(devnull, 0) 224 os.dup2(devnull, 0)
225 os.dup2(devnull, 1) 225 os.dup2(devnull, 1)
226 os.dup2(devnull, 2) 226 os.dup2(devnull, 2)
227 227
228 def abspath(path):
229 ''' Make the given path an absolute path.
230
231 Code from Zope-Coders posting of 2002-10-06 by GvR.
232 '''
233 if not os.path.isabs(path):
234 path = os.path.join(os.getcwd(), path)
235 return os.path.normpath(path)
236
228 def run(): 237 def run():
238 ''' Script entry point - handle args and figure out what to to.
239 '''
229 hostname = '' 240 hostname = ''
230 port = 8080 241 port = 8080
231 pidfile = None 242 pidfile = None
232 logfile = None 243 logfile = None
233 try: 244 try:
240 user = ROUNDUP_USER 251 user = ROUNDUP_USER
241 for (opt, arg) in optlist: 252 for (opt, arg) in optlist:
242 if opt == '-n': hostname = arg 253 if opt == '-n': hostname = arg
243 elif opt == '-p': port = int(arg) 254 elif opt == '-p': port = int(arg)
244 elif opt == '-u': user = arg 255 elif opt == '-u': user = arg
245 elif opt == '-d': pidfile = arg 256 elif opt == '-d': pidfile = abspath(arg)
246 elif opt == '-l': logfile = arg 257 elif opt == '-l': logfile = abspath(arg)
247 elif opt == '-h': usage() 258 elif opt == '-h': usage()
248 259
249 if hasattr(os, 'getuid'): 260 if hasattr(os, 'getuid'):
250 # if root, setuid to the running user 261 # if root, setuid to the running user
251 if not os.getuid() and user is not None: 262 if not os.getuid() and user is not None:

Roundup Issue Tracker: http://roundup-tracker.org/