403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python2.6/site-packages/scservices/core/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.6/site-packages/scservices/core/services.pyo
,Jc@shddkZddkZddkZddkZddkZddkZddkZddklZddk	Tddk
TyddkZWnej
onXddk
lZdZdZdZdZd	ZdZdZdZdZd	Zd
efdYZdefd
YZdefdYZdefdYZdefdYZeegZ dS(iN(tgetstatusoutput(t*(tHookableSetiiiiitInvalidServiceExceptioncBseZRS((t__name__t
__module__(((s</usr/lib/python2.6/site-packages/scservices/core/services.pyR;stServicecBsneZdZdZdZdZdZddZdZ	ddZ
dZd	Zd
Z
RS(sRepresents an abstract service.cCsGtt|i||_||_||_t|_d|_dS(Ni(	tsuperRt__init__tnametmontherdert
AsyncCmdQueuet_asynccmdqueuetconf_updates_running(tselfR	R
R((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRDs			cCs/d|ii|iitt||ifS(Ns<%s.%s object at %s: "%s">(t	__class__RRthextidR	(R((s</usr/lib/python2.6/site-packages/scservices/core/services.pyt__repr__MscCs%|io|ii||ndS(sNotify the herder of a change.N(Rtnotify(Rtchange((s</usr/lib/python2.6/site-packages/scservices/core/services.pyt
notify_herderQs
cCs-ti}|i|i||idS(s+Load configuration from disk synchronously.N(tgobjecttMainLoopt_async_loadt_sync_load_finishedtrun(Rtmainloop((s</usr/lib/python2.6/site-packages/scservices/core/services.pytloadWscCs1|i|djo
t|_n
t|_dS(N(tquittNonetTruetvalidtFalse(RRt
__exception__((s</usr/lib/python2.6/site-packages/scservices/core/services.pyR^s


cCs |iti|i|iS(sILoad configuration from disk asynchronously, notify herder on completion.(RtserviceherderstSVC_CONF_UPDATINGRt_async_load_finished(R((s</usr/lib/python2.6/site-packages/scservices/core/services.pyt
async_loadescCs|itidS(N(RR$tSVC_CONF_CHANGED(RR#((s</usr/lib/python2.6/site-packages/scservices/core/services.pyR&kscOsSy|i|Wntj
o}||d<nX|id8_|||dS(NR#i(t_async_load_processt	ExceptionR(Rtcmdtcallbacktptkte((s</usr/lib/python2.6/site-packages/scservices/core/services.pyt_async_load_readynscOs
tdS(s,Load configuration from disk asynchronously.N(tNotImplementedError(RR,R-R.((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRvscCs
tdS(s,Process asynchronously loaded configuration.N(R1(RR+((s</usr/lib/python2.6/site-packages/scservices/core/services.pyR){sN(RRt__doc__RRRRRRR'R&R0RR)(((s</usr/lib/python2.6/site-packages/scservices/core/services.pyR@s								tChkconfigServicecBsweZdZdZeideiZdZe	dZ
dZdZdZ
dZd	Zd
ZRS(s6Represents an abstract service handled with chkconfig.sLC_ALL=C /sbin/chkconfigs/^chkconfig\s+version\s+(?P<version>[\d\.]+)\s*$cCstt|i|||d|_ttdptidti}xk|D]c}|i}ti	i
|}|o8|id}tt
d|idt_PqRqRW|indS(Nitchkconfig_versions%s -vtversioncSs
t|S((tint(tx((s</usr/lib/python2.6/site-packages/scservices/core/services.pyt<lambda>st.(RR3Rt_chkconfig_runningthasattrtostpopent_chkconfig_invocationtstript_chkconfig_version_retmatchtgroupttupletmaptsplitR4tclose(RR	R
Rt
ckver_pipetlinetmR5((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRs		
$	cCsjt|idpMtig}tidjo|id|indi||i_n|iiS(Nt_chkconfig_actual_invocationiii(s	--type %st (iii((	R;RR3R>R4tappendtchkconfig_typetjoinRJ(Rtinvoke((s</usr/lib/python2.6/site-packages/scservices/core/services.pytchkconfig_invocationscCs
|idjS(Ni(R:(R((s</usr/lib/python2.6/site-packages/scservices/core/services.pytis_chkconfig_runningscCs|id8_dS(Ni(R:(RR+((s</usr/lib/python2.6/site-packages/scservices/core/services.pyt_change_enablement_readyscCs<|id7_|iid|i|i|f|idS(Nis%s "%s" "%s"(R:R
tqueueRPR	RR(RR((s</usr/lib/python2.6/site-packages/scservices/core/services.pyt_change_enablementscCs|iddS(sEnable this service.tonN(RT(R((s</usr/lib/python2.6/site-packages/scservices/core/services.pytenablescCs|iddS(sDisable this service.toffN(RT(R((s</usr/lib/python2.6/site-packages/scservices/core/services.pytdisablescCs
tdS(N(R1(R((s</usr/lib/python2.6/site-packages/scservices/core/services.pytget_enableds(RRR2R>tretcompilet
IGNORECASER@RtpropertyRPRQRRRTRVRXRY(((s</usr/lib/python2.6/site-packages/scservices/core/services.pyR3s								tSysVServicecBsCeZdZdZeidZeidZeidZeidZ	e
d"Zd
ZdZ
dZd
ZdZdZeeeZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#d Z$d!Z%RS(#s)Represents a service handled by SysVinit.tsysvs^(?P<name>\S+)\s+0:(?P<r0>off|on)\s+1:(?P<r1>off|on)\s+2:(?P<r2>off|on)\s+3:(?P<r3>off|on)\s+4:(?P<r4>off|on)\s+5:(?P<r5>off|on)\s+6:(?P<r6>off|on)\s*$s1^service (?P<name>.*) does not support chkconfig$s6^error reading information on service (?P<name>.*):.*$st^service (?P<name>.*) supports chkconfig, but is not referenced in any runlevel \(run 'chkconfig --add (?P=name)'\)$iiiicCs
tt|i|||yt||_Wntj
o
tnXt|_d|_	t
|_d|_
t|_t|_|iio[t|ii|_t|_h|_xK|iiD]}|ii||iqWn|iid|i|idS(Nis/var/lock/subsys/%s(RR^RtSysVServiceInfotinfotInvalidServiceInfoExceptionRR"t
configuredtstatus_updates_runningtSVC_STATUS_UNKNOWNtstatusRt
status_outputR!Rt_status_asynccmdqueuetpidfilestsettpidst
pids_pidfilesR
t
watch_filet_pidfile_changedR	t_var_lock_subsys_changed(RR	R
Rtfile((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRs(					
	
c
Os[|f|}|iid|i|ifdtd|id|d||id7_dS(s,Load configuration from disk asynchronously.s%s --list "%s"tcombined_stdouttready_cbt
ready_argstready_kwargsiN(R
RSRPR	R R0R(RR,R-R.((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRs
	
cCsZ|i}|i}|djo_|ii|p|ii|ot|q~|ii|ot|_dSdSn|i	i|}|p|i
d|ijo
|nt}xBt
ddD]1}|i
d|djo|i|qqWt|i_|ii|ii|t|i_t|_|id8_dS(s,Process asynchronously loaded configuration.iNR	iisr%dRU(texitcodetoutputtno_chkconfig_reRAtchkconfig_error_reRtchkconfig_unconfigured_reR"Rctinit_list_reRBR	Rjtxrangetaddt	runlevelst
hooks_enabledtcleartupdateR R(RR+RuRvRIR}trunlevel((s</usr/lib/python2.6/site-packages/scservices/core/services.pyR)s0		
	!
	
	cCshgd6gd6}xEtddD]4}|||ijodpdit|q$Wxd	D]}t||pqcntd|idi|||i|f\}}|djo<t	d|i|idi|||i||fqcqcWt
|_dS(
s$Save runlevel configuration to disk.RURWiis%s --level %s %s %s 2>&1tsMSaving service '%s' failed, command was '%s --level %s %s %s'.
Output was:
%sN(sonsoff(R{t
_runlevelsRLtstrtlenRRPRNR	tOSErrorR Rc(Rtrunlevel_changestitwhatRfRv((s</usr/lib/python2.6/site-packages/scservices/core/services.pyt_runlevels_save_hook5s$!)
cCs:t|dp#t|_|ii|in|iS(NR(R;RRtadd_hookR(R((s</usr/lib/python2.6/site-packages/scservices/core/services.pyt_get_runlevelsNscCsV|i|i|jo;|ii|ii|ii||iindS(N(R}Rtfreeze_hooksRRt
thaw_hooks(RR}((s</usr/lib/python2.6/site-packages/scservices/core/services.pyt_set_runlevelsTs

cGs"|tijo|indS(N(tgamintGAMEndExisttasync_status_update(RtpathtactionR-((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRo^scGsy|tititifjo|i|nF|tijo5t|idjo|in|i	|ndS(Ni(
Rt
GAMCreatedt
GAMChangedt	GAMExistst_watch_pidfilet
GAMDeletedRRkRt_unwatch_pidfile(RRRR-((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRnbscCs|i|yt|d}Wntj
odSXx[|D]S}xJ|iD]<}y t|}|i||WqQtj
oqQXqQWq>W|idS(Ntr(RtopentIOErrorRER6t
_watch_pidt
ValueErrorRF(RRtpidfileRHt_pidtpid((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRjs


cCsgt}x6|iD]+}||i|jo|i|qqWx|D]}|i||qIWdS(N(RjRkRlR|t_unwatch_pid(RRtunwatch_pidsR((s</usr/lib/python2.6/site-packages/scservices/core/services.pyR{s	
cGs"|tijo|indS(N(RRR(RRRR-((s</usr/lib/python2.6/site-packages/scservices/core/services.pyt_proc_pid_changedscCs}||ijo.|ii||iid||in|ii|pt|i|<n|i|i|dS(Ns/proc/%d(RkR|R
RmRRlthas_keyRj(RRR((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRscCsd|i|i|t|i|djo2|i|=|ii||iid|ndS(Nis/proc/%d(RltdiscardRRkR
t
stop_watch(RRR((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRs

cCs|i|iS(s(Determine service status asynchronously.(t_async_status_updatet_async_status_update_finished(R((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRscCs|itidS(N(RR$tSVC_STATUS_CHANGED(R((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRsc
Os[|f|}|iid|idtd|id|d||id7_t|_dS(Ns&env LC_ALL=C /sbin/service "%s" statusRqRrRsRti(RhRSR	R t_status_update_readyRdtSVC_STATUS_REFRESHINGRf(RR,R-R.((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRs

	
cOsS|id8_|idjod|_t|_n|i||||dS(Nii(RdReRft_status_update_process(RR+R,R-R.((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRs	

cCs}|i}|djo
t|_nK|djp
|djo
t|_n$|djo
t|_n
t|_|i|_dS(s1Process asynchronously determined service status.iiiiN(RutSVC_STATUS_RUNNINGRftSVC_STATUS_DEADtSVC_STATUS_STOPPEDReRvRg(RR+Ru((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRs	




	cCsP|idjotSt|idjotS|i|ijotStSdS(s-Determines the enablement state of a service.iN(RtSVC_ENABLED_REFRESHINGRR}tSVC_ENABLED_NOt_fallback_default_runlevelstSVC_ENABLED_YEStSVC_ENABLED_CUSTOM(R((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRYscCs;|djo
t|_n|iid|i|fdS(Ntstarttstoptrestarts$env LC_ALL=C /sbin/service "%s" "%s"(sstartsstopsrestart(RRfR
RSR	(RR((s</usr/lib/python2.6/site-packages/scservices/core/services.pyt_change_statuss

cCs|iddS(sStart this service.RN(R(R((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRscCs|iddS(sStop this service.RN(R(R((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRscCs|iddS(sRestart this service.RN(R(R((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRscCs|iddS(sReload this service.treloadN(R(R((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRs(iiii(&RRR2RMRZR[RzRwRxRyRjRRRR)RRRR]R}RoRnRRRRRRRRRRRYRRRRR(((s</usr/lib/python2.6/site-packages/scservices/core/services.pyR^s@	"		&													
								t
XinetdServicecBsheZdZdZeidZdZdZdZ	dZ
dZee
eZ
dZRS(	s'Represents a service handled by xinetd.txinetds(^(?P<name>\S+)\s+(?P<enabled>off|on)\s*$cCsYtt|i|||yt||_Wntj
o
tnX|idS(N(RRRtXinetdServiceInfoRaRbRR(RR	R
R((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRsc
Os[|f|}|iid|i|ifdtd|id|d||id7_dS(s,Load configuration from disk asynchronously.s%s --list %sRqRrRsRtiN(R
RSRPR	R R0R(RR,R-R.((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRs
	
cCs|i}|i}|djo_|ii|p|ii|ot|q~|ii|ot|_dSdSn|i	i|}|p|i
d|ijo$ti
d||fIJd|_n|i
ddj|_dS(s,Process asynchronously loaded configuration.iNR	s(%s: unable to parse chkconfig output:
%stenabledRU(RuRvRwRARxRRyR"Rctxinetd_list_reRBR	tsyststderrRR(RR+RuRvRI((s</usr/lib/python2.6/site-packages/scservices/core/services.pyR)s 		
	!


cCs$t|dp
d|_n|iS(Nt_enabled(R;RR(R((s</usr/lib/python2.6/site-packages/scservices/core/services.pyt_get_enabled,s
cCst|dd}||_||jotd|i|i|iodpdf\}}|djo@tdh|id6|id6|iodpdd	6qndS(
NRs
%s %s %s 2>&1RURWisXSaving service '%(name)s' failed, command was '%(invocation)s %(name)s %(action)s 2>&1'.R	t
invocationR(tgetattrRRRRPR	RR(RRtold_enabledRfRv((s</usr/lib/python2.6/site-packages/scservices/core/services.pyt_set_enabled1s	



cCs?|idjotS|idjotS|iotptS(Ni(RRRRtSVC_ENABLED_ERRORRR(R((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRYBs
(RRR2RMRZR[RRRR)RRR]RRY(((s</usr/lib/python2.6/site-packages/scservices/core/services.pyRs					(!R<RtcopyRZttimeRRtutilRtasynccmdtservicesinfoR$tAttributeErrortslip.util.hookableRRReRRRRRRRRR*RtobjectRR3R^Rtservice_classes(((s</usr/lib/python2.6/site-packages/scservices/core/services.pyt<module>s>

AK&Y

Youez - 2016 - github.com/yon3zu
LinuXploit