Sha256: a1027681003022bcefe93d12299511cf2a7f7e2b2f2eda8d985aee540600199f
Contents?: true
Size: 1.85 KB
Versions: 5
Compression:
Stored size: 1.85 KB
Contents
#!/usr/bin/env ruby # Author:: Nicolas Despres <nicolas.despres@gmail.com>. # Copyright:: Copyright (c) 2004, 2005 TTK team. All rights reserved. # License:: LGPL # $Id: ttkd 567 2005-04-13 08:00:06Z polrop $ require 'pathname' ME = Pathname.new($0).basename ME_DIR = Pathname.new(__FILE__).dirname $PROGRAME_NAME = ME $PROGRAME_NAME.freeze dir = Pathname.new(__FILE__).dirname $: << dir + '..' + 'lib' $: << dir + '..' + 'ruby_ex' $: << dir require 'ttkd' require "#{ME_DIR}/getopts/ttkd" SVN_REPOSITORY_REVISION = '$Rev: 567 $'.gsub!(/\D/, '').to_i SVN_REPOSITORY_DATE = '$Date: 2005-04-13 10:00:06 +0200 (Wed, 13 Apr 2005) $'.sub!(/^.*?\((.*?)\).*?$/) { $1 } TTKD_VERSION = Version.new(0, 1, SVN_REPOSITORY_REVISION) begin opts = TTK::Getopts::TTKd.parse(ARGV) $VERBOSE = true if opts[:loglevel] < Logger::INFO unless daemon_class = ARGV.shift puts('Daemon list:') TTK::Daemons.constants.sort!.each { |d| puts(" - #{d}") } exit end if TTK::Daemons.constants.include?(daemon_class) daemon_class = TTK::Daemons.const_get(daemon_class) else raise(ArgumentError, "`#{daemon_class}' - not a valid daemon class") end if opts[:logfilename] == '-' LOG = TTK::Daemons::Daemon::Logger.new(STDERR) else LOG = TTK::Daemons::Daemon::Logger.new(opts[:logfilename]) end LOG.level = opts[:loglevel] LOG.debug("SRC_DIR: #{TTK::SRC_DIR}") LOG.debug("options: #{opts.inspect}") LOG.debug("argv: #{ARGV.inspect}") daemon = daemon_class.instance daemon.logger = LOG daemon.config = nil daemon.workdir = opts[:workdir] daemon.clean_workdir if opts[:clean_workdir] daemon.detach if opts[:detach] daemon.start_daemon(opts, ARGV) $SAFE = opts[:rb_safe] daemon.join_services rescue => exc TempPath.auto_clean = true STDERR.puts($VERBOSE ? exc.long_pp : exc.short_pp) exit(1) ensure daemon.stop_daemon if daemon end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
ttk-0.1.576 | bin/ttkd |
ttk-0.2.1 | bin/ttkd |
ttk-0.1.579 | bin/ttkd |
ttk-0.1.580 | bin/ttkd |
ttk-0.2.0 | bin/ttkd |