X7ROOT File Manager
Current Path:
/usr/sbin
usr
/
sbin
/
π
..
π
NetworkManager
(3.41 MB)
π
accessdb
(12.59 KB)
π
accton
(13.69 KB)
π
adcli
(179.27 KB)
π
addgnupghome
(3 KB)
π
addpart
(24.86 KB)
π
adduser
(148.17 KB)
π
agetty
(62.38 KB)
π
alternatives
(36.66 KB)
π
anacron
(40.99 KB)
π
apachectl
(4.52 KB)
π
applygnupgdefaults
(2.17 KB)
π
arp
(64.71 KB)
π
arpd
(109.52 KB)
π
arping
(28.74 KB)
π
atd
(32.63 KB)
π
atopacctd
(25.29 KB)
π
atrun
(67 B)
π
auditctl
(45.04 KB)
π
auditd
(151.73 KB)
π
augenrules
(4.04 KB)
π
aureport
(122.35 KB)
π
ausearch
(130.36 KB)
π
authconfig
(21.54 KB)
π
autrace
(16.54 KB)
π
avcstat
(16.4 KB)
π
badblocks
(32.59 KB)
π
biosdecode
(21.45 KB)
π
biosdevname
(46.16 KB)
π
blkdeactivate
(15.97 KB)
π
blkdiscard
(29.05 KB)
π
blkid
(98.66 KB)
π
blkmapd
(53.47 KB)
π
blkzone
(49.74 KB)
π
blockdev
(41.3 KB)
π
bpftool
(2.74 MB)
π
bridge
(158.25 KB)
π
build-locale-archive
(841.02 KB)
π
cache_check
(1.43 MB)
π
cache_dump
(1.43 MB)
π
cache_metadata_size
(1.43 MB)
π
cache_repair
(1.43 MB)
π
cache_restore
(1.43 MB)
π
cache_writeback
(1.43 MB)
π
capsh
(32.44 KB)
π
cfdisk
(98.4 KB)
π
chcpu
(28.84 KB)
π
chgpasswd
(69.69 KB)
π
chkconfig
(45.11 KB)
π
chpasswd
(61.42 KB)
π
chronyd
(375.66 KB)
π
chroot
(41.52 KB)
π
clock
(65.22 KB)
π
clockdiff
(20.43 KB)
π
consoletype
(11.85 KB)
π
convertquota
(78.68 KB)
π
cracklib-check
(13.05 KB)
π
cracklib-format
(251 B)
π
cracklib-packer
(13.05 KB)
π
cracklib-unpacker
(9.03 KB)
π
create-cracklib-dict
(990 B)
π
crond
(73.94 KB)
π
cryptsetup
(147.42 KB)
π
csf
(245.1 KB)
π
ctrlaltdel
(24.79 KB)
π
ctstat
(25.33 KB)
π
dcb
(155.04 KB)
π
ddns-confgen
(20.46 KB)
π
debugfs
(231.63 KB)
π
delpart
(24.86 KB)
π
depmod
(159.95 KB)
π
devlink
(215.87 KB)
π
dhclient
(453.68 KB)
π
dhclient-script
(32.86 KB)
π
dmeventd
(45.08 KB)
π
dmfilemapd
(24.55 KB)
π
dmidecode
(141.8 KB)
π
dmsetup
(158.64 KB)
π
dmstats
(158.64 KB)
π
dnssec-checkds
(936 B)
π
dnssec-coverage
(938 B)
π
dnssec-dsfromkey
(60.84 KB)
π
dnssec-importkey
(60.84 KB)
π
dnssec-keyfromlabel
(64.76 KB)
π
dnssec-keygen
(72.84 KB)
π
dnssec-keymgr
(934 B)
π
dnssec-revoke
(56.74 KB)
π
dnssec-settime
(60.84 KB)
π
dnssec-signzone
(117.2 KB)
π
dnssec-verify
(52.84 KB)
π
dosfsck
(65.13 KB)
π
dosfslabel
(61.1 KB)
π
dovecot
(137.48 KB)
π
dovecot_cpshutdown
(3.27 KB)
π
dpkg-fsys-usrunmess
(12.11 KB)
π
dump-acct
(29.15 KB)
π
dump-utmp
(25.02 KB)
π
dumpe2fs
(32.52 KB)
π
e2freefrag
(16.42 KB)
π
e2fsck
(328.52 KB)
π
e2image
(36.61 KB)
π
e2label
(110.63 KB)
π
e2mmpstatus
(32.52 KB)
π
e2undo
(20.38 KB)
π
e4crypt
(24.55 KB)
π
e4defrag
(28.49 KB)
π
ebtables
(220.8 KB)
π
ebtables-restore
(220.8 KB)
π
ebtables-save
(220.8 KB)
π
edquota
(91.24 KB)
π
era_check
(1.43 MB)
π
era_dump
(1.43 MB)
π
era_invalidate
(1.43 MB)
π
era_restore
(1.43 MB)
π
ether-wake
(73.99 KB)
π
ethtool
(557.79 KB)
π
exicyclog
(11.1 KB)
π
exigrep
(10.52 KB)
π
exim
(1.49 MB)
π
exim_checkaccess
(4.83 KB)
π
exim_dbmbuild
(23.23 KB)
π
exim_dumpdb
(38.02 KB)
π
exim_fixdb
(47.56 KB)
π
exim_lock
(26.59 KB)
π
exim_tidydb
(42.35 KB)
π
eximstats
(148.26 KB)
π
exinext
(7.14 KB)
π
exiqgrep
(5.66 KB)
π
exiqsumm
(5.32 KB)
π
exiwhat
(4.42 KB)
π
exportfs
(82.38 KB)
π
faillock
(20.52 KB)
π
fatlabel
(61.1 KB)
π
fcgistarter
(17.11 KB)
π
fdformat
(33.17 KB)
π
fdisk
(130.92 KB)
π
filefrag
(16.47 KB)
π
findfs
(12.37 KB)
π
firewalld
(6.92 KB)
π
fix-info-dir
(7.84 KB)
π
fixfiles
(10.48 KB)
π
fsadm
(24 KB)
π
fsck
(53.47 KB)
π
fsck.cramfs
(41.4 KB)
π
fsck.ext2
(328.52 KB)
π
fsck.ext3
(328.52 KB)
π
fsck.ext4
(328.52 KB)
π
fsck.fat
(65.13 KB)
π
fsck.minix
(98.74 KB)
π
fsck.msdos
(65.13 KB)
π
fsck.vfat
(65.13 KB)
π
fsck.xfs
(1.92 KB)
π
fsfreeze
(16.38 KB)
π
fstrim
(49.6 KB)
π
fuse2fs
(70.39 KB)
π
fuser
(38.14 KB)
π
g13-syshelp
(189.71 KB)
π
genhomedircon
(29.27 KB)
π
genhostid
(11.85 KB)
π
genl
(121.41 KB)
π
genrandom
(12.38 KB)
π
getcap
(12.34 KB)
π
getenforce
(7.84 KB)
π
getpcaps
(12.27 KB)
π
getsebool
(11.88 KB)
π
groupadd
(95.34 KB)
π
groupdel
(91.09 KB)
π
groupmems
(61.48 KB)
π
groupmod
(99.37 KB)
π
grpck
(61.48 KB)
π
grpconv
(57.26 KB)
π
grpunconv
(57.25 KB)
π
grub2-bios-setup
(1.16 MB)
π
grub2-get-kernel-settings
(2.68 KB)
π
grub2-install
(1.44 MB)
π
grub2-macbless
(1.14 MB)
π
grub2-mkconfig
(8.68 KB)
π
grub2-ofpathname
(242.26 KB)
π
grub2-probe
(1.16 MB)
π
grub2-reboot
(3.99 KB)
π
grub2-rpm-sort
(279.16 KB)
π
grub2-set-bootflag
(16.34 KB)
π
grub2-set-default
(3.45 KB)
π
grub2-set-password
(3.05 KB)
π
grub2-setpassword
(3.05 KB)
π
grub2-sparc64-setup
(1.16 MB)
π
grub2-switch-to-blscfg
(8.6 KB)
π
grubby
(260 B)
π
gss-server
(24.62 KB)
π
gssproxy
(132.08 KB)
π
halt
(218.45 KB)
π
hardlink
(17.09 KB)
π
hdparm
(131.91 KB)
π
htcacheclean
(44.36 KB)
π
httpd
(990.57 KB)
π
hwclock
(65.22 KB)
π
iconvconfig
(33.05 KB)
π
ifconfig
(80.86 KB)
π
ifdown
(2.07 KB)
π
ifenslave
(24.95 KB)
π
ifstat
(117.67 KB)
π
iftop
(75.42 KB)
π
ifup
(5.33 KB)
π
imunify-notifier
(9.82 MB)
π
init
(1.53 MB)
π
insmod
(159.95 KB)
π
install-info
(50.23 KB)
π
installkernel
(323 B)
π
intel_sdsi
(15.62 KB)
π
iotop
(511 B)
π
ip
(693.3 KB)
π
ip6tables
(220.8 KB)
π
ip6tables-apply
(6.89 KB)
π
ip6tables-restore
(220.8 KB)
π
ip6tables-restore-translate
(220.8 KB)
π
ip6tables-save
(220.8 KB)
π
ip6tables-translate
(220.8 KB)
π
ipmaddr
(21 KB)
π
iprconfig
(408.03 KB)
π
iprdbg
(137.57 KB)
π
iprdump
(129.3 KB)
π
iprinit
(125.28 KB)
π
iprsos
(2.18 KB)
π
iprupdate
(129.3 KB)
π
ipset
(9.01 KB)
π
iptables
(220.8 KB)
π
iptables-apply
(6.89 KB)
π
iptables-restore
(220.8 KB)
π
iptables-restore-translate
(220.8 KB)
π
iptables-save
(220.8 KB)
π
iptables-translate
(220.8 KB)
π
iptstate
(92.05 KB)
π
iptunnel
(25 KB)
π
irqbalance
(62.28 KB)
π
irqbalance-ui
(41.29 KB)
π
isc-hmac-fixup
(11.85 KB)
π
iscsi-iname
(16.42 KB)
π
iscsiadm
(406.38 KB)
π
iscsid
(419.23 KB)
π
iscsistart
(374.54 KB)
π
iscsiuio
(183.51 KB)
π
kexec
(194.98 KB)
π
key.dns_resolver
(24.52 KB)
π
kpartx
(49.05 KB)
π
kpatch
(16.59 KB)
π
lchage
(16.41 KB)
π
ldattach
(32.99 KB)
π
ldconfig
(986.02 KB)
π
ledctl
(101.16 KB)
π
ledmon
(101.11 KB)
π
lfd
(382.45 KB)
π
lgroupadd
(11.88 KB)
π
lgroupdel
(11.88 KB)
π
lgroupmod
(19.88 KB)
π
lid
(16.27 KB)
π
lnewusers
(19.87 KB)
π
lnstat
(25.33 KB)
π
load_policy
(12.28 KB)
π
logrotate
(93.03 KB)
π
logsave
(16.41 KB)
π
losetup
(90.59 KB)
π
lpasswd
(20.35 KB)
π
lshw
(966.2 KB)
π
lsmod
(159.95 KB)
π
lspci
(94.85 KB)
π
luseradd
(19.88 KB)
π
luserdel
(15.88 KB)
π
lusermod
(19.88 KB)
π
lvchange
(2.61 MB)
π
lvconvert
(2.61 MB)
π
lvcreate
(2.61 MB)
π
lvdisplay
(2.61 MB)
π
lvextend
(2.61 MB)
π
lvm
(2.61 MB)
π
lvm_import_vdo
(23.14 KB)
π
lvmconfig
(2.61 MB)
π
lvmdevices
(2.61 MB)
π
lvmdiskscan
(2.61 MB)
π
lvmdump
(10.12 KB)
π
lvmpolld
(200.69 KB)
π
lvmsadc
(2.61 MB)
π
lvmsar
(2.61 MB)
π
lvreduce
(2.61 MB)
π
lvremove
(2.61 MB)
π
lvrename
(2.61 MB)
π
lvresize
(2.61 MB)
π
lvs
(2.61 MB)
π
lvscan
(2.61 MB)
π
lwresd
(840.86 KB)
π
makedumpfile
(425.19 KB)
π
mariadbd
(24.3 MB)
π
matchpathcon
(12.37 KB)
π
mcelog
(206.3 KB)
π
mdadm
(620.63 KB)
π
mdmon
(375.48 KB)
π
mii-diag
(25.4 KB)
π
mii-tool
(21.03 KB)
π
mkdict
(251 B)
π
mkdosfs
(39.07 KB)
π
mkdumprd
(12.68 KB)
π
mke2fs
(138.45 KB)
π
mkfadumprd
(2.23 KB)
π
mkfs
(16.47 KB)
π
mkfs.cramfs
(41.26 KB)
π
mkfs.ext2
(138.45 KB)
π
mkfs.ext3
(138.45 KB)
π
mkfs.ext4
(138.45 KB)
π
mkfs.fat
(39.07 KB)
π
mkfs.minix
(86.55 KB)
π
mkfs.msdos
(39.07 KB)
π
mkfs.vfat
(39.07 KB)
π
mkfs.xfs
(475.98 KB)
π
mkhomedir_helper
(24.43 KB)
π
mklost+found
(11.86 KB)
π
mksquashfs
(186.83 KB)
π
mkswap
(86.47 KB)
π
modinfo
(159.95 KB)
π
modprobe
(159.95 KB)
π
modsec-sdbm-util
(25.83 KB)
π
mount.nfs
(197.24 KB)
π
mount.nfs4
(197.24 KB)
π
mountstats
(42.22 KB)
π
mpathconf
(16.17 KB)
π
mpathpersist
(29.34 KB)
π
mtr
(110.92 KB)
π
mtr-packet
(58.3 KB)
π
multipath
(32.61 KB)
π
multipathd
(134.76 KB)
π
mysqld
(24.3 MB)
π
named
(840.86 KB)
π
named-checkconf
(36.77 KB)
π
named-checkzone
(36.63 KB)
π
named-compilezone
(36.63 KB)
π
named-journalprint
(11.85 KB)
π
nameif
(16.98 KB)
π
newusers
(107.23 KB)
π
nfsconf
(37.48 KB)
π
nfsconvert
(13.03 KB)
π
nfsdcld
(65.87 KB)
π
nfsdclddb
(10 KB)
π
nfsdclnts
(9.02 KB)
π
nfsdcltrack
(49.78 KB)
π
nfsidmap
(45.36 KB)
π
nfsiostat
(23.36 KB)
π
nfsref
(65.8 KB)
π
nfsstat
(35.52 KB)
π
nft
(24.41 KB)
π
nginx
(1.85 MB)
π
nginx-debug
(1.98 MB)
π
nologin
(11.87 KB)
π
nrpe
(76.13 KB)
π
nscd
(160.68 KB)
π
nsec3hash
(12.29 KB)
π
nstat
(113.57 KB)
π
nvme
(721.45 KB)
π
oddjobd
(77.63 KB)
π
ownership
(12.4 KB)
π
packer
(13.05 KB)
π
pam_console_apply
(45.2 KB)
π
pam_timestamp_check
(11.87 KB)
π
paperconfig
(4.07 KB)
π
parted
(85.6 KB)
π
partprobe
(16.39 KB)
π
partx
(94.5 KB)
π
pdata_tools
(1.43 MB)
π
pidof
(16.7 KB)
π
ping
(66.13 KB)
π
ping6
(66.13 KB)
π
pivot_root
(12.38 KB)
π
plipconfig
(12.71 KB)
π
plymouth-set-default-theme
(6.05 KB)
π
plymouthd
(141.97 KB)
π
poweroff
(218.45 KB)
π
pure-authd
(19.23 KB)
π
pure-certd
(19.13 KB)
π
pure-config.pl
(4.64 KB)
π
pure-ftpd
(182.06 KB)
π
pure-ftpwho
(26.82 KB)
π
pure-mrtginfo
(11.16 KB)
π
pure-quotacheck
(18.81 KB)
π
pure-uploadscript
(19.07 KB)
π
pvchange
(2.61 MB)
π
pvck
(2.61 MB)
π
pvcreate
(2.61 MB)
π
pvdisplay
(2.61 MB)
π
pvmove
(2.61 MB)
π
pvremove
(2.61 MB)
π
pvresize
(2.61 MB)
π
pvs
(2.61 MB)
π
pvscan
(2.61 MB)
π
pwck
(57.27 KB)
π
pwconv
(53.1 KB)
π
pwhistory_helper
(20.43 KB)
π
pwunconv
(53.13 KB)
π
quot
(78.67 KB)
π
quotacheck
(115.75 KB)
π
quotaoff
(83.16 KB)
π
quotaon
(83.16 KB)
π
quotastats
(16.54 KB)
π
raid-check
(3.7 KB)
π
rcmysql
(0 B)
π
rdisc
(24.55 KB)
π
rdma
(187.38 KB)
π
readprofile
(20.55 KB)
π
realm
(144.26 KB)
π
reboot
(218.45 KB)
π
repquota
(83.24 KB)
π
request-key
(24.38 KB)
π
resize2fs
(64.91 KB)
π
resizepart
(41.56 KB)
π
resolvconf
(195.74 KB)
π
restorecon
(20.53 KB)
π
restorecon_xattr
(16.41 KB)
π
rfkill
(53.46 KB)
π
rmmod
(159.95 KB)
π
rndc
(36.53 KB)
π
rndc-confgen
(20.45 KB)
π
rotatelogs
(30.51 KB)
π
route
(67.63 KB)
π
rpc.gssd
(106.55 KB)
π
rpc.idmapd
(61.73 KB)
π
rpc.mountd
(158.92 KB)
π
rpc.nfsd
(49.91 KB)
π
rpc.statd
(103.29 KB)
π
rpcbind
(61.55 KB)
π
rpcctl
(9.41 KB)
π
rpcdebug
(19.38 KB)
π
rpcinfo
(32.64 KB)
π
rsyslogd
(724.73 KB)
π
rtacct
(46.94 KB)
π
rtcwake
(49.31 KB)
π
rtmon
(117.27 KB)
π
rtstat
(25.33 KB)
π
runlevel
(218.45 KB)
π
runq
(1.49 MB)
π
runuser
(48.99 KB)
π
sa
(46.62 KB)
π
sasldblistusers2
(20.77 KB)
π
saslpasswd2
(16.42 KB)
π
sefcontext_compile
(65.35 KB)
π
selabel_digest
(12.28 KB)
π
selabel_lookup
(12.27 KB)
π
selabel_lookup_best_match
(11.89 KB)
π
selabel_partial_match
(11.88 KB)
π
selinux_check_access
(12.36 KB)
π
selinuxconlist
(11.88 KB)
π
selinuxdefcon
(11.88 KB)
π
selinuxenabled
(7.84 KB)
π
selinuxexeccon
(11.86 KB)
π
semodule
(29.27 KB)
π
sendmail
(16.91 KB)
π
service
(3.64 KB)
π
sestatus
(20.41 KB)
π
setcap
(16.27 KB)
π
setenforce
(12.27 KB)
π
setfiles
(20.53 KB)
π
setpci
(28.56 KB)
π
setquota
(91.38 KB)
π
setsebool
(16.38 KB)
π
sfdisk
(118.5 KB)
π
showmount
(21.06 KB)
π
shutdown
(218.45 KB)
π
sim_server
(11.87 KB)
π
slattach
(43.76 KB)
π
sm-notify
(78.14 KB)
π
smartctl
(907.08 KB)
π
smartd
(733.2 KB)
π
snmpd
(32.45 KB)
π
snmptrapd
(32.6 KB)
π
sos
(627 B)
π
sos-collector
(139 B)
π
sosreport
(132 B)
π
ss
(191.3 KB)
π
sshd
(869.77 KB)
π
sss_cache
(61.09 KB)
π
sssd
(73.01 KB)
π
start-statd
(838 B)
π
start-stop-daemon
(45.98 KB)
π
suexec
(25.3 KB)
π
sulogin
(49.24 KB)
π
suphp
(6.56 MB)
π
swaplabel
(16.5 KB)
π
swapoff
(20.74 KB)
π
swapon
(49.4 KB)
π
switch_root
(16.49 KB)
π
sysctl
(28.88 KB)
π
syspurpose
(415 B)
π
tcpdump
(1.01 MB)
π
tcpslice
(32.63 KB)
π
tcsd
(309.72 KB)
π
telinit
(218.45 KB)
π
thin_check
(1.43 MB)
π
thin_delta
(1.43 MB)
π
thin_dump
(1.43 MB)
π
thin_ls
(1.43 MB)
π
thin_metadata_pack
(907.47 KB)
π
thin_metadata_size
(1.43 MB)
π
thin_metadata_unpack
(895.45 KB)
π
thin_repair
(1.43 MB)
π
thin_restore
(1.43 MB)
π
thin_rmap
(1.43 MB)
π
thin_trim
(1.43 MB)
π
timedatex
(33.43 KB)
π
tipc
(163.07 KB)
π
tmpwatch
(35.47 KB)
π
tracepath
(20.44 KB)
π
tracepath6
(20.44 KB)
π
tsig-keygen
(20.46 KB)
π
tune2fs
(110.63 KB)
π
tuned
(3.88 KB)
π
tuned-adm
(6.5 KB)
π
udevadm
(424.59 KB)
π
umount.nfs
(197.24 KB)
π
umount.nfs4
(197.24 KB)
π
unbound-anchor
(57.34 KB)
π
unix_chkpwd
(36.86 KB)
π
unix_update
(36.87 KB)
π
unsquashfs
(99.57 KB)
π
update-alternatives
(36.66 KB)
π
update-pciids
(1.71 KB)
π
update-smart-drivedb
(14.44 KB)
π
useradd
(148.17 KB)
π
userdel
(107.29 KB)
π
usermod
(144.07 KB)
π
usernetctl
(12.4 KB)
π
uuserver
(15.88 KB)
π
vdpa
(118.04 KB)
π
vgcfgbackup
(2.61 MB)
π
vgcfgrestore
(2.61 MB)
π
vgchange
(2.61 MB)
π
vgck
(2.61 MB)
π
vgconvert
(2.61 MB)
π
vgcreate
(2.61 MB)
π
vgdisplay
(2.61 MB)
π
vgexport
(2.61 MB)
π
vgextend
(2.61 MB)
π
vgimport
(2.61 MB)
π
vgimportclone
(2.61 MB)
π
vgimportdevices
(2.61 MB)
π
vgmerge
(2.61 MB)
π
vgmknodes
(2.61 MB)
π
vgreduce
(2.61 MB)
π
vgremove
(2.61 MB)
π
vgrename
(2.61 MB)
π
vgs
(2.61 MB)
π
vgscan
(2.61 MB)
π
vgsplit
(2.61 MB)
π
vigr
(68.05 KB)
π
vipw
(68.05 KB)
π
virt-what
(14.22 KB)
π
visudo
(239.22 KB)
π
vmcore-dmesg
(28.58 KB)
π
vpddecode
(16.47 KB)
π
weak-modules
(33.6 KB)
π
whmapi0
(3.18 MB)
π
whmapi1
(3.18 MB)
π
whmlogin
(2.33 KB)
π
wipefs
(41.11 KB)
π
xfs_admin
(1.38 KB)
π
xfs_bmap
(695 B)
π
xfs_copy
(434.59 KB)
π
xfs_db
(760.47 KB)
π
xfs_estimate
(12.39 KB)
π
xfs_freeze
(800 B)
π
xfs_fsr
(53.41 KB)
π
xfs_growfs
(422.48 KB)
π
xfs_info
(1.26 KB)
π
xfs_io
(188.28 KB)
π
xfs_logprint
(454.7 KB)
π
xfs_mdrestore
(410.09 KB)
π
xfs_metadump
(782 B)
π
xfs_mkfile
(1.02 KB)
π
xfs_ncheck
(685 B)
π
xfs_quota
(93.98 KB)
π
xfs_repair
(715.24 KB)
π
xfs_rtcp
(16.38 KB)
π
xfs_spaceman
(45.42 KB)
π
xfsdump
(308.02 KB)
π
xfsinvutil
(66.91 KB)
π
xfsrestore
(369.39 KB)
π
xqmstats
(16.45 KB)
π
xtables-monitor
(220.8 KB)
π
xtables-nft-multi
(220.8 KB)
π
zdump
(20.57 KB)
π
zic
(52.83 KB)
π
zramctl
(99.09 KB)
Editing: dovecot_cpshutdown
#!/usr/local/cpanel/3rdparty/bin/perl use strict; use warnings; use Time::HiRes (); use constant DOVECOT_PROCESS_NAMES => qw( dovecot dovecot-auth dovecot/pop3-login dovecot/imap-login dovecot/anvil dovecot/log dovecot/config dovecot/auth dovecot-wrap ); my $MAX_WAIT = 30; #seconds my $SLEEP_INTERVAL = 0.1; my $pidfile = '/var/run/dovecot/master.pid'; #---------------------------------------------------------------------- if ( "@ARGV" =~ m<--help> ) { print <<END; This script shuts down Dovecot safely: gracefully at first, then forcefully if Dovecotβs processes donβt go away. END exit; } my $master_pid; if ( open my $pfh, '<', $pidfile ) { print "Opened β$pidfileβ β¦\n"; $master_pid = readline($pfh); if ( !defined $master_pid ) { die "read($pidfile): $!" if $!; } chomp $master_pid; if ( $master_pid =~ m<\A[0-9]+\z> ) { print "Master Dovecot process = $master_pid\n"; } else { warn "Invalid contents in β$pidfileβ: [$master_pid]\n"; undef $master_pid; } } elsif ( $!{'ENOENT'} ) { print "β$pidfileβ doesnβt exist!\n"; } else { die "open($pidfile): $!"; } my @CMD = qw( /usr/sbin/dovecot stop ); print "Executing β@CMDβ β¦\n"; my $pid = fork(); die "Failed to fork child process for β@CMDβ" if !defined $pid; if ( $pid ) { print "Waiting $MAX_WAIT seconds for process $pid to end β¦\n"; my $start = time(); my $killed; while ( !waitpid( $pid, 1 ) ) { if ( time > ( $start + $MAX_WAIT ) ) { print "Process $pid has taken over $MAX_WAIT seconds to shut down.\n"; kill 'KILL', $pid; waitpid($pid, 0); $killed = 1; last; } Time::HiRes::sleep($SLEEP_INTERVAL); } # If we killed the dovecot stop command we want to fallthrough to the rest of the shutdown # but not if it terminated with a legitimate error. exit 1 if $? && !$killed; } else { exec(@CMD) or die "Failed to run β@CMDβ: $!"; } print "Done! Waiting $MAX_WAIT seconds for process $master_pid to end β¦\n"; if ( length $master_pid ) { my $start = time(); my $end; while ( !$end ) { if ( kill 'ZERO', $master_pid ) { if ( time > ( $start + $MAX_WAIT ) ) { print "Process $master_pid has taken over $MAX_WAIT seconds to shut down.\n"; _safekill_any_remaining_dovecot_processes(); $end = 1; } Time::HiRes::sleep($SLEEP_INTERVAL); } else { print "Dovecot is now shut down.\n"; # We may have some stragglers so we # do a safekill just in case in order to handle: # # Case 187449: /etc/init.d/dovecot does not stop # properly dovecot # # When stopping dovecot we are killing some processes # but a few of them might survive when dovecot-wrap is # stalled. _safekill_any_remaining_dovecot_processes(); $end = 1; } } } sub _safekill_any_remaining_dovecot_processes { print "Any remaining Dovecot processes will now be terminated.\n"; system( '/usr/local/cpanel/etc/init/safekill', DOVECOT_PROCESS_NAMES ); } 1;
Upload File
Create Folder