# -*- coding: utf-8 -*-
# $Id: spoolerctl 1634 2013-04-12 15:36:36Z amelung $
#
# Copyright (c) 2007-2013 Otto-von-Guericke-Universität, Magdeburg
#
# This file is part of ECSpooler.
#
"""
information from it. __main__ reads the command line arguments and processes
them.
"""
#import socket
#import atexit
#import traceback
#import logging
# add parent directory to the system path
# Spooler
# SoapWrapper
try:
except ImportError, e:
else:
# Logging initialisieren
"""
"""
"""
"""
print """
Usage: spoolerctl [OPTION ...] {start|stop|restart|status}
OPTIONs are:
-u username Name of user required for authentication when executing
start|stop|restart|status command
-p password Password of user required for authentication when
executing start|stop|restart|status command
--soap Starts SOAP Wrapper for ECSpooler which allows
"""
"""
"""
# child process
# blocks 'til shutdown
if err_msg:
print >> sys.stderr, err_msg
"""
"""
# parent process
time.sleep(1)
"""
We will get the PID from the status information and then send
os.kill to that process.
"""
try:
# stops the spooler sending <code>kill -15 process-id<code>
"""
Returns status information from a running spooler
"""
"""
"""
"""
"""
"""
"""
# child process
#logging.basicConfig(level=logging.DEBUG)
#logging.getLogger('spyne.protocol.xml').setLevel(logging.DEBUG)
#print "Listening to %s" % self._get_uri()
#print "WSDL is at: http://%s:%d/?wsdl" % (host, port)
#print "Connecting to ECSpooler http://%s:%i" % (self.spooler_host, self.spooler_port)
# parent process
time.sleep(1)
"""
"""
try:
# stops the SOAP Wrapper sending kill -15 process-id
"""
"""
return ''
# -----------------------------------------------------------------------------
"""
"""
try:
["port=", "username=", "password=", "help", "soap"])
# print usage information and exit:
sys.exit(2)
sys.exit(2)
else:
port = 5050
sys.exit()
try:
port = int(a)
sys.exit(2)
user = a
password = a
print "%s requires username and password." % cmd
sys.exit(2)
# start spooler as XMLRPC service
# start SOAP wrapper for ECSpooler
if (soap_libs_available and with_soap):
# -- Main ---------------------------------------------------------------------
if __name__ == "__main__":
main()