diff options
author | James Meyer <james.meyer@operamail.com> | 2009-02-27 16:34:01 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2009-02-27 16:34:01 (GMT) |
commit | 3b28797a23d17cdf9960b0661516c262a8284354 (patch) | |
tree | c6beaccc6d57605e252623286ee49bbd95866c12 /abs/mv-core | |
parent | 43635706a17029756256953141d6150f9d4cb2bc (diff) | |
download | linhes_pkgbuild-3b28797a23d17cdf9960b0661516c262a8284354.zip linhes_pkgbuild-3b28797a23d17cdf9960b0661516c262a8284354.tar.gz linhes_pkgbuild-3b28797a23d17cdf9960b0661516c262a8284354.tar.bz2 |
Add new modules fe_restart.py.
Whitespace cleanup
Diffstat (limited to 'abs/mv-core')
-rw-r--r-- | abs/mv-core/func/PKGBUILD | 6 | ||||
-rw-r--r-- | abs/mv-core/func/fe_restart.py | 35 | ||||
-rw-r--r-- | abs/mv-core/func/power.py | 8 |
3 files changed, 42 insertions, 7 deletions
diff --git a/abs/mv-core/func/PKGBUILD b/abs/mv-core/func/PKGBUILD index 9e4a598..96eafce 100644 --- a/abs/mv-core/func/PKGBUILD +++ b/abs/mv-core/func/PKGBUILD @@ -1,6 +1,6 @@ pkgname=func pkgver=0.24 -pkgrel=9 +pkgrel=21 pkgdesc="fedora unifed network controller" url="" license="gpl" @@ -11,13 +11,12 @@ replaces=() backup=() moddir="pkg/usr/lib/python2.6/site-packages/func/minion/modules/" install=func.install -source=($pkgname-$pkgver.tar.gz minion.conf power.py pacman.py failed_func.sh) +source=($pkgname-$pkgver.tar.gz minion.conf power.py pacman.py failed_func.sh fe_restart.py) md5sums=() arch=('i686') build() { cd $startdir/src/$pkgname-${pkgver} - cd $startdir/src/func python setup.py build python setup.py install --prefix=$startdir/pkg/usr cd $startdir/src @@ -27,6 +26,7 @@ build() { install -m755 -D $startdir/src/$pkgname-${pkgver}/etc/Test.conf $startdir/pkg/etc/func/modules/Test.conf install -m755 -D $startdir/src/power.py ${startdir}/${moddir}/power.py install -m755 -D $startdir/src/pacman.py ${startdir}/${moddir}/pacman.py + install -m755 -D $startdir/src/fe_restart.py ${startdir}/${moddir}/fe_restart.py install -m755 -D $startdir/src/failed_func.sh $startdir/pkg/usr/bin/failed_func.sh mkdir -p $startdir/pkg/var/log/func cd $startdir/pkg diff --git a/abs/mv-core/func/fe_restart.py b/abs/mv-core/func/fe_restart.py new file mode 100644 index 0000000..a75b0c5 --- /dev/null +++ b/abs/mv-core/func/fe_restart.py @@ -0,0 +1,35 @@ +## +# other modules +import sub_process + +# our modules +import func_module + +# ================================= + +class re_restart(func_module.FuncModule): + + version = "0.0.1" + api_version = "0.0.1" + description = "Restart the frontend" + + def killX (self,flags="restart frontend"): + """ + Restart X + """ + flags.replace(";","") # prevent stupidity + cmd = sub_process.Popen("/sbin/sv %s " % flags,stdout=sub_process.PIPE,shell=True) + data = cmd.communicate()[0] + results = ['Restarted UI'] + return (cmd.returncode, results) + + def killmyth (self,flags="-9 mythfrontend"): + """ + kill the mythfrontend process server + """ + flags.replace(";","") # prevent stupidity + cmd = sub_process.Popen("/usr/bin/killall %s" % flags,stdout=sub_process.PIPE,shell=True) + data = cmd.communicate()[0] + results = ['killed mythfrontend'] + return (cmd.returncode, results) + diff --git a/abs/mv-core/func/power.py b/abs/mv-core/func/power.py index 297f464..668965a 100644 --- a/abs/mv-core/func/power.py +++ b/abs/mv-core/func/power.py @@ -16,9 +16,9 @@ class power(func_module.FuncModule): def reboot(self,flags="-q onecheck"): """ Reboot the server - """ + """ flags.replace(";","") # prevent stupidity - cmd = sub_process.Popen("/sbin/reboot") + cmd = sub_process.Popen("/sbin/reboot") data = cmd.communicate()[0] results = ['reboot'] return (cmd.returncode, results) @@ -26,9 +26,9 @@ class power(func_module.FuncModule): def poweroff (self,flags="-q onecheck"): """ Reboot the server - """ + """ flags.replace(";","") # prevent stupidity - cmd = sub_process.Popen("/sbin/poweroff") + cmd = sub_process.Popen("/sbin/poweroff") data = cmd.communicate()[0] results = ['off'] return (cmd.returncode, results) |