cc-2055: switch to init.d

-remove update-rc.d on uninstall
-remove unecessary imports in install/uninstall scripts
-all daemons now wait until apache2 is available before starting (LSB Init Script)
This commit is contained in:
martin 2011-06-01 14:18:58 -04:00
parent 6ab5ac4582
commit 4c9c86bf4f
12 changed files with 42 additions and 20 deletions

View File

@ -19,8 +19,8 @@ python ${SCRIPTPATH}/../python_apps/create-pypo-user.py
echo -e "\n*** Pypo Installation ***"
python ${SCRIPTPATH}/../python_apps/pypo/install/pypo-install.py
#echo -e "\n*** Recorder Installation ***"
#python ${SCRIPTPATH}/../python_apps/show-recorder/install/recorder-install.py
echo -e "\n*** Recorder Installation ***"
python ${SCRIPTPATH}/../python_apps/show-recorder/install/recorder-install.py
#echo -e "\n*** Media Monitor Installation ***"
#python ${SCRIPTPATH}/../python_apps/pytag-fs/install/media-monitor-install.py

View File

@ -12,8 +12,8 @@ php ${SCRIPTPATH}/airtime-uninstall.php
echo -e "\n*** Uninstalling Pypo ***"
python ${SCRIPTPATH}/../python_apps/pypo/install/pypo-uninstall.py
#echo -e "\n*** Uninstalling Show Recorder ***"
#python ${SCRIPTPATH}/../python_apps/show-recorder/install/recorder-uninstall.py
echo -e "\n*** Uninstalling Show Recorder ***"
python ${SCRIPTPATH}/../python_apps/show-recorder/install/recorder-uninstall.py
#echo -e "\n*** Uninstalling Media Monitor ***"
#python ${SCRIPTPATH}/../python_apps/pytag-fs/install/media-monitor-uninstall.py

View File

@ -26,4 +26,8 @@ def create_user(username):
if __name__ == "__main__":
if os.geteuid() != 0:
print "Please run this as root."
sys.exit(1)
create_user("pypo")

View File

@ -1,5 +1,14 @@
#!/bin/bash
### BEGIN INIT INFO
# Provides: airtime-media-monitor
# Required-Start: $local_fs $remote_fs $network $syslog apache2
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Manage airtime-media-monitor daemon
### END INIT INFO
USERID=pypo
GROUPID=pypo
NAME=Airtime

View File

@ -3,7 +3,6 @@
import os
import sys
import time
from configobj import ConfigObj
if os.geteuid() != 0:
@ -30,6 +29,7 @@ try:
os.system("/etc/init.d/airtime-media-monitor stop")
os.system("rm -f /etc/init.d/airtime-media-monitor")
os.system("update-rc.d -f airtime-media-monitor remove")
print "Removing log directories"
remove_path(config["log_dir"])

View File

@ -1,5 +1,14 @@
#!/bin/bash
### BEGIN INIT INFO
# Provides: airtime-playout
# Required-Start: $local_fs $remote_fs $network $syslog apache2
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Manage airtime-playout daemon
### END INIT INFO
USERID=pypo
GROUPID=pypo
NAME=Airtime

View File

@ -3,15 +3,9 @@
import time
import os
import traceback
from optparse import *
import sys
import time
import datetime
import logging
import logging.config
import shutil
import string
import platform
from configobj import ConfigObj
from subprocess import Popen

View File

@ -3,7 +3,6 @@
import os
import sys
import time
from configobj import ConfigObj
if os.geteuid() != 0:
@ -30,6 +29,7 @@ try:
os.system("/etc/init.d/airtime-playout stop")
os.system("rm -f /etc/init.d/airtime-playout")
os.system("update-rc.d -f airtime-playout remove")
print "Removing cache directories"
remove_path(config["cache_base_dir"])

View File

@ -11,4 +11,8 @@ def remove_user(username):
os.system("deluser --remove-home " + username + " 1>/dev/null 2>&1")
if __name__ == "__main__":
if os.geteuid() != 0:
print "Please run this as root."
sys.exit(1)
remove_user("pypo")

View File

@ -1,5 +1,14 @@
#!/bin/bash
### BEGIN INIT INFO
# Provides: airtime-show-recorder
# Required-Start: $local_fs $remote_fs $network $syslog apache2
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Manage airtime-show-recorder daemon
### END INIT INFO
USERID=pypo
GROUPID=pypo
NAME=Airtime

View File

@ -3,16 +3,9 @@
import time
import os
import traceback
from optparse import *
import sys
import time
import datetime
import logging
import logging.config
import shutil
import string
import platform
from configobj import ConfigObj
from subprocess import Popen

View File

@ -3,7 +3,6 @@
import os
import sys
import time
from configobj import ConfigObj
if os.geteuid() != 0:
@ -30,6 +29,7 @@ try:
os.system("/etc/init.d/airtime-show-recorder stop")
os.system("rm -f /etc/init.d/airtime-show-recorder")
os.system("update-rc.d -f airtime-show-recorder remove")
print "Removing log directories"
remove_path(config["log_dir"])