Linux dpw.dpwebtech.com 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64
Apache
: 192.232.243.69 | : 3.148.103.32
54 Domain
7.3.33
dpclient
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
sbin /
[ HOME SHELL ]
Name
Size
Permission
Action
.fsck.ext2.88185
250.55
KB
-rwxr-xr-x
.fsck.ext3.88185
250.55
KB
-rwxr-xr-x
.fsck.ext4.88185
250.55
KB
-rwxr-xr-x
.iconvconfig.x86_64.88185
22.15
KB
-rwxr-xr-x
.mkfs.ext2.88185
94.08
KB
-rwxr-xr-x
.mkfs.ext3.88185
94.08
KB
-rwxr-xr-x
.mkfs.ext4.88185
94.08
KB
-rwxr-xr-x
.named.88185
768.02
KB
-rwxr-xr-x
.tune2fs.88185
69.41
KB
-rwxr-xr-x
accessdb
11.55
KB
-rwxr-xr-x
addgnupghome
3.05
KB
-rwxr-xr-x
addpart
19.69
KB
-rwxr-xr-x
adduser
134.39
KB
-rwxr-xr-x
agetty
48.48
KB
-rwxr-xr-x
alternatives
27.61
KB
-rwxr-xr-x
apachectl
4.31
KB
-rwxr-xr-x
applygnupgdefaults
2.21
KB
-rwxr-xr-x
arp
63.98
KB
-rwxr-xr-x
arpd
52.98
KB
-rwxr-xr-x
arping
23.19
KB
-rwxr-xr-x
atd
27.17
KB
-rwxr-xr-x
atrun
67
B
-rwxr-xr-x
authconfig
43.49
KB
-rwxr-xr-x
authconfig-tui
43.49
KB
-rwxr-xr-x
avcstat
11.25
KB
-rwxr-xr-x
badblocks
27.69
KB
-rwxr-xr-x
biosdecode
24.15
KB
-rwxr-xr-x
blkdeactivate
15.97
KB
-r-xr-xr-x
blkdiscard
23.84
KB
-rwxr-xr-x
blkid
77.92
KB
-rwxr-xr-x
blockdev
32.2
KB
-rwxr-xr-x
bridge
77.6
KB
-rwxr-xr-x
build-locale-archive
860.52
KB
-rwx------
cacertdir_rehash
644
B
-rwxr-xr-x
capsh
19.43
KB
-rwxr-xr-x
cbq
32.73
KB
-rwxr-xr-x
cfdisk
71.37
KB
-rwxr-xr-x
chcpu
23.7
KB
-rwxr-xr-x
chgpasswd
64.1
KB
-rwxr-xr-x
chkconfig
40.22
KB
-rwxr-xr-x
chpasswd
55.88
KB
-rwxr-xr-x
chroot
32.48
KB
-rwxr-xr-x
clock
48.44
KB
-rwxr-xr-x
clockdiff
19.04
KB
-rwxr-xr-x
consoletype
6.95
KB
-rwxr-xr-x
convertquota
70.88
KB
-rwxr-xr-x
cracklib-check
7.04
KB
-rwxr-xr-x
cracklib-format
246
B
-rwxr-xr-x
cracklib-packer
11.06
KB
-rwxr-xr-x
cracklib-unpacker
7.02
KB
-rwxr-xr-x
create-cracklib-dict
990
B
-rwxr-xr-x
crond
68.48
KB
-rwxr-xr-x
ctrlaltdel
11.2
KB
-rwxr-xr-x
ctstat
20.09
KB
-rwxr-xr-x
ddns-confgen
19.44
KB
-rwxr-xr-x
debugfs
120.65
KB
-rwxr-xr-x
delpart
19.69
KB
-rwxr-xr-x
depmod
143.24
KB
-rwxr-xr-x
devlink
64.72
KB
-rwxr-xr-x
dhclient
414.34
KB
-rwxr-xr-x
dhclient-script
30.38
KB
-rwxr-xr-x
dmfilemapd
19.16
KB
-r-xr-xr-x
dmidecode
120.2
KB
-rwxr-xr-x
dmsetup
149.2
KB
-r-xr-xr-x
dmstats
149.2
KB
-r-xr-xr-x
dnssec-checkds
922
B
-rwxr-xr-x
dnssec-coverage
924
B
-rwxr-xr-x
dnssec-dsfromkey
56.6
KB
-rwxr-xr-x
dnssec-importkey
52.59
KB
-rwxr-xr-x
dnssec-keyfromlabel
60.52
KB
-rwxr-xr-x
dnssec-keygen
64.55
KB
-rwxr-xr-x
dnssec-keymgr
920
B
-rwxr-xr-x
dnssec-revoke
48.46
KB
-rwxr-xr-x
dnssec-settime
56.52
KB
-rwxr-xr-x
dnssec-signzone
105.71
KB
-rwxr-xr-x
dnssec-verify
48.46
KB
-rwxr-xr-x
dovecot
344.96
KB
-rwxr-xr-x
dovecot_cpshutdown
3.27
KB
-rwxr-xr-x
dracut
55.83
KB
-rwxr-xr-x
dumpe2fs
23.62
KB
-rwxr-xr-x
e2freefrag
11.15
KB
-rwxr-xr-x
e2fsck
250.55
KB
-rwxr-xr-x
e2image
27.85
KB
-rwxr-xr-x
e2label
69.41
KB
-rwxr-xr-x
e2undo
11.32
KB
-rwxr-xr-x
e4defrag
23.55
KB
-rwxr-xr-x
edquota
83.09
KB
-rwxr-xr-x
ether-wake
73.26
KB
-rwxr-xr-x
ethtool
293.87
KB
-rwxr-xr-x
eventlogadm
39.17
KB
-rwxr-xr-x
exicyclog
11.01
KB
-rwxr-xr-x
exigrep
10.41
KB
-rwxr-xr-x
exim
1.28
MB
-rwsr-xr-x
exim_checkaccess
4.73
KB
-rwxr-xr-x
exim_dbmbuild
77.16
KB
-rwxr-xr-x
exim_dumpdb
116.03
KB
-rwxr-xr-x
exim_fixdb
144.99
KB
-rwxr-xr-x
exim_lock
64.85
KB
-rwxr-xr-x
exim_tidydb
123.12
KB
-rwxr-xr-x
eximstats
148.01
KB
-rwxr-xr-x
exinext
8.02
KB
-rwxr-xr-x
exiqgrep
5.22
KB
-rwxr-xr-x
exiqsumm
5.07
KB
-rwxr-xr-x
exiwhat
4.32
KB
-rwxr-xr-x
faillock
15.02
KB
-rwxr-xr-x
fcgistarter
23.85
KB
-rwxr-xr-x
fdformat
11.27
KB
-rwxr-xr-x
fdisk
195.8
KB
-rwxr-xr-x
filefrag
15.23
KB
-rwxr-xr-x
findfs
11.2
KB
-rwxr-xr-x
firewall
13.46
KB
-rwx------
fixfiles
11.03
KB
-rwxr-xr-x
fsck
32.12
KB
-rwxr-xr-x
fsck.cramfs
19.57
KB
-rwxr-xr-x
fsck.ext2
250.55
KB
-rwxr-xr-x
fsck.ext3
250.55
KB
-rwxr-xr-x
fsck.ext4
250.55
KB
-rwxr-xr-x
fsck.minix
73.32
KB
-rwxr-xr-x
fsfreeze
11.23
KB
-rwxr-xr-x
fstrim
40.59
KB
-rwxr-xr-x
fuser
32.34
KB
-rwxr-xr-x
genhomedircon
23.77
KB
-rwxr-xr-x
genhostid
6.94
KB
-rwxr-xr-x
genl
52.81
KB
-rwxr-xr-x
genrandom
11.16
KB
-rwxr-xr-x
getcap
11.13
KB
-rwxr-xr-x
getenforce
7.01
KB
-rwxr-xr-x
getpcaps
7.07
KB
-rwxr-xr-x
getsebool
11.13
KB
-rwxr-xr-x
glibc_post_upgrade.x86_64
772.05
KB
-rwx------
groupadd
85.65
KB
-rwxr-xr-x
groupdel
77.38
KB
-rwxr-xr-x
groupmems
55.97
KB
-rwxr-xr-x
groupmod
85.66
KB
-rwxr-xr-x
grpck
59.93
KB
-rwxr-xr-x
grpconv
51.73
KB
-rwxr-xr-x
grpunconv
51.73
KB
-rwxr-xr-x
grub2-bios-setup
1.03
MB
-rwxr-xr-x
grub2-get-kernel-settings
2.08
KB
-rwxr-xr-x
grub2-install
1.29
MB
-rwxr-xr-x
grub2-macbless
1.02
MB
-rwxr-xr-x
grub2-mkconfig
7.63
KB
-rwxr-xr-x
grub2-ofpathname
225.52
KB
-rwxr-xr-x
grub2-probe
1.03
MB
-rwxr-xr-x
grub2-reboot
4
KB
-rwxr-xr-x
grub2-rpm-sort
258.52
KB
-rwxr-xr-x
grub2-set-default
3.46
KB
-rwxr-xr-x
grub2-setpassword
2.96
KB
-rwxr-xr-x
grub2-sparc64-setup
1.04
MB
-rwxr-xr-x
grubby
71.27
KB
-rwxr-xr-x
gss-server
23.13
KB
-rwxr-xr-x
halt
704.8
KB
-rwxr-xr-x
hardlink
15.29
KB
-rwxr-xr-x
htcacheclean
78.45
KB
-rwxr-xr-x
httpd
2.31
MB
-rwxr-xr-x
hwclock
48.44
KB
-rwxr-xr-x
iconvconfig
22.15
KB
-rwxr-xr-x
iconvconfig.x86_64
22.15
KB
-rwxr-xr-x
ifcfg
2.99
KB
-rwxr-xr-x
ifconfig
80.05
KB
-rwxr-xr-x
ifdown
1.61
KB
-rwxr-xr-x
ifenslave
19.74
KB
-rwxr-xr-x
ifstat
40.6
KB
-rwxr-xr-x
ifup
4.89
KB
-rwxr-xr-x
in.fingerd
15.18
KB
-rwxr-xr-x
in.ntalkd
23.77
KB
-rwx--x--x
in.talkd
23.77
KB
-rwx--x--x
init
1.56
MB
-rwxr-xr-x
insmod
143.24
KB
-rwxr-xr-x
install-info
110.42
KB
-rwxr-xr-x
installkernel
2.69
KB
-rwxr-xr-x
ip
459.57
KB
-rwxr-xr-x
ip6tables
91.52
KB
-rwxr-xr-x
ip6tables-restore
91.52
KB
-rwxr-xr-x
ip6tables-save
91.52
KB
-rwxr-xr-x
ipmaddr
19.33
KB
-rwxr-xr-x
iptables
91.52
KB
-rwxr-xr-x
iptables-restore
91.52
KB
-rwxr-xr-x
iptables-save
91.52
KB
-rwxr-xr-x
iptunnel
23.33
KB
-rwxr-xr-x
isc-hmac-fixup
11.2
KB
-rwxr-xr-x
killall5
23.17
KB
-rwxr-xr-x
kpartx
39.47
KB
-rwxr-xr-x
lchage
15.41
KB
-rwxr-xr-x
ldattach
27.93
KB
-rwxr-xr-x
ldconfig
952.08
KB
-rwxr-xr-x
lgroupadd
11.28
KB
-rwxr-xr-x
lgroupdel
11.26
KB
-rwxr-xr-x
lgroupmod
15.44
KB
-rwxr-xr-x
lid
15.4
KB
-rwxr-xr-x
lnewusers
15.46
KB
-rwxr-xr-x
lnstat
20.09
KB
-rwxr-xr-x
load_policy
10.97
KB
-rwxr-xr-x
logrotate
68.61
KB
-rwxr-xr-x
logsave
11.27
KB
-rwxr-xr-x
losetup
82.45
KB
-rwxr-xr-x
lpasswd
15.5
KB
-rwxr-xr-x
lsmod
143.24
KB
-rwxr-xr-x
lsof
150.57
KB
-rwxr-xr-x
luseradd
15.38
KB
-rwxr-xr-x
luserdel
11.3
KB
-rwxr-xr-x
lusermod
19.43
KB
-rwxr-xr-x
lwresd
768.19
KB
-rwxr-xr-x
matchpathcon
11.19
KB
-rwxr-xr-x
mii-diag
20.08
KB
-rwxr-xr-x
mii-tool
19.51
KB
-rwxr-xr-x
mkdict
246
B
-rwxr-xr-x
mke2fs
94.08
KB
-rwxr-xr-x
mkfs
11.25
KB
-rwxr-xr-x
mkfs.cramfs
36.16
KB
-rwxr-xr-x
mkfs.ext2
94.08
KB
-rwxr-xr-x
mkfs.ext3
94.08
KB
-rwxr-xr-x
mkfs.ext4
94.08
KB
-rwxr-xr-x
mkfs.minix
36.27
KB
-rwxr-xr-x
mkhomedir_helper
19.05
KB
-rwxr-xr-x
mklost+found
11.11
KB
-rwxr-xr-x
mkswap
69.64
KB
-rwxr-xr-x
modinfo
143.24
KB
-rwxr-xr-x
modprobe
143.24
KB
-rwxr-xr-x
modsec-sdbm-util
22.17
KB
-rwxr-x---
mysqld
244.14
MB
-rwxr-xr-x
mysqld-debug
165.52
MB
-rwxr-xr-x
named
768.19
KB
-rwxr-xr-x
named-checkconf
32.25
KB
-rwxr-xr-x
named-checkzone
32.06
KB
-rwxr-xr-x
named-compilezone
32.06
KB
-rwxr-xr-x
named-journalprint
11.13
KB
-rwxr-xr-x
nameif
15.32
KB
-rwxr-xr-x
netreport
10.96
KB
-rwxr-sr-x
new-kernel-pkg
24.96
KB
-rwxr-xr-x
newusers
93.45
KB
-rwxr-xr-x
nmbd
249.07
KB
-rwxr-xr-x
nologin
7.01
KB
-rwxr-xr-x
nscd
180.02
KB
-rwxr-xr-x
nsec3hash
11.13
KB
-rwxr-xr-x
nstat
23.88
KB
-rwxr-xr-x
ntsysv
36.24
KB
-rwxr-xr-x
ownership
15.04
KB
-rwxr-xr-x
packer
11.06
KB
-rwxr-xr-x
pam_console_apply
39.69
KB
-rwxr-xr-x
pam_tally2
15.05
KB
-rwxr-xr-x
pam_timestamp_check
10.97
KB
-rwxr-xr-x
paperconfig
4.07
KB
-rwxr-xr-x
partx
86.55
KB
-rwxr-xr-x
pidof
23.17
KB
-rwxr-xr-x
ping6
64.63
KB
-rwxr-xr-x
pivot_root
11.19
KB
-rwxr-xr-x
plipconfig
11.06
KB
-rwxr-xr-x
pluginviewer
15.23
KB
-rwxr-xr-x
poweroff
704.8
KB
-rwxr-xr-x
ppp-watch
23.2
KB
-rwxr-xr-x
pure-authd
18.37
KB
-rwxr-xr-x
pure-certd
18.27
KB
-rwxr-xr-x
pure-config.pl
4.64
KB
-rwxr-xr-x
pure-ftpd
173.28
KB
-rwxr-xr-x
pure-ftpwho
25.96
KB
-rwxr-xr-x
pure-mrtginfo
9.93
KB
-rwxr-xr-x
pure-quotacheck
13.95
KB
-rwxr-xr-x
pure-uploadscript
14.21
KB
-rwxr-xr-x
pwck
51.71
KB
-rwxr-xr-x
pwconv
47.57
KB
-rwxr-xr-x
pwhistory_helper
15.44
KB
-rwxr-xr-x
pwunconv
47.59
KB
-rwxr-xr-x
quot
70.66
KB
-rwxr-xr-x
quotacheck
107.29
KB
-rwxr-xr-x
quotaoff
75.03
KB
-rwxr-xr-x
quotaon
75.03
KB
-rwxr-xr-x
quotastats
14.03
KB
-rwxr-xr-x
rdisc
23.17
KB
-rwxr-xr-x
rdma
73.42
KB
-rwxr-xr-x
readprofile
15.46
KB
-rwxr-xr-x
reboot
704.8
KB
-rwxr-xr-x
repquota
75.16
KB
-rwxr-xr-x
resize2fs
48.41
KB
-rwxr-xr-x
resizepart
32.36
KB
-rwxr-xr-x
restorecon
27.16
KB
-rwxr-xr-x
rmmod
143.24
KB
-rwxr-xr-x
rndc
35.88
KB
-rwxr-xr-x
rndc-confgen
19.44
KB
-rwxr-xr-x
rotatelogs
53
KB
-rwxr-xr-x
route
66.6
KB
-rwxr-xr-x
routef
173
B
-rwxr-xr-x
routel
1.59
KB
-rwxr-xr-x
rpc.rquotad
78.95
KB
-rwxr-xr-x
rpcbind
60.07
KB
-rwxr-xr-x
rpcinfo
27.3
KB
-rwxr-xr-x
rsyslogd
648.45
KB
-rwxr-xr-x
rtacct
41.93
KB
-rwxr-xr-x
rtcwake
31.96
KB
-rwxr-xr-x
rtmon
48.68
KB
-rwxr-xr-x
rtpr
37
B
-rwxr-xr-x
rtstat
20.09
KB
-rwxr-xr-x
runlevel
704.8
KB
-rwxr-xr-x
runq
1.28
MB
-rwsr-xr-x
runuser
32.21
KB
-rwxr-xr-x
safe_finger
11.08
KB
-rwxr-xr-x
sasl2-shared-mechlist
10.98
KB
-rwxr-xr-x
saslauthd
92.59
KB
-rwxr-xr-x
sasldblistusers2
19.26
KB
-rwxr-xr-x
saslpasswd2
15.09
KB
-rwxr-xr-x
sefcontext_compile
60.53
KB
-rwxr-xr-x
selabel_digest
11.17
KB
-rwxr-xr-x
selabel_lookup
11.14
KB
-rwxr-xr-x
selabel_lookup_best_match
11.16
KB
-rwxr-xr-x
selabel_partial_match
11.09
KB
-rwxr-xr-x
selinux_restorecon
15.21
KB
-rwxr-xr-x
selinuxconlist
11.1
KB
-rwxr-xr-x
selinuxdefcon
11.12
KB
-rwxr-xr-x
selinuxenabled
6.98
KB
-rwxr-xr-x
selinuxexeccon
7.09
KB
-rwxr-xr-x
semanage
42.76
KB
-rwxr-xr-x
semodule
23.77
KB
-rwxr-xr-x
sendmail
13.64
KB
-rwxr-sr-x
service
3.17
KB
-rwxr-xr-x
sestatus
15.02
KB
-rwxr-xr-x
setcap
11.13
KB
-rwxr-xr-x
setenforce
7.05
KB
-rwxr-xr-x
setfiles
27.16
KB
-rwxr-xr-x
setquota
83.16
KB
-rwxr-xr-x
setsebool
14.99
KB
-rwxr-xr-x
setup
15.38
KB
-rwxr-xr-x
sfdisk
83.25
KB
-rwxr-xr-x
shutdown
704.8
KB
-rwxr-xr-x
sim_server
10.97
KB
-rwxr-xr-x
slattach
42.4
KB
-rwxr-xr-x
sln
743.78
KB
-rwxr-xr-x
smartctl
864.48
KB
-rwxr-xr-x
smartd
670.63
KB
-rwxr-xr-x
smbd
91.84
KB
-rwxr-xr-x
snmpd
31.05
KB
-rwxr-xr-x
snmptrapd
31.22
KB
-rwxr-xr-x
ss
128.44
KB
-rwxr-xr-x
sshd
832.96
KB
-rwxr-xr-x
sshd-keygen
3.53
KB
-rwxr-xr-x
suexec
43.3
KB
-rwsr-xr-x
sulogin
40.53
KB
-rwxr-xr-x
suphp
2.47
MB
-rwsr-x---
sushell
67
B
-rwxr-xr-x
swaplabel
15.31
KB
-rwxr-xr-x
swapoff
15.53
KB
-rwxr-xr-x
swapon
53.29
KB
-rwxr-xr-x
switch_root
15.35
KB
-rwxr-xr-x
sys-unconfig
184
B
-rwxr-xr-x
sysctl
23.57
KB
-rwxr-xr-x
tc
384.59
KB
-rwxr-xr-x
tcpd
36.62
KB
-rwxr-xr-x
tcpdmatch
40.83
KB
-rwxr-xr-x
tcpdump
920.16
KB
-rwxr-xr-x
tcpslice
23.64
KB
-rwxr-xr-x
tcsd
300.27
KB
-rwxr-xr-x
telinit
704.8
KB
-rwxr-xr-x
testsaslauthd
15.09
KB
-rwxr-xr-x
tmpwatch
27.87
KB
-rwxr-xr-x
tracepath
15.05
KB
-rwxr-xr-x
tracepath6
15.05
KB
-rwxr-xr-x
try-from
23.47
KB
-rwxr-xr-x
tsig-keygen
19.44
KB
-rwxr-xr-x
tune2fs
69.41
KB
-rwxr-xr-x
udevadm
414.27
KB
-rwxr-xr-x
unix_chkpwd
35.42
KB
-rwxr-xr-x
unix_update
35.42
KB
-rwx------
update-alternatives
27.61
KB
-rwxr-xr-x
update-smart-drivedb
14.34
KB
-rwxr-xr-x
useradd
134.39
KB
-rwxr-xr-x
userdel
93.5
KB
-rwxr-xr-x
userhelper
39.38
KB
-rwx--x--x
usermod
130.33
KB
-rwxr-xr-x
usernetctl
11.03
KB
-rwsr-xr-x
uuserver
14.97
KB
-rwxr-xr-x
vigr
62.54
KB
-rwxr-xr-x
vipw
62.54
KB
-rwxr-xr-x
visudo
200.91
KB
-rwxr-xr-x
vpddecode
15.33
KB
-rwxr-xr-x
weak-modules
31.9
KB
-rwxr-xr-x
whmapi0
2.98
MB
-rwxr-xr-x
whmapi1
2.98
MB
-rwxr-xr-x
whmlogin
2.33
KB
-rwxr-xr-x
wipefs
28.05
KB
-rwxr-xr-x
xinetd
174.77
KB
-rwxr-xr-x
xqmstats
14.03
KB
-rwxr-xr-x
xtables-multi
91.52
KB
-rwxr-xr-x
yum-complete-transaction
9.22
KB
-rwxr-xr-x
yum-cron
26.02
KB
-rwxr-xr-x
yumdb
8.67
KB
-rwxr-xr-x
zdump
14.02
KB
-rwxr-xr-x
zic
50.02
KB
-rwxr-xr-x
zramctl
82.23
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : yum-cron
#!/usr/bin/python -tt import os import sys import gzip from socket import gethostname import yum import yum.Errors from yum.config import BaseConfig, Option, IntOption, ListOption, BoolOption from yum.parser import ConfigPreProcessor from ConfigParser import ConfigParser, ParsingError from yum.constants import * from email.mime.text import MIMEText from yum.i18n import to_str, to_utf8, to_unicode, utf8_width, utf8_width_fill, utf8_text_fill from yum import _, P_ import yum.updateinfo import smtplib from random import random from time import sleep from yum.misc import setup_locale # FIXME: is it really sane to use this from here? sys.path.append('/usr/share/yum-cli') from output import YumOutput import callback default_config_file = '/etc/yum/yum-cron.conf' class UpdateEmitter(object): """Abstract class for implementing different types of emitters. Most methods will add certain messages the output list. Then, the sendMessage method can be overridden in a subclass to combine these messages and transmit them as required. """ def __init__(self, opts): self.opts = opts self.output = [] def updatesAvailable(self, summary): """Appends a message to the output list stating that there are updates available. :param summary: A human-readable summary of the transaction. """ self.output.append('The following updates are available on %s:' % self.opts.system_name) self.output.append(summary) def updatesDownloading(self, summary): """Append a message to the output list stating that downloading updates has started. :param summary: A human-readable summary of the transaction. """ self.output.append('The following updates will be downloaded on %s:' % self.opts.system_name) self.output.append(summary) def updatesDownloaded(self): """Append a message to the output list stating that updates have been downloaded successfully. """ self.output.append("Updates downloaded successfully.") def updatesInstalling(self, summary): """Append a message to the output list stating that installing updates has started. :param summary: A human-readable summary of the transaction. """ self.output.append('The following updates will be applied on %s:' % self.opts.system_name) self.output.append(summary) def updatesInstalled(self): """Append a message to the output list stating that updates have been installed successfully. """ self.output.append('The updates were successfully applied') def setupFailed(self, errmsg): """Append a message to the output list stating that setup failed, and then call sendMessages to emit the output. :param errmsgs: a string that contains the error message """ self.output.append("Plugins failed to initialize with the following error message: \n%s" % errmsg) self.sendMessages() def checkFailed(self, errmsg): """Append a message to the output stating that checking for updates failed, then call sendMessages to emit the output. :param errmsgs: a string that contains the error message """ self.output.append("Failed to check for updates with the following error message: \n%s" % errmsg) self.sendMessages() def groupError(self, errmsg): """Append a message to the output list stating that an error was encountered while checking for group updates. :param errmsgs: a string that contains the error message """ self.output.append("Error checking for group updates: \n%s" % errmsg) def groupFailed(self, errmsg): """Append a message to the output list stating that checking for group updates failed, then call sendMessages to emit the output. :param errmsgs: a string that contains the error message """ self.output.append("Failed to check for updates with the following error message: \n%s" % errmsg) self.sendMessages() def downloadFailed(self, errmsg): """Append a message to the output list stating that downloading updates failed, then call sendMessages to emit the output. :param errmsgs: a string that contains the error message """ self.output.append("Updates failed to download with the following error message: \n%s" % errmsg) self.sendMessages() def updatesFailed(self, errmsg): """Append a message to the output list stating that installing updates failed, then call sendMessages to emit the output. :param errmsgs: a string that contains the error message """ self.output.append("Updates failed to install with the following error message: \n%s" % errmsg) self.sendMessages() def sendMessages(self): """Send the messages that have been stored. This should be overridden by inheriting classes to emit the messages according to their individual methods. """ # Convert any byte strings to unicode objects now (so that we avoid # implicit conversions with the "ascii" codec later when join()-ing the # strings, leading to tracebacks). self.output = [x.decode('utf-8') if isinstance(x, str) else x for x in self.output] class EmailEmitter(UpdateEmitter): """Emitter class to send messages via email.""" def __init__(self, opts, logger): super(EmailEmitter, self).__init__(opts) self.logger = logger self.subject = "" def updatesAvailable(self, summary): """Appends a message to the output list stating that there are updates available, and set an appropriate subject line. :param summary: A human-readable summary of the transaction. """ super(EmailEmitter, self).updatesAvailable(summary) self.subject = "Yum: Updates Available on %s" % self.opts.system_name def updatesDownloaded(self): """Append a message to the output list stating that updates have been downloaded successfully, and set an appropriate subject line. """ self.subject = "Yum: Updates downloaded on %s" % self.opts.system_name super(EmailEmitter, self).updatesDownloaded() def updatesInstalled(self): """Append a message to the output list stating that updates have been installed successfully, and set an appropriate subject line. """ self.subject = "Yum: Updates installed on %s" % self.opts.system_name super(EmailEmitter, self).updatesInstalled() def setupFailed(self, errmsg): """Append a message to the output list stating that setup failed, and then call sendMessages to emit the output, and set an appropriate subject line. :param errmsgs: a string that contains the error message """ self.subject = "Yum: Failed to perform setup on %s" % self.opts.system_name super(EmailEmitter, self).setupFailed(errmsg) def checkFailed(self, errmsg): """Append a message to the output stating that checking for updates failed, then call sendMessages to emit the output, and set an appropriate subject line. :param errmsgs: a string that contains the error message """ self.subject = "Yum: Failed to check for updates on %s" % self.opts.system_name super(EmailEmitter, self).checkFailed(errmsg) def downloadFailed(self, errmsg): """Append a message to the output list stating that checking for group updates failed, then call sendMessages to emit the output, and add an appropriate subject line. :param errmsgs: a string that contains the error message """ self.subject = "Yum: Failed to download updates on %s" % self.opts.system_name super(EmailEmitter, self).downloadFailed(errmsg) def updatesFailed(self, errmsg): """Append a message to the output list stating that installing updates failed, then call sendMessages to emit the output, and add an appropriate subject line. :param errmsgs: a string that contains the error message """ self.subject = "Yum: Failed to install updates on %s" % self.opts.system_name super(EmailEmitter, self).updatesFailed(errmsg) def sendMessages(self): """Combine the stored messages that have been stored into a single email message, and send this message. """ super(EmailEmitter, self).sendMessages() # Don't send empty emails if not self.output: return # Build up the email to be sent. Encode it with us-ascii instead of # utf-8 if possible. This ensures the email package will not # transfer-encode it to base64 in such a case (it decides based on the # charset passed to the MIMEText constructor). output = ''.join(self.output) try: output.encode('us-ascii') except UnicodeEncodeError: charset = 'utf-8' else: charset = 'us-ascii' msg = MIMEText(output, 'plain', charset) msg['Subject'] = self.subject username, at, domain = self.opts.email_from.rpartition('@') if domain == 'localhost': domain = self.opts.system_name msg['From'] = '%s@%s' % (username, domain) msg['To'] = ",".join(self.opts.email_to) # Send the email try: s = smtplib.SMTP() s.connect(self.opts.email_host) s.sendmail(self.opts.email_from, self.opts.email_to, msg.as_string()) s.close() except Exception, e: self.logger.error("Failed to send an email to %s: %s" % (self.opts.email_host, e)) class StdIOEmitter(UpdateEmitter): """Emitter class to send messages to syslog.""" def __init__(self, opts): super(StdIOEmitter, self).__init__(opts) def sendMessages(self) : """Combine the stored messages that have been stored into a single email message, and send this message to standard output. """ super(StdIOEmitter, self).sendMessages() # Don't print blank lines if not self.output: return print "".join(self.output) class YumCronConfig(BaseConfig): """Class to parse configuration information from the config file, and to store this information. """ system_name = Option(gethostname()) output_width = IntOption(80) random_sleep = IntOption(0) lock_retries = IntOption(5) lock_sleep = IntOption(60) emit_via = ListOption(['email','stdio']) email_to = ListOption(["root"]) email_from = Option("root") email_host = Option("localhost") email_port = IntOption(25) update_messages = BoolOption(False) update_cmd = Option("default") apply_updates = BoolOption(False) download_updates = BoolOption(False) yum_config_file = Option("/etc/yum.conf") group_list = ListOption([]) group_package_types = ListOption(['mandatory', 'default']) class YumCronBase(yum.YumBase, YumOutput): """Main class to check for and apply the updates.""" def __init__(self, config_file_name = None): """Create a YumCronBase object, and perform initial setup. :param config_file_name: a String specifying the name of the config file to use. """ yum.YumBase.__init__(self) YumOutput.__init__(self) # Read the config file self.readConfigFile(config_file_name) self.term.reinit(color='never') self.term.columns = self.opts.output_width # Create the emitters, and add them to the list self.emitters = [] if 'email' in self.opts.emit_via: self.emitters.append(EmailEmitter(self.opts, self.logger)) if 'stdio' in self.opts.emit_via: self.emitters.append(StdIOEmitter(self.opts)) self.updateInfo = [] self.updateInfoTime = None def readConfigFile(self, config_file_name = None): """Reads the given config file, or if none is given, the default config file. :param config_file_name: a String specifying the name of the config file to read. """ # Create ConfigParser and UDConfig Objects confparser = ConfigParser() self.opts = YumCronConfig() #If no config file name is given, fall back to the default if config_file_name == None: config_file_name = default_config_file # Attempt to read the config file. confparser.read will return a # list of the files that were read successfully, so check that it # contains config_file if config_file_name not in confparser.read(config_file_name): print >> sys.stderr, "Error reading config file:", config_file_name sys.exit(1) # Populate the values into the opts object self.opts.populate(confparser, 'commands') self.opts.populate(confparser, 'emitters') self.opts.populate(confparser, 'email') self.opts.populate(confparser, 'groups') self._confparser = confparser #If the system name is not given, set it by getting the hostname if self.opts.system_name == 'None' : self.opts.system_name = gethostname() if 'None' in self.opts.group_list: self.opts.group_list = [] def randomSleep(self, duration): """Sleep for a random amount of time up to *duration*. :param duration: the maximum amount of time to sleep, in minutes. The actual time slept will be between 0 and *duration* minutes """ if duration > 0: sleep(random() * 60 * duration) def doSetup(self): """Perform set up, including setting up directories and parsing options. :return: boolean that indicates whether setup has completed successfully """ try : # Set the configuration file self.preconf.fn = self.opts.yum_config_file # This needs to be set early, errors are handled later. try: level = int(self._confparser.get('base', 'debuglevel')) except: level = -2 self.preconf.debuglevel = level if -4 <= level <= -2: self.preconf.errorlevel = level + 4 # if we are not root do the special subdir thing if os.geteuid() != 0: self.setCacheDir() # override base yum options self.conf.populate(self._confparser, 'base') del self._confparser except Exception, e: # If there are any exceptions, send a message about them, # and return False self.emitSetupFailed('%s' % e) sys.exit(1) def acquireLock(self): """ Wrapper method around doLock to emit errors correctly.""" i = 0 while True: try: self.doLock(); break except yum.Errors.LockError, e: i += 1 if i < self.opts.lock_retries: sleep(self.opts.lock_sleep) continue self.logger.warn("Failed to acquire the yum lock: %s", e) sys.exit(1) def populateUpdateMetadata(self): """Populate the metadata for the packages in the update.""" for repo in self.repos.sort(): repo.metadata_expire = 0 repo.skip_if_unavailable = True self.pkgSack # honor skip_if_unavailable self.upinfo def refreshUpdates(self): """Check whether updates are available. :return: Boolean indicating whether any updates are available """ try: # Just call .update() because it does obsoletes loops, and group # objects. etc. update_cmd = self.opts.update_cmd idx = update_cmd.find("security-severity:") if idx != -1: sevs = update_cmd[idx + len("security-severity:"):] update_cmd = update_cmd[:idx + len("security")] self.updateinfo_filters['sevs'] = sevs.split(",") if update_cmd in ('minimal', 'minimal-security'): if not yum.updateinfo.update_minimal(self): return False self.updateinfo_filters['bugfix'] = True elif update_cmd in ('default', 'security', 'default-security'): if not self.update(): return False else: # return False ? update_cmd = 'default' if not self.update(): return False if update_cmd.endswith("security"): self.updateinfo_filters['security'] = True yum.updateinfo.remove_txmbrs(self) elif update_cmd == 'minimal': self.updateinfo_filters['bugfix'] = True yum.updateinfo.remove_txmbrs(self) except Exception, e: self.emitCheckFailed("%s" %(e,)) sys.exit(1) else: return True def refreshGroupUpdates(self): """Check for group updates, and add them to the transaction. :return: Boolean indicating whether there are any updates to the group available """ if self.conf.group_command == 'objects': return False update_available = False try: for group_string in self.opts.group_list: group_matched = False for group in self.comps.return_groups(group_string): group_matched = True try: txmbrs = self.selectGroup(group.groupid, self.opts.group_package_types, upgrade=True) # If updates are available from a previous # group, or there are updates are available # from this group, set update_available to True update_available |= (txmbrs != []) except yum.Errors.GroupsError: self.emitGroupError('Warning: Group %s does not exist.' % group_string) continue if not group_matched: self.emitGroupError('Warning: Group %s does not exist.' % group_string) continue except Exception, e: self.emitGroupFailed("%s" % e) return False else: return update_available def findDeps(self): """Build the transaction to resolve the dependencies for the update.""" try: (res, resmsg) = self.buildTransaction() except yum.Errors.RepoError, e: self.emitCheckFailed("%s" %(e,)) sys.exit(1) if res == 0: # success, empty transaction sys.exit(0) elif res == 2: # success, dependencies resolved pass else: self.emitCheckFailed("Failed to build transaction: %s" %(str.join("\n", resmsg),)) sys.exit(1) def downloadUpdates(self, emit): """Download the update. :param emit: Boolean indicating whether to emit messages about the download """ # Emit a message that that updates will be downloaded if emit : self.emitDownloading() dlpkgs = map(lambda x: x.po, filter(lambda txmbr: txmbr.ts_state in ("i", "u"), self.tsInfo.getMembers())) try: # Download the updates self.conf.downloadonly = not self.opts.apply_updates self.downloadPkgs(dlpkgs) except Exception, e: self.emitDownloadFailed("%s" % e) sys.exit(1) except SystemExit, e: if e.code == 0: # Emit a message that the packages have been downloaded self.emitDownloaded() self.emitMessages() raise def installUpdates(self, emit): """Apply the available updates. :param emit: Boolean indicating whether to emit messages about the installation """ # Emit a message that if emit : self.emitInstalling() dlpkgs = map(lambda x: x.po, filter(lambda txmbr: txmbr.ts_state in ("i", "u"), self.tsInfo.getMembers())) for po in dlpkgs: result, err = self.sigCheckPkg(po) if result == 0: continue elif result == 1: try: self.getKeyForPackage(po) except yum.Errors.YumBaseError, errmsg: self.emitUpdateFailed(errmsg) return False else: self.emitUpdateFailed(err) return False del self.ts self.initActionTs() # make a new, blank ts to populate self.populateTs(keepold=0) self.ts.check() #required for ordering self.ts.order() # order cb = callback.RPMInstallCallback(output = 0) cb.filelog = True cb.tsInfo = self.tsInfo try: self.runTransaction(cb=cb) except yum.Errors.YumBaseError, err: self.emitUpdateFailed(err) sys.exit(1) if emit : self.emitInstalled() self.emitMessages() def updatesCheck(self): """Check to see whether updates are available for any installed packages. If updates are available, install them, download them, or just emit a message, depending on what options are selected in the configuration file. """ # Sleep a random time self.randomSleep(self.opts.random_sleep) # Perform the initial setup self.doSetup() # Acquire the yum lock self.acquireLock() # Update the metadata self.populateUpdateMetadata() # Exit if we don't need to check for updates if not (self.opts.update_messages or self.opts.download_updates or self.opts.apply_updates): sys.exit(0) # Check for updates in packages, or groups ... need to run both. pups = self.refreshUpdates() gups = self.refreshGroupUpdates() # If neither have updates, we can just exit. if not (pups or gups): sys.exit(0) # Build the transaction to find the additional dependencies self.findDeps() # download if set up to do so, else tell about the updates and exit if not self.opts.download_updates: self.emitAvailable() self.emitMessages() self.releaseLocks() sys.exit(0) self.downloadUpdates(not self.opts.apply_updates) # now apply if we're set up to do so; else just tell that things are # available if not self.opts.apply_updates: self.releaseLocks() sys.exit(0) self.installUpdates(self.opts.update_messages) self.releaseLocks() sys.exit(0) def releaseLocks(self): """Close the rpm database, and release the yum lock.""" self.closeRpmDB() self.doUnlock() def emitAvailable(self): """Emit a notice stating whether updates are available.""" summary = self.listTransaction() map(lambda x: x.updatesAvailable(summary), self.emitters) def emitDownloading(self): """Emit a notice stating that updates are downloading.""" summary = self.listTransaction() map(lambda x: x.updatesDownloading(summary), self.emitters) def emitDownloaded(self): """Emit a notice stating that updates have downloaded.""" map(lambda x: x.updatesDownloaded(), self.emitters) def emitInstalling(self): """Emit a notice stating that automatic updates are about to be applied. """ summary = self.listTransaction() map(lambda x: x.updatesInstalling(summary), self.emitters) def emitInstalled(self): """Emit a notice stating that automatic updates have been applied.""" map(lambda x: x.updatesInstalled(), self.emitters) def emitSetupFailed(self, error): """Emit a notice stating that checking for updates failed.""" map(lambda x: x.setupFailed(error), self.emitters) def emitCheckFailed(self, error): """Emit a notice stating that checking for updates failed.""" map(lambda x: x.checkFailed(error), self.emitters) def emitGroupError(self, error): """Emit a notice stating that there was an error checking for group updates. """ map(lambda x: x.groupError(error), self.emitters) def emitGroupFailed(self, error): """Emit a notice stating that checking for group updates failed.""" map(lambda x: x.groupFailed(error), self.emitters) def emitDownloadFailed(self, error): """Emit a notice stating that downloading the updates failed.""" map(lambda x: x.downloadFailed(error), self.emitters) def emitUpdateFailed(self, errmsg): """Emit a notice stating that automatic updates failed.""" map(lambda x: x.updatesFailed(errmsg), self.emitters) def emitMessages(self): """Emit the messages from the emitters.""" map(lambda x: x.sendMessages(), self.emitters) def main(): """Configure and run the update check.""" setup_locale(override_time=True) # If a file name was passed in, use it as the config file name. base = None if len(sys.argv) > 1: base = YumCronBase(sys.argv[1]) else: base = YumCronBase() #Run the update check base.updatesCheck() if __name__ == "__main__": main()
Close