Author: dmeyer
Date: Tue Mar 20 18:50:14 2007
New Revision: 9368
Modified:
trunk/tvdev/bin/freevo-tvdev
trunk/tvserver/bin/freevo-tvserver
Log:
Replace --background with --fg to be similar to beacon.
Default start is not in daemon mode in background.
Modified: trunk/tvdev/bin/freevo-tvdev
==============================================================================
--- trunk/tvdev/bin/freevo-tvdev (original)
+++ trunk/tvdev/bin/freevo-tvdev Tue Mar 20 18:50:14 2007
@@ -69,20 +69,21 @@
print 'freevo-tvdev [options]'
print 'options:'
print '-c configfile set config filename'
- print '--background start tvdev in background'
+ print '--fg start tvdev in foreground'
print '--stop stop running tvdev'
print '--list list all devices'
print '--help | -h this message'
sys.exit(error_code)
options = 'hc:'
-loptions = [ 'background', 'stop', 'list' 'help']
+loptions = [ 'fg', 'stop', 'list' 'help']
try:
opts, args = getopt.getopt(sys.argv[1:], options, loptions)
except getopt.GetoptError, e:
usage(1)
+detach = True
for o, a in opts:
if o in ('-h', '--help'):
usage(0)
@@ -90,11 +91,8 @@
if o == '-c':
cfgfile = a
- if o == '--background':
- if kaa.utils.is_running('freevo-tvdev'):
- print 'tvdev already running'
- sys.exit(1)
- kaa.utils.daemonize()
+ if o == '--fg':
+ detach = False
if o == '--stop':
pid = kaa.utils.is_running('freevo-tvdev')
@@ -153,6 +151,9 @@
print 'tvdev already running'
sys.exit(1)
+if detach:
+ kaa.utils.daemonize()
+
kaa.utils.set_running('freevo-tvdev')
freevo.tvdev.detect(cfgfile)
Modified: trunk/tvserver/bin/freevo-tvserver
==============================================================================
--- trunk/tvserver/bin/freevo-tvserver (original)
+++ trunk/tvserver/bin/freevo-tvserver Tue Mar 20 18:50:14 2007
@@ -64,7 +64,7 @@
def usage(error_code):
print 'freevo-tvserver [options]'
print 'options:'
- print '--background start tvserver in background'
+ print '--fg start tvserver in foreground'
print '--stop stop running tvserver'
print '--interactive interactive remote control'
print '--help | -h this message'
@@ -72,18 +72,16 @@
try:
- opts = [ 'background', 'stop', 'interactive', 'help' ]
+ opts = [ 'fg', 'stop', 'interactive', 'help' ]
opts, args = getopt.getopt(sys.argv[1:], 'h', opts)
except getopt.GetoptError:
usage(1)
+detach = True
for o, a in opts:
- if o == '--background':
- if kaa.utils.is_running('freevo-tvserver'):
- print 'tvserver already running'
- sys.exit(1)
- kaa.utils.daemonize()
+ if o == '--fg':
+ detach = False
if o == '--stop':
pid = kaa.utils.is_running('freevo-tvserver')
@@ -109,6 +107,9 @@
print 'tvserver already running'
sys.exit(1)
+if detach:
+ kaa.utils.daemonize()
+
kaa.utils.set_running('freevo-tvserver')
# fork epg client.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog