Linux ns1.utparral.edu.mx 6.8.0-79-generic #79~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 15 16:54:53 UTC 2 x86_64
Apache/2.4.58 (Unix) OpenSSL/1.1.1w PHP/8.2.12 mod_perl/2.0.12 Perl/v5.34.1
: 10.10.1.9 | : 10.10.1.254
Cant Read [ /etc/named.conf ]
daemon
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
README
+ Create Folder
+ Create File
/
opt /
lampp /
bin /
[ HOME SHELL ]
Name
Size
Permission
Action
ab
51.43
KB
-rwxr-xr-x
annotate
10.2
KB
-rwxr-xr-x
apachectl
3.33
KB
-rwxr-xr-x
apr-1-config
6.84
KB
-rwxr-xr-x
apreq2-config
5.96
KB
-rwxr-xr-x
apu-1-config
6.42
KB
-rwxr-xr-x
apxs
23.3
KB
-rwxr-xr-x
aria_chk
4.56
MB
-rwxr-xr-x
aria_dump_log
4.35
MB
-rwxr-xr-x
aria_ftdump
4.37
MB
-rwxr-xr-x
aria_pack
4.4
MB
-rwxr-xr-x
aria_read_log
4.51
MB
-rwxr-xr-x
autopoint
25.97
KB
-rwxr-xr-x
bdftogd
3.91
KB
-rwxr-xr-x
bison
288.55
KB
-rwxr-xr-x
bmp2tiff
14.32
KB
-rwxr-xr-x
bsqldb
26.76
KB
-rwxr-xr-x
bunzip2
85.55
KB
-rwxr-xr-x
bzcat
85.55
KB
-rwxr-xr-x
bzcmp
2.08
KB
-rwxr-xr-x
bzdiff
2.08
KB
-rwxr-xr-x
bzegrep
1.64
KB
-rwxr-xr-x
bzfgrep
1.64
KB
-rwxr-xr-x
bzgrep
1.64
KB
-rwxr-xr-x
bzip2
85.55
KB
-rwxr-xr-x
bzip2recover
14.23
KB
-rwxr-xr-x
bzless
1.23
KB
-rwxr-xr-x
bzmore
1.23
KB
-rwxr-xr-x
captoinfo
66.7
KB
-rwxr-xr-x
checkgid
6.13
KB
-rwxr-xr-x
cjpeg
30.29
KB
-rwxr-xr-x
clear
6.12
KB
-rwxr-xr-x
corelist
15.03
KB
-rwxr-xr-x
cpan
8.18
KB
-rwxr-xr-x
crc32
715
B
-r-xr-xr-x
c_rehash
6.57
KB
-rwxr-xr-x
curl
174.83
KB
-rwxr-xr-x
curl-config
5.48
KB
-rwxr-xr-x
cwebp
50.9
KB
-rwxr-xr-x
datacopy
22.45
KB
-rwxr-xr-x
dbilogstrip
1.44
KB
-r-xr-xr-x
dbiprof
6.17
KB
-r-xr-xr-x
dbiproxy
5.37
KB
-r-xr-xr-x
dbl2png
14.3
KB
-rwxr-xr-x
dbmmanage
8.72
KB
-rwxr-xr-x
defncopy
18.76
KB
-rwxr-xr-x
derb
23.09
KB
-rwxr-xr-x
djpeg
26.27
KB
-rwxr-xr-x
dwebp
30.49
KB
-rwxr-xr-x
enc2xs
40.79
KB
-rwxr-xr-x
encguess
3.02
KB
-rwxr-xr-x
envsubst
34.55
KB
-rwxr-xr-x
envvars
1.03
KB
-rw-r--r--
envvars-std
1.03
KB
-rw-r--r--
fax2ps
18.52
KB
-rwxr-xr-x
fax2tiff
14.66
KB
-rwxr-xr-x
fcgistarter
10.27
KB
-rwxr-xr-x
fisql
26.91
KB
-rwxr-xr-x
fix_rights
956
B
-rwxr-xr-x
flex
353.36
KB
-rwxr-xr-x
flex++
353.36
KB
-rwxr-xr-x
freebcp
18.59
KB
-rwxr-xr-x
freetype-config
3.75
KB
-rwxr-xr-x
ftpasswd
33.94
KB
-rwxr-xr-x
ftpcount
15.67
KB
-rwxr-xr-x
ftpdctl
82.73
KB
-rwxr-xr-x
ftpmail
13.69
KB
-rwxr-xr-x
ftpquota
32.21
KB
-rwxr-xr-x
ftptop
23.52
KB
-rwxr-xr-x
ftpwho
47.84
KB
-rwxr-xr-x
gd2copypal
10.15
KB
-rwxr-xr-x
gd2togif
10.14
KB
-rwxr-xr-x
gd2topng
10.16
KB
-rwxr-xr-x
gdcmpgif
10.15
KB
-rwxr-xr-x
gdparttopng
10.16
KB
-rwxr-xr-x
gdtopng
10.14
KB
-rwxr-xr-x
genbrk
14.84
KB
-rwxr-xr-x
gencfu
10.74
KB
-rwxr-xr-x
gencnval
22.73
KB
-rwxr-xr-x
gendict
22.91
KB
-rwxr-xr-x
gen_php_doc.sh
240
B
-rwxr-xr-x
genrb
161.05
KB
-rwxr-xr-x
GET
14.34
KB
-r-xr-xr-x
gettext
34.53
KB
-rwxr-xr-x
gettextize
42.73
KB
-rwxr-xr-x
gettext.sh
4.52
KB
-rwxr-xr-x
gif2tiff
14.48
KB
-rwxr-xr-x
giftogd2
10.15
KB
-rwxr-xr-x
h2ph
28.55
KB
-rwxr-xr-x
h2xs
59.52
KB
-rwxr-xr-x
HEAD
14.34
KB
-r-xr-xr-x
htcacheclean
30.53
KB
-rwxr-xr-x
htdbm
18.47
KB
-rwxr-xr-x
htdigest
10.27
KB
-rwxr-xr-x
html_template_phplibtool
107
B
-rwxr-xr-x
htpasswd
18.41
KB
-rwxr-xr-x
httpd
696.97
KB
-rwxr-xr-x
httxt2dbm
10.23
KB
-rwxr-xr-x
iconv
26.38
KB
-rwxr-xr-x
icu-config
21.58
KB
-rwxr-xr-x
icuinfo
10.54
KB
-rwxr-xr-x
infocmp
58.65
KB
-rwxr-xr-x
infotocap
66.7
KB
-rwxr-xr-x
innochecksum
3.62
MB
-rwxr-xr-x
instmodsh
4.16
KB
-r-xr-xr-x
jpegtran
42.36
KB
-rwxr-xr-x
json_pp
4.89
KB
-rwxr-xr-x
ldapadd
67.11
KB
-rwxr-xr-x
ldapcompare
55
KB
-rwxr-xr-x
ldapdelete
59.09
KB
-rwxr-xr-x
ldapexop
55.06
KB
-rwxr-xr-x
ldapmodify
67.11
KB
-rwxr-xr-x
ldapmodrdn
55
KB
-rwxr-xr-x
ldappasswd
55.03
KB
-rwxr-xr-x
ldapsearch
79.36
KB
-rwxr-xr-x
ldapurl
18.34
KB
-rwxr-xr-x
ldapwhoami
55.02
KB
-rwxr-xr-x
libmcrypt-config
1.43
KB
-rwxr-xr-x
libnetcfg
15.42
KB
-rwxr-xr-x
libpng16-config
2.27
KB
-rwxr-xr-x
libpng-config
2.27
KB
-rwxr-xr-x
listaction
170.55
KB
-rwxr-xr-x
listaction_d
170.54
KB
-rwxr-xr-x
listfdb
14.17
KB
-rwxr-xr-x
listjpeg
6.13
KB
-rwxr-xr-x
listmp3
10.54
KB
-rwxr-xr-x
listswf
174.55
KB
-rwxr-xr-x
listswf_d
174.54
KB
-rwxr-xr-x
logresolve
10.34
KB
-rwxr-xr-x
lwp-download
8.34
KB
-r-xr-xr-x
lwp-mirror
2.45
KB
-r-xr-xr-x
lwp-request
14.34
KB
-r-xr-xr-x
lwp-rget
14.78
KB
-r-xr-xr-x
makeconv
55.35
KB
-rwxr-xr-x
makefdb
70.41
KB
-rwxr-xr-x
makeswf
23.2
KB
-rwxr-xr-x
mariabackup
22.87
MB
-rwxr-xr-x
mariadb
4.28
MB
-rwxr-xr-x
mariadb-access
109.37
KB
-rwxr-xr-x
mariadb-admin
3.83
MB
-rwxr-xr-x
mariadb-backup
22.87
MB
-rwxr-xr-x
mariadb-binlog
4.05
MB
-rwxr-xr-x
mariadb-check
3.83
MB
-rwxr-xr-x
mariadb-client-test
4.38
MB
-rwxr-xr-x
mariadb_config
10.52
KB
-rwxr-xr-x
mariadb-convert-table-format
4.12
KB
-rwxr-xr-x
mariadbd-multi
26.76
KB
-rwxr-xr-x
mariadbd-safe
30.43
KB
-rwxr-xr-x
mariadbd-safe-helper
3.49
MB
-rwxr-xr-x
mariadb-dump
3.92
MB
-rwxr-xr-x
mariadb-dumpslow
8.05
KB
-rwxr-xr-x
mariadb-find-rows
3.21
KB
-rwxr-xr-x
mariadb-fix-extensions
1.22
KB
-rwxr-xr-x
mariadb-hotcopy
34.14
KB
-rwxr-xr-x
mariadb-import
3.82
MB
-rwxr-xr-x
mariadb-install-db
21.48
KB
-rwxr-xr-x
mariadb-ldb
4.05
MB
-rwxr-xr-x
mariadb-plugin
3.53
MB
-rwxr-xr-x
mariadb-secure-installation
13.38
KB
-rwxr-xr-x
mariadb-setpermission
17.13
KB
-rwxr-xr-x
mariadb-show
3.82
MB
-rwxr-xr-x
mariadb-slap
3.84
MB
-rwxr-xr-x
mariadb-test
4.21
MB
-rwxr-xr-x
mariadb-tzinfo-to-sql
3.53
MB
-rwxr-xr-x
mariadb-upgrade
3.62
MB
-rwxr-xr-x
mariadb-waitpid
3.52
MB
-rwxr-xr-x
mbstream
3.55
MB
-rwxr-xr-x
ming-config
561
B
-rwxr-xr-x
mp2bug
1.16
KB
-r-xr-xr-x
msgattrib
22.39
KB
-rwxr-xr-x
msgcat
18.38
KB
-rwxr-xr-x
msgcmp
22.49
KB
-rwxr-xr-x
msgcomm
18.37
KB
-rwxr-xr-x
msgconv
18.35
KB
-rwxr-xr-x
msgen
18.35
KB
-rwxr-xr-x
msgexec
14.38
KB
-rwxr-xr-x
msgfilter
26.45
KB
-rwxr-xr-x
msgfmt
79.41
KB
-rwxr-xr-x
msggrep
46.73
KB
-rwxr-xr-x
msginit
43.15
KB
-rwxr-xr-x
msgmerge
51.37
KB
-rwxr-xr-x
msgunfmt
30.57
KB
-rwxr-xr-x
msguniq
18.36
KB
-rwxr-xr-x
msql2mysql
1.42
KB
-rwxr-xr-x
myisamchk
4
MB
-rwxr-xr-x
myisam_ftdump
3.88
MB
-rwxr-xr-x
myisamlog
3.86
MB
-rwxr-xr-x
myisampack
3.91
MB
-rwxr-xr-x
my_print_defaults
3.53
MB
-rwxr-xr-x
myrocks_hotbackup
24.46
KB
-rwxr-xr-x
mysql
4.28
MB
-rwxr-xr-x
mysqlaccess
109.37
KB
-rwxr-xr-x
mysqladmin
3.83
MB
-rwxr-xr-x
mysqlbinlog
4.05
MB
-rwxr-xr-x
mysqlcheck
3.83
MB
-rwxr-xr-x
mysql_client_test
4.38
MB
-rwxr-xr-x
mysql_config
4.54
KB
-rwxr-xr-x
mysql_convert_table_format
4.12
KB
-rwxr-xr-x
mysqld_multi
26.76
KB
-rwxr-xr-x
mysqld_safe
30.43
KB
-rwxr-xr-x
mysqld_safe_helper
3.49
MB
-rwxr-xr-x
mysqldump
3.92
MB
-rwxr-xr-x
mysqldumpslow
8.05
KB
-rwxr-xr-x
mysql_find_rows
3.21
KB
-rwxr-xr-x
mysql_fix_extensions
1.22
KB
-rwxr-xr-x
mysqlhotcopy
34.14
KB
-rwxr-xr-x
mysqlimport
3.82
MB
-rwxr-xr-x
mysql_install_db
21.48
KB
-rwxr-xr-x
mysql_ldb
4.05
MB
-rwxr-xr-x
mysql_plugin
3.53
MB
-rwxr-xr-x
mysql_secure_installation
13.38
KB
-rwxr-xr-x
mysql.server
11.93
KB
-rwxr-xr-x
mysql_setpermission
17.13
KB
-rwxr-xr-x
mysqlshow
3.82
MB
-rwxr-xr-x
mysqlslap
3.84
MB
-rwxr-xr-x
mysqltest
4.21
MB
-rwxr-xr-x
mysql_tzinfo_to_sql
3.53
MB
-rwxr-xr-x
mysql_upgrade
3.62
MB
-rwxr-xr-x
mysql_waitpid
3.52
MB
-rwxr-xr-x
mytop
61.06
KB
-rwxr-xr-x
ncurses5-config
5.17
KB
-rwxr-xr-x
ngettext
34.55
KB
-rwxr-xr-x
onig-config
1.35
KB
-rwxr-xr-x
openssl
642.05
KB
-rwxr-xr-x
osql
8.84
KB
-rwxr-xr-x
pal2rgb
14.82
KB
-rwxr-xr-x
pcre-config
2.31
KB
-rwxr-xr-x
pcregrep
36.34
KB
-rwxr-xr-x
pcretest
66.56
KB
-rwxr-xr-x
pear
817
B
-rwxr-xr-x
peardev
838
B
-rwxr-xr-x
pearinfo
538
B
-rwxr-xr-x
pecl
751
B
-rwxr-xr-x
perl
3.3
MB
-rwxr-xr-x
perl5.34.1
3.3
MB
-rwxr-xr-x
perlbug
44.13
KB
-rwxr-xr-x
perldoc
274
B
-rwxr-xr-x
perlivp
10.58
KB
-rwxr-xr-x
perlthanks
44.13
KB
-rwxr-xr-x
perror
3.71
MB
-rwxr-xr-x
phar
14.89
KB
-rwxr-xr-x
phar.phar
14.89
KB
-rwxr-xr-x
php
18.06
MB
-rwxr-xr-x
php-8.2.12
18.06
MB
-rwxr-xr-x
php-cgi
18.06
MB
-rwxr-xr-x
php-cgi-8.2.12
18.06
MB
-rwxr-xr-x
php-config
4.39
KB
-rwxr-xr-x
php-config-8.2.12
4.39
KB
-rwxr-xr-x
phpdbg
18.06
MB
-rwxr-xr-x
phpize
4.43
KB
-rwxr-xr-x
phpize-8.2.12
4.43
KB
-rwxr-xr-x
phpunit
1.9
KB
-rwxr-xr-x
piconv
8.18
KB
-rwxr-xr-x
pkgdata
43.7
KB
-rwxr-xr-x
pl2pm
4.44
KB
-rwxr-xr-x
png2dbl
14.38
KB
-rwxr-xr-x
pngfix
46.48
KB
-rwxr-xr-x
png-fix-itxt
6.11
KB
-rwxr-xr-x
pngtogd
10.14
KB
-rwxr-xr-x
pngtogd2
10.15
KB
-rwxr-xr-x
pod2html
4.05
KB
-rwxr-xr-x
pod2man
14.69
KB
-rwxr-xr-x
pod2text
10.56
KB
-rwxr-xr-x
pod2usage
4.02
KB
-rwxr-xr-x
podchecker
3.58
KB
-rwxr-xr-x
POST
14.34
KB
-r-xr-xr-x
ppm2tiff
14.51
KB
-rwxr-xr-x
prove
13.35
KB
-rwxr-xr-x
prxs
8.96
KB
-rwxr-xr-x
ptar
3.49
KB
-rwxr-xr-x
ptardiff
2.59
KB
-rwxr-xr-x
ptargrep
4.3
KB
-rwxr-xr-x
ras2tiff
10.48
KB
-rwxr-xr-x
raw2adpcm
10.21
KB
-rwxr-xr-x
raw2tiff
18.35
KB
-rwxr-xr-x
rdjpgcom
10.18
KB
-rwxr-xr-x
recode-sr-latin
14.33
KB
-rwxr-xr-x
replace
3.5
MB
-rwxr-xr-x
reset
18.59
KB
-rwxr-xr-x
resolveip
3.52
MB
-rwxr-xr-x
resolve_stack_dump
3.53
MB
-rwxr-xr-x
rgb2ycbcr
14.46
KB
-rwxr-xr-x
rotatelogs
18.41
KB
-rwxr-xr-x
sabcmd
21.13
KB
-rwxr-xr-x
sablot-config
1.11
KB
-rwxr-xr-x
shasum
9.76
KB
-rwxr-xr-x
splain
18.97
KB
-rwxr-xr-x
sqlite
27.8
KB
-rwxr-xr-x
sqlite3
1.74
MB
-rwxr-xr-x
sst_dump
4.04
MB
-rwxr-xr-x
streamzip
5.31
KB
-r-xr-xr-x
suexec
14.36
KB
-rwsr-xr-x
swftocxx
154.57
KB
-rwxr-xr-x
swftoperl
154.57
KB
-rwxr-xr-x
swftophp
154.57
KB
-rwxr-xr-x
swftopython
154.57
KB
-rwxr-xr-x
swftotcl
154.57
KB
-rwxr-xr-x
tabs
14.31
KB
-rwxr-xr-x
tdspool
286.9
KB
-rwxr-xr-x
thumbnail
14.92
KB
-rwxr-xr-x
tic
66.7
KB
-rwxr-xr-x
tiff2bw
14.8
KB
-rwxr-xr-x
tiff2pdf
66.52
KB
-rwxr-xr-x
tiff2ps
55.95
KB
-rwxr-xr-x
tiff2rgba
14.32
KB
-rwxr-xr-x
tiffcmp
18.41
KB
-rwxr-xr-x
tiffcp
43.31
KB
-rwxr-xr-x
tiffcrop
112.88
KB
-rwxr-xr-x
tiffdither
14.48
KB
-rwxr-xr-x
tiffdump
18.52
KB
-rwxr-xr-x
tiffinfo
18.55
KB
-rwxr-xr-x
tiffmedian
22.44
KB
-rwxr-xr-x
tiffset
10.23
KB
-rwxr-xr-x
tiffsplit
14.3
KB
-rwxr-xr-x
toe
14.38
KB
-rwxr-xr-x
tput
14.41
KB
-rwxr-xr-x
tset
18.59
KB
-rwxr-xr-x
tsql
282.99
KB
-rwxr-xr-x
uconv
47.36
KB
-rwxr-xr-x
unzip-mem
14.21
KB
-rwxr-xr-x
unzzip
10.21
KB
-rwxr-xr-x
unzzipcat
10.2
KB
-rwxr-xr-x
unzzipcat-mem
10.17
KB
-rwxr-xr-x
unzzipcat-seeko
10.2
KB
-rwxr-xr-x
unzzipdir
6.16
KB
-rwxr-xr-x
unzzipdir-mem
6.13
KB
-rwxr-xr-x
use-devel-checklib
2.81
KB
-r-xr-xr-x
wcmgr
6.1
KB
-rwxr-xr-x
webalizer
157.1
KB
-rwxr-xr-x
webazolver
157.1
KB
-rwxr-xr-x
webpng
14.28
KB
-rwxr-xr-x
wrjpgcom
10.19
KB
-rwxr-xr-x
wsrep_sst_backup
2.95
KB
-rwxr-xr-x
wsrep_sst_common
54.05
KB
-rw-r--r--
wsrep_sst_mariabackup
51.01
KB
-rwxr-xr-x
wsrep_sst_mysqldump
7.7
KB
-rwxr-xr-x
wsrep_sst_rsync
32.31
KB
-rwxr-xr-x
wsrep_sst_rsync_wan
32.31
KB
-rwxr-xr-x
xgettext
330.1
KB
-rwxr-xr-x
xml2-config
1.69
KB
-rwxr-xr-x
xmlcatalog
14.35
KB
-rwxr-xr-x
xmllint
64.38
KB
-rwxr-xr-x
xmlwf
26.57
KB
-rwxr-xr-x
xslt-config
2.36
KB
-rwxr-xr-x
xsltproc
22.52
KB
-rwxr-xr-x
xsubpp
5.06
KB
-rwxr-xr-x
yacc
45
B
-rwxr-xr-x
zipcmp
19
KB
-rwxr-xr-x
zipdetails
49.95
KB
-r-xr-xr-x
zipmerge
14.88
KB
-rwxr-xr-x
ziptool
27.7
KB
-rwxr-xr-x
zzcat
6.13
KB
-rwxr-xr-x
zzdir
10.16
KB
-rwxr-xr-x
zzxorcat
10.16
KB
-rwxr-xr-x
zzxorcopy
10.17
KB
-rwxr-xr-x
zzxordir
10.19
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : mariadbd-multi
#!/usr/bin/perl # Copyright (c) 2000, 2017, Oracle and/or its affiliates. # Copyright (c) 2010, 2017, MariaDB Corporation # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, # MA 02110-1335 USA use Getopt::Long; use POSIX qw(strftime getcwd); use File::Path qw(mkpath); $|=1; $VER="3.0"; my @defaults_options; # Leading --no-defaults, --defaults-file, etc. $opt_example = 0; $opt_help = 0; $opt_log = undef(); $opt_mysqladmin = "/opt/lampp/bin/mysqladmin"; $opt_mysqld = "./sbin/mysqld"; $opt_no_log = 0; $opt_password = undef(); $opt_tcp_ip = 0; $opt_user = "root"; $opt_version = 0; $opt_silent = 0; $opt_verbose = 0; $opt_wsrep_new_cluster = 0; my $my_print_defaults_exists= 1; my $logdir= undef(); my ($mysqld, $mysqladmin, $groupids, $homedir, $my_progname); $homedir = $ENV{HOME}; $my_progname = $0; $my_progname =~ s/.*[\/]//; if (defined($ENV{UMASK})) { my $UMASK = $ENV{UMASK}; my $m; my $fmode = "0640"; if(($UMASK =~ m/[^0246]/) || ($UMASK =~ m/^[^0]/) || (length($UMASK) != 4)) { printf("UMASK must be a 3-digit mode with an additional leading 0 to indicate octal.\n"); printf("The first digit will be corrected to 6, the others may be 0, 2, 4, or 6.\n"); } else { $fmode= substr $UMASK, 2, 2; $fmode= "06${fmode}"; } if($fmode != $UMASK) { printf("UMASK corrected from $UMASK to $fmode ...\n"); } $fmode= oct($fmode); umask($fmode); } main(); #### #### main sub routine #### sub main { my $flag_exit= 0; if (!defined(my_which(my_print_defaults))) { # We can't throw out yet, since --version, --help, or --example may # have been given print "WARNING: my_print_defaults command not found.\n"; print "Please make sure you have this command available and\n"; print "in your path. The command is available from the latest\n"; print "MariaDB distribution.\n"; $my_print_defaults_exists= 0; } # Remove leading defaults options from @ARGV while (@ARGV > 0) { last unless $ARGV[0] =~ /^--(?:no-defaults$|(?:defaults-file|defaults-extra-file)=)/; push @defaults_options, (shift @ARGV); } foreach (@defaults_options) { $_ = quote_shell_word($_); } # Add [mysqld_multi] options to front of @ARGV, ready for GetOptions() unshift @ARGV, defaults_for_group('mysqld_multi'); # We've already handled --no-defaults, --defaults-file, etc. if (!GetOptions("help", "example", "version", "mysqld=s", "mysqladmin=s", "user=s", "password=s", "log=s", "no-log", "tcp-ip", "silent", "verbose", "wsrep-new-cluster")) { $flag_exit= 1; } usage() if ($opt_help); if ($opt_verbose && $opt_silent) { print "Both --verbose and --silent have been given. Some of the warnings "; print "will be disabled\nand some will be enabled.\n\n"; } init_log() if (!defined($opt_log)); $groupids = $ARGV[1]; if ($opt_version) { print "$my_progname version $VER by Jani Tolonen\n"; exit(0); } example() if ($opt_example); if ($flag_exit) { print "Error with an option, see $my_progname --help for more info.\n"; exit(1); } if (!defined(my_which(my_print_defaults))) { print "ABORT: Can't find command 'my_print_defaults'.\n"; print "This command is available from the latest MariaDB\n"; print "distribution. Please make sure you have the command\n"; print "in your PATH.\n"; exit(1); } usage() if (!defined($ARGV[0]) || (!($ARGV[0] =~ m/^start$/i) && !($ARGV[0] =~ m/^stop$/i) && !($ARGV[0] =~ m/^reload$/i) && !($ARGV[0] =~ m/^report$/i))); if (!$opt_no_log) { w2log("$my_progname log file version $VER; run: ", "$opt_log", 1, 0); } else { print "$my_progname log file version $VER; run: "; print strftime "%a %b %e %H:%M:%S %Y", localtime; print "\n"; } if (($ARGV[0] =~ m/^start$/i) || ($ARGV[0] =~ m/^reload$/i)) { if (!defined(($mysqld= my_which($opt_mysqld))) && $opt_verbose) { print "WARNING: Couldn't find the default mysqld binary.\n"; print "Tried: $opt_mysqld\n"; print "This is OK, if you are using option \"mysqld=...\" in "; print "groups [mysqldN] separately for each.\n\n"; } if ($ARGV[0] =~ m/^start$/i) { start_mysqlds(); } elsif ($ARGV[0] =~ m/^reload$/i) { reload_mysqlds(); } } else { if (!defined(($mysqladmin= my_which($opt_mysqladmin))) && $opt_verbose) { print "WARNING: Couldn't find the default mysqladmin binary.\n"; print "Tried: $opt_mysqladmin\n"; print "This is OK, if you are using option \"mysqladmin=...\" in "; print "groups [mysqldN] separately for each.\n\n"; } if ($ARGV[0] =~ m/^report$/i) { report_mysqlds(); } else { stop_mysqlds(); } } } # # Quote word for shell # sub quote_shell_word { my ($option)= @_; $option =~ s!([^\w=./-])!\\$1!g; return $option; } #### #### get options for a group #### sub defaults_for_group { my ($group) = @_; return () unless $my_print_defaults_exists; my $com= join ' ', 'my_print_defaults', @defaults_options, $group; my @defaults = `$com`; chomp @defaults; return @defaults; } #### #### Init log file. Check for appropriate place for log file, in the following #### order: my_print_defaults mysqld datadir, /opt/lampp/share #### sub init_log { foreach my $opt (defaults_for_group('--mysqld')) { if ($opt =~ m/^--datadir=(.*)/ && -d "$1" && -w "$1") { $logdir= $1; } } if (!defined($logdir)) { $logdir= "/opt/lampp/share" if (-d "/opt/lampp/share" && -w "/opt/lampp/share"); } if (!defined($logdir)) { # Log file was not specified and we could not log to a standard place, # so log file be disabled for now. if (!$opt_silent) { print "WARNING: Log file disabled. Maybe directory or file isn't writable?\n"; } $opt_no_log= 1; } else { $opt_log= "$logdir/mysqld_multi.log"; } } #### #### Report living and not running MariaDB servers #### sub report_mysqlds { my (@groups, $com, $i, @options, $pec); print "Reporting MariaDB servers\n"; if (!$opt_no_log) { w2log("\nReporting MariaDB servers","$opt_log",0,0); } @groups = &find_groups($groupids); for ($i = 0; defined($groups[$i]); $i++) { $com= get_mysqladmin_options($i, @groups); $com.= " ping >> /dev/null 2>&1"; system($com); $pec = $? >> 8; if ($pec) { print "MariaDB server from group: $groups[$i] is not running\n"; if (!$opt_no_log) { w2log("MariaDB server from group: $groups[$i] is not running", "$opt_log", 0, 0); } } else { print "MariaDB server from group: $groups[$i] is running\n"; if (!$opt_no_log) { w2log("MariaDB server from group: $groups[$i] is running", "$opt_log", 0, 0); } } } if (!$i) { print "No groups to be reported (check your GNRs)\n"; if (!$opt_no_log) { w2log("No groups to be reported (check your GNRs)", "$opt_log", 0, 0); } } } #### #### start multiple servers #### sub start_mysqlds() { my (@groups, $com, $tmp, $i, @options, $j, $mysqld_found, $suffix_found, $info_sent); $suffix_found= 0; if (!$opt_no_log) { w2log("\nStarting MariaDB servers\n","$opt_log",0,0); } else { print "\nStarting MariaDB servers\n"; } @groups = &find_groups($groupids); for ($i = 0; defined($groups[$i]); $i++) { @options = defaults_for_group($groups[$i]); $basedir_found= 0; # The default $mysqld_found= 1; # The default $mysqld_found= 0 if (!length($mysqld)); $com= "$mysqld"; for ($j = 0, $tmp= ""; defined($options[$j]); $j++) { if ("--datadir=" eq substr($options[$j], 0, 10)) { $datadir = $options[$j]; $datadir =~ s/\-\-datadir\=//; eval { mkpath($datadir) }; if ($@) { print "FATAL ERROR: Cannot create data directory $datadir: $!\n"; exit(1); } if (! -d $datadir."/mysql") { if (-w $datadir) { print "\n\nInstalling new database in $datadir\n\n"; $install_cmd="/opt/lampp/bin/mysql_install_db "; $install_cmd.="--user=mysql "; $install_cmd.="--datadir=$datadir"; system($install_cmd); } else { print "\n"; print "FATAL ERROR: Tried to create mysqld under group [$groups[$i]],\n"; print "but the data directory is not writable.\n"; print "data directory used: $datadir\n"; exit(1); } } if (! -d $datadir."/mysql") { print "\n"; print "FATAL ERROR: Tried to start mysqld under group [$groups[$i]],\n"; print "but no data directory was found or could be created.\n"; print "data directory used: $datadir\n"; exit(1); } } if ("--mysqladmin=" eq substr($options[$j], 0, 13)) { # catch this and ignore } elsif ("--mysqld=" eq substr($options[$j], 0, 9)) { $options[$j]=~ s/\-\-mysqld\=//; $com= $options[$j]; $mysqld_found= 1; } elsif ("--basedir=" eq substr($options[$j], 0, 10)) { $basedir= $options[$j]; $basedir =~ s/^--basedir=//; $basedir_found= 1; $options[$j]= quote_shell_word($options[$j]); $tmp.= " $options[$j]"; } elsif ("--defaults-group-suffix=" eq substr($options[$j], 0, 24)) { $suffix_found= 1; } else { $options[$j]= quote_shell_word($options[$j]); $tmp.= " $options[$j]"; } } if ($opt_verbose && $com =~ m/\/(safe_mysqld|mysqld_safe)$/ && !$info_sent) { print "WARNING: $1 is being used to start mysqld. In this case you "; print "may need to pass\n\"ledir=...\" under groups [mysqldN] to "; print "$1 in order to find the actual mysqld binary.\n"; print "ledir (library executable directory) should be the path to the "; print "wanted mysqld binary.\n\n"; $info_sent= 1; } if (!$suffix_found) { $com.= " --defaults-group-suffix="; $com.= substr($groups[$i],6); } $com.= $tmp; if ($opt_wsrep_new_cluster) { $com.= " --wsrep-new-cluster"; } $com.= " >> $opt_log 2>&1" if (!$opt_no_log); $com.= " &"; if (!$mysqld_found) { print "\n"; print "FATAL ERROR: Tried to start mysqld under group [$groups[$i]], "; print "but no mysqld binary was found.\n"; print "Please add \"mysqld=...\" in group [mysqld_multi], or add it to "; print "group [$groups[$i]] separately.\n"; exit(1); } if ($basedir_found) { $curdir=getcwd(); chdir($basedir) or die "Can't change to datadir $basedir"; } system($com); if ($basedir_found) { chdir($curdir) or die "Can't change back to original dir $curdir"; } } if (!$i && !$opt_no_log) { w2log("No MariaDB servers to be started (check your GNRs)", "$opt_log", 0, 0); } } #### #### reload multiple servers #### sub reload_mysqlds() { my (@groups, $com, $tmp, $i, @options, $j); if (!$opt_no_log) { w2log("\nReloading MySQL servers\n","$opt_log",0,0); } else { print "\nReloading MySQL servers\n"; } @groups = &find_groups($groupids); for ($i = 0; defined($groups[$i]); $i++) { $mysqld_server = $mysqld; @options = defaults_for_group($groups[$i]); for ($j = 0, $tmp= ""; defined($options[$j]); $j++) { if ("--mysqladmin=" eq substr($options[$j], 0, 13)) { # catch this and ignore } elsif ("--mysqld=" eq substr($options[$j], 0, 9)) { $options[$j] =~ s/\-\-mysqld\=//; $mysqld_server = $options[$j]; } elsif ("--pid-file=" eq substr($options[$j], 0, 11)) { $options[$j] =~ s/\-\-pid-file\=//; $pid_file = $options[$j]; } } $com = "killproc -p $pid_file -HUP $mysqld_server"; system($com); $com = "touch $pid_file"; system($com); } if (!$i && !$opt_no_log) { w2log("No MySQL servers to be reloaded (check your GNRs)", "$opt_log", 0, 0); } } ### #### stop multiple servers #### sub stop_mysqlds() { my (@groups, $com, $i, @options); if (!$opt_no_log) { w2log("\nStopping MariaDB servers\n","$opt_log",0,0); } else { print "\nStopping MariaDB servers\n"; } @groups = &find_groups($groupids); for ($i = 0; defined($groups[$i]); $i++) { $com= get_mysqladmin_options($i, @groups); $com.= " shutdown"; $com.= " >> $opt_log 2>&1" if (!$opt_no_log); $com.= " &"; system($com); } if (!$i && !$opt_no_log) { w2log("No MariaDB servers to be stopped (check your GNRs)", "$opt_log", 0, 0); } } #### #### Sub function for mysqladmin option parsing #### sub get_mysqladmin_options { my ($i, @groups)= @_; my ($mysqladmin_found, $com, $tmp, $j); @options = defaults_for_group($groups[$i]); $mysqladmin_found= 1; # The default $mysqladmin_found= 0 if (!length($mysqladmin)); $com = "$mysqladmin"; $tmp = " -u $opt_user"; if (defined($opt_password)) { my $pw= $opt_password; # Protect single quotes in password $pw =~ s/'/'"'"'/g; $tmp.= " -p'$pw'"; } $tmp.= $opt_tcp_ip ? " -h 127.0.0.1" : ""; for ($j = 0; defined($options[$j]); $j++) { if ("--mysqladmin=" eq substr($options[$j], 0, 13)) { $options[$j]=~ s/\-\-mysqladmin\=//; $com= $options[$j]; $mysqladmin_found= 1; } elsif ((($options[$j] =~ m/^(\-\-socket\=)(.*)$/) && !$opt_tcp_ip) || ($options[$j] =~ m/^(\-\-port\=)(.*)$/)) { $tmp.= " $options[$j]"; } } if (!$mysqladmin_found) { print "\n"; print "FATAL ERROR: Tried to use mysqladmin in group [$groups[$i]], "; print "but no mysqladmin binary was found.\n"; print "Please add \"mysqladmin=...\" in group [mysqld_multi], or "; print "in group [$groups[$i]].\n"; exit(1); } $com.= $tmp; return $com; } # Return a list of option files which can be opened. Similar, but not # identical, to behavior of my_search_option_files() # TODO implement and use my_print_defaults --list-groups instead sub list_defaults_files { my %opt; foreach (@defaults_options) { return () if /^--no-defaults$/; $opt{$1} = $2 if /^--defaults-(extra-file|file)=(.*)$/; } return ($opt{file}) if exists $opt{file}; my @dirs; # same rule as in mysys/my_default.c if ('/etc') { push @dirs, '/etc/my.cnf'; } else { push @dirs, '/etc/my.cnf', '/etc/mysql/my.cnf'; } push @dirs, "$ENV{MYSQL_HOME}/my.cnf" if $ENV{MYSQL_HOME}; push @dirs, $opt{'extra-file'} if $opt{'extra-file'}; push @dirs, "$ENV{HOME}/.my.cnf" if $ENV{HOME}; return @dirs; } # Takes a specification of GNRs (see --help), and returns a list of matching # groups which actually are mentioned in a relevant config file sub find_groups { my ($raw_gids) = @_; my %gids; my @groups; if (defined($raw_gids)) { # Make a hash of the wanted group ids foreach my $raw_gid (split ',', $raw_gids) { # Match 123 or 123-456 my ($start, $end) = ($raw_gid =~ /^\s*(\d+)(?:\s*-\s*(\d+))?\s*$/); $end = $start if not defined $end; if (not defined $start or $end < $start or $start < 0) { print "ABORT: Bad GNR: $raw_gid; see $my_progname --help\n"; exit(1); } foreach my $i ($start .. $end) { # Use $i + 0 to normalize numbers (002 + 0 -> 2) $gids{$i + 0}= 1; } } } my %seen; my @defaults_files = list_defaults_files(); while (@defaults_files) { my $file = shift @defaults_files; next unless defined $file and not $seen{$file}++ and open CONF, '<', $file; while (<CONF>) { if (/^\s*\[\s*(mysqld)(\d+)\s*\]\s*$/) { #warn "Found a group: $1$2\n"; # Use $2 + 0 to normalize numbers (002 + 0 -> 2) if (not defined($raw_gids) or $gids{$2 + 0}) { push @groups, "$1$2"; } } elsif (/^\s*!include\s+(\S.*?)\s*$/) { push @defaults_files, $1; } elsif (/^\s*!includedir\s+(\S.*?)\s*$/) { push @defaults_files, <$1/*.cnf>; } } close CONF; } return @groups; } #### #### w2log: Write to a logfile. #### 1.arg: append to the log file (given string, or from a file. if a file, #### file will be read from $opt_logdir) #### 2.arg: logfile -name (w2log assumes that the logfile is in $opt_logdir). #### 3.arg. 0 | 1, if true, print current date to the logfile. 3. arg will #### be ignored, if 1. arg is a file. #### 4.arg. 0 | 1, if true, first argument is a file, else a string #### sub w2log { my ($msg, $file, $date_flag, $is_file)= @_; my (@data); open (LOGFILE, ">>$opt_log") or die "FATAL: w2log: Couldn't open log file: $opt_log\n"; if ($is_file) { open (FROMFILE, "<$msg") && (@data=<FROMFILE>) && close(FROMFILE) or die "FATAL: w2log: Couldn't open file: $msg\n"; foreach my $line (@data) { print LOGFILE "$line"; } } else { print LOGFILE "$msg"; print LOGFILE strftime "%a %b %e %H:%M:%S %Y", localtime if ($date_flag); print LOGFILE "\n"; } close (LOGFILE); return; } #### #### my_which is used, because we can't assume that every system has the #### which -command. my_which can take only one argument at a time. #### Return values: requested system command with the first found path, #### or undefined, if not found. #### sub my_which { my ($command) = @_; my (@paths, $path); # If the argument is not 'my_print_defaults' then it would be of the format # <absolute_path>/<program> return $command if ($command ne 'my_print_defaults' && -f $command && -x $command); @paths = split(':', $ENV{'PATH'}); foreach $path (@paths) { $path .= "/$command"; return $path if (-f $path && -x $path); } return undef(); } #### #### example #### sub example { print <<EOF; # This is an example of a my.cnf file for $my_progname. # Usually this file is located in home dir ~/.my.cnf or /etc/my.cnf # # SOME IMPORTANT NOTES FOLLOW: # # 1.COMMON USER # # Make sure that the MariaDB user, who is stopping the mysqld services, has # the same password to all MariaDB servers being accessed by $my_progname. # This user needs to have the 'Shutdown_priv' -privilege, but for security # reasons should have no other privileges. It is advised that you create a # common 'multi_admin' user for all MariaDB servers being controlled by # $my_progname. Here is an example how to do it: # # GRANT SHUTDOWN ON *.* TO multi_admin\@localhost IDENTIFIED BY 'password' # # You will need to apply the above to all MariaDB servers that are being # controlled by $my_progname. 'multi_admin' will shutdown the servers # using 'mysqladmin' -binary, when '$my_progname stop' is being called. # # 2.PID-FILE # # If you are using mysqld_safe to start mysqld, make sure that every # MariaDB server has a separate pid-file. In order to use mysqld_safe # via $my_progname, you need to use two options: # # mysqld=/path/to/mysqld_safe # ledir=/path/to/mysqld-binary/ # # ledir (library executable directory), is an option that only mysqld_safe # accepts, so you will get an error if you try to pass it to mysqld directly. # For this reason you might want to use the above options within [mysqld#] # group directly. # # 3.DATA DIRECTORY # # It is NOT advised to run many MariaDB servers within the same data directory. # You can do so, but please make sure to understand and deal with the # underlying caveats. In short they are: # - Speed penalty # - Risk of table/data corruption # - Data synchronising problems between the running servers # - Heavily media (disk) bound # - Relies on the system (external) file locking # - Is not applicable with all table types. (Such as InnoDB) # Trying so will end up with undesirable results. # # 4.TCP/IP Port # # Every server requires one and it must be unique. # # 5.[mysqld#] Groups # # In the example below the first and the fifth mysqld group was # intentionally left out. You may have 'gaps' in the config file. This # gives you more flexibility. # # 6.MariaDB Server User # # You can pass the user=... option inside [mysqld#] groups. This # can be very handy in some cases, but then you need to run $my_progname # as UNIX root. # # 7.A Start-up Manage Script for $my_progname # # In the recent MariaDB distributions you can find a file called # mysqld_multi.server.sh. It is a wrapper for $my_progname. This can # be used to start and stop multiple servers during boot and shutdown. # # You can place the file in /etc/init.d/mysqld_multi.server.sh and # make the needed symbolic links to it from various run levels # (as per Linux/Unix standard). You may even replace the # /etc/init.d/mysql.server script with it. # # Before using, you must create a my.cnf file either in /opt/lampp/my.cnf # or /root/.my.cnf and add the [mysqld_multi] and [mysqld#] groups. # # The script can be found from support-files/mysqld_multi.server.sh # in MariaDB distribution. (Verify the script before using) # [mysqld_multi] mysqld = /opt/lampp/bin/mysqld_safe mysqladmin = /opt/lampp/bin/mysqladmin user = multi_admin password = my_password [mysqld2] socket = /tmp/mysql.sock2 port = 3307 pid-file = /opt/lampp/var/mysql2/hostname.pid2 datadir = /opt/lampp/var/mysql2 language = /opt/lampp/share/mysql/english user = unix_user1 [mysqld3] mysqld = /path/to/mysqld_safe ledir = /path/to/mysqld-binary/ mysqladmin = /path/to/mysqladmin socket = /tmp/mysql.sock3 port = 3308 pid-file = /opt/lampp/var/mysql3/hostname.pid3 datadir = /opt/lampp/var/mysql3 language = /opt/lampp/share/mysql/swedish user = unix_user2 [mysqld4] socket = /tmp/mysql.sock4 port = 3309 pid-file = /opt/lampp/var/mysql4/hostname.pid4 datadir = /opt/lampp/var/mysql4 language = /opt/lampp/share/mysql/estonia user = unix_user3 [mysqld6] socket = /tmp/mysql.sock6 port = 3311 pid-file = /opt/lampp/var/mysql6/hostname.pid6 datadir = /opt/lampp/var/mysql6 language = /opt/lampp/share/mysql/japanese user = unix_user4 EOF exit(0); } #### #### usage #### sub usage { print <<EOF; $my_progname version $VER by Jani Tolonen Description: $my_progname can be used to start, reload, or stop any number of separate mysqld processes running in different TCP/IP ports and UNIX sockets. $my_progname can read group [mysqld_multi] from my.cnf file. You may want to put options mysqld=... and mysqladmin=... there. Since version 2.10 these options can also be given under groups [mysqld#], which gives more control over different versions. One can have the default mysqld and mysqladmin under group [mysqld_multi], but this is not mandatory. Please note that if mysqld or mysqladmin is missing from both [mysqld_multi] and [mysqld#], a group that is tried to be used, $my_progname will abort with an error. $my_progname will search for groups named [mysqld#] from my.cnf (or the given --defaults-extra-file=...), where '#' can be any positive integer starting from 1. These groups should be the same as the regular [mysqld] group, but with those port, socket and any other options that are to be used with each separate mysqld process. The number in the group name has another function; it can be used for starting, reloading, stopping, or reporting any specific mysqld server. Usage: $my_progname [OPTIONS] {start|reload|stop|report} [GNR,GNR,GNR...] or $my_progname [OPTIONS] {start|reload|stop|report} [GNR-GNR,GNR,GNR-GNR,...] The GNR means the group number. You can start, reload, stop or report any GNR, or several of them at the same time. (See --example) The GNRs list can be comma separated or a dash combined. The latter means that all the GNRs between GNR1-GNR2 will be affected. Without GNR argument all the groups found will either be started, reloaded, stopped, or reported. Note that syntax for specifying GNRs must appear without spaces. Options: These options must be given before any others: --no-defaults Do not read any defaults file --defaults-file=... Read only this configuration file, do not read the standard system-wide and user-specific files --defaults-extra-file=... Read this configuration file in addition to the standard system-wide and user-specific files Using: @{[join ' ', @defaults_options]} --example Give an example of a config file with extra information. --help Print this help and exit. --log=... Log file. Full path to and the name for the log file. NOTE: If the file exists, everything will be appended. Using: $opt_log --mysqladmin=... mysqladmin binary to be used for a server shutdown. Since version 2.10 this can be given within groups [mysqld#] Using: $mysqladmin --mysqld=... mysqld binary to be used. Note that you can give mysqld_safe to this option also. The options are passed to mysqld. Just make sure you have mysqld in your PATH or fix mysqld_safe. Using: $mysqld Please note: Since mysqld_multi version 2.3 you can also give this option inside groups [mysqld#] in ~/.my.cnf, where '#' stands for an integer (number) of the group in question. This will be recognised as a special option and will not be passed to the mysqld. This will allow one to start different mysqld versions with mysqld_multi. --no-log Print to stdout instead of the log file. By default the log file is turned on. --password=... Password for mysqladmin user. --silent Disable warnings. --tcp-ip Connect to the MariaDB server(s) via the TCP/IP port instead of the UNIX socket. This affects stopping and reporting. If a socket file is missing, the server may still be running, but can be accessed only via the TCP/IP port. By default connecting is done via the UNIX socket. --user=... mysqladmin user. Using: $opt_user --verbose Be more verbose. --version Print the version number and exit. --wsrep-new-cluster Bootstrap a cluster. EOF exit(0); }
Close