This is a discussion on RE: [Snort-users] mysql not starting at boot within the Snort forums, part of the System Security and Security Related category; Check the rc=2E<runlevel> dir for a SXXmysqld file, it will be a symlink=0D= =0Ato the ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Check the rc=2E<runlevel> dir for a SXXmysqld file, it will be a symlink=0D=
=0Ato the file in init=2Ed=2E or try "chkconfig mysqld on" then "service= =0D=0Amysqld start"=0D=0A=0D=0AIf you are talking about one system trying t= o connect to another, make=0D=0Asure you poke a hole in iptables to allow m= ysql fro the host you need to=0D=0Aconnect=2E=0D=0A=0D=0A-----Original Mess= age-----=0D=0AFrom: Mark Sargent [mailto:powderkeg@snow=2Eemail=2Ene=2Ejp] = =0D=0ASent: Wednesday, March 30, 2005 11:33 PM=0D=0ATo: snort-users@lists= =2Esourceforge=2Enet=0D=0ASubject: [Snort-users] mysql not starting at boot= =0D=0A=0D=0AHi All,=0D=0A=0D=0Abelow is my /etc/init=2Ed/mysql content, but= , mysql is not starting at=0D=0Aboot on Fedora3=2E Have I missed something = fundamental=2E? I need mysql to=0D=0Astart at boot for snort to connect to = it=2E Currently, snort gives an=0D=0Aerror stating it can't connect=2E Chee= rs=2E=0D=0A=0D=0AMark Sargent=2E=0D=0A=0D=0A[root@localhost ~]# cat /etc/in= it=2Ed/mysql=0D=0A#!/bin/sh=0D=0A# Copyright Abandoned 1996 TCX DataKonsult= AB & Monty Program KB &=0D=0ADetron HB=0D=0A# This file is public domain a= nd comes with NO WARRANTY of any kind=0D=0A=0D=0A# MySQL daemon start/stop = script=2E=0D=0A=0D=0A# Usually this is put in /etc/init=2Ed (at least on ma= chines SYSV R4 based=0D=0A# systems) and linked to /etc/rc3=2Ed/S99mysql an= d /etc/rc0=2Ed/K01mysql=2E=0D=0A# When this is done the mysql server will b= e started when the machine is=0D=0A# started and shut down when the systems= goes down=2E=0D=0A=0D=0A# Comments to support chkconfig on RedHat Linux=0D= =0A# chkconfig: 2345 90 20=0D=0A# description: A very fast and reliable SQL= database engine=2E=0D=0A=0D=0A# Comments to support LSB init script conven= tions=0D=0A### BEGIN INIT INFO=0D=0A# Provides: mysql=0D=0A# Required-Start= : $local_fs $network $remote_fs=0D=0A# Required-Stop: $local_fs $network $r= emote_fs=0D=0A# Default-Start: 2 3 4 5=0D=0A# Default-Stop: 0 1 6=0D=0A# S= hort-Description: start and stop MySQL=0D=0A# Description: MySQL is a very = fast and reliable SQL database engine=2E=0D=0A### END INIT INFO=0D=0A=0D=0A= # If you install MySQL on some other places than /usr/local/mysql, then=0D= =0Ayou=0D=0A# have to do one of the following things for this script to wor= k:=0D=0A#=0D=0A# - Run this script from within the MySQL installation direc= tory=0D=0A# - Create a /etc/my=2Ecnf file with the following information:= =0D=0A# [mysqld]=0D=0A# basedir=3D<path-to-mysql-installation-directory= >=0D=0A# - Add the above to any other configuration file (for example=0D=0A= ~/=2Emy=2Eini)=0D=0A# and copy my_print_defaults to /usr/bin=0D=0A# - Add= the path to the mysql-installation-directory to the basedir=0D=0Avariable= =0D=0A# below=2E=0D=0A#=0D=0A# If you want to affect other MySQL variable= s, you should make your=0D=0Achanges=0D=0A# in the /etc/my=2Ecnf, ~/=2Emy= =2Ecnf or other MySQL configuration files=2E=0D=0A=0D=0Abasedir=3D=0D=0A=0D= =0A# The following variables are only set for letting mysql=2Eserver find= =0D=0Athings=2E=0D=0A=0D=0A# Set some defaults=0D=0Adatadir=3D/usr/local/my= sql/data=0D=0Apid_file=3D=0D=0Aif test -z "$basedir"=0D=0Athen=0D=0A based= ir=3D/usr/local/mysql=0D=0A bindir=3D=2E/bin=0D=0Aelse=0D=0A bindir=3D"$b= asedir/bin"=0D=0Afi=0D=0A=0D=0APATH=3D/sbin:/usr/sbin:/bin:/usr/bin:$basedi= r/bin=0D=0Aexport PATH=0D=0A=0D=0Amode=3D$1 # start or stop=0D=0A=0D=0Ac= ase `echo "testing\c"`,`echo -n testing` in=0D=0A *c*,-n*) echo_n=3D e= cho_c=3D ;;=0D=0A *c*,*) echo_n=3D-n echo_c=3D ;;=0D=0A *) = echo_n=3D echo_c=3D'\c' ;;=0D=0Aesac=0D=0A=0D=0Aparse_arguments() {= =0D=0A for arg do=0D=0A case "$arg" in=0D=0A --basedir=3D*) based= ir=3D`echo "$arg" | sed -e 's/^[^=3D]*=3D//'` ;;=0D=0A --datadir=3D*) = datadir=3D`echo "$arg" | sed -e 's/^[^=3D]*=3D//'` ;;=0D=0A --pid-fil= e=3D*) pid_file=3D`echo "$arg" | sed -e 's/^[^=3D]*=3D//'` ;;=0D=0A esac= =0D=0A done=0D=0A}=0D=0A=0D=0A# Get arguments from the my=2Ecnf file,=0D= =0A# groups [mysqld] [mysql_server] and [mysql=2Eserver]=0D=0Aif test -x = =2E/bin/my_print_defaults=0D=0Athen=0D=0A print_defaults=3D"=2E/bin/my_pri= nt_defaults"=0D=0Aelif test -x $bindir/my_print_defaults=0D=0Athen=0D=0A p= rint_defaults=3D"$bindir/my_print_defaults"=0D=0Aelif test -x $bindir/mysql= _print_defaults=0D=0Athen=0D=0A print_defaults=3D"$bindir/mysql_print_defa= ults"=0D=0Aelse=0D=0A # Try to find basedir in /etc/my=2Ecnf=0D=0A conf= =3D/etc/my=2Ecnf=0D=0A print_defaults=3D=0D=0A if test -r $conf=0D=0A th= en=0D=0A subpat=3D'^[^=3D]*basedir[^=3D]*=3D\(=2E*\)$'=0D=0A dirs=3D`= sed -e "/$subpat/!d" -e 's//\1/' $conf`=0D=0A for d in $dirs=0D=0A do= =0D=0A d=3D`echo $d | sed -e 's/[ ]//g'`=0D=0A if test -x "$d/bi= n/my_print_defaults"=0D=0A then=0D=0A print_defaults=3D"$d/bin/= my_print_defaults"=0D=0A break=0D=0A fi=0D=0A if test -x "= $d/bin/mysql_print_defaults"=0D=0A then=0D=0A print_defaults=3D= "$d/bin/mysql_print_defaults"=0D=0A break=0D=0A fi=0D=0A don= e=0D=0A fi=0D=0A=0D=0A # Hope it's in the PATH =2E=2E=2E but I doubt it= =0D=0A test -z "$print_defaults" && print_defaults=3D"my_print_defaults"= =0D=0Afi=0D=0A=0D=0A#=0D=0A# Test if someone changed datadir; In this case= we should also read the=0D=0A# default arguments from this directory=0D=0A= #=0D=0A=0D=0Aextra_args=3D""=0D=0Aif test "$datadir" !=3D "/usr/local/mysql= /data"=0D=0Athen=0D=0A extra_args=3D"-e $datadir/my=2Ecnf"=0D=0Afi=0D=0A= =0D=0Aparse_arguments `$print_defaults $extra_args mysqld server mysql_serv= er=0D=0Amysql=2Ese rver`=0D=0A=0D=0A#=0D=0A# Set pid file if not given=0D= =0A#=0D=0Aif test -z "$pid_file"=0D=0Athen=0D=0A pid_file=3D$datadir/`/bin= /hostname`=2Epid=0D=0Aelse=0D=0A case "$pid_file" in=0D=0A /* ) ;;=0D= =0A * ) pid_file=3D"$datadir/$pid_file" ;;=0D=0A esac=0D=0Afi=0D=0A=0D= =0A# Safeguard (relative paths, core dumps=2E=2E)=0D=0Acd $basedir=0D=0A=0D= =0Acase "$mode" in=0D=0A 'start')=0D=0A # Start daemon=0D=0A=0D=0A i= f test -x $bindir/mysqld_safe=0D=0A then=0D=0A # Give extra argumen= ts to mysqld with the my=2Ecnf file=2E This script=0D=0Amay=0D=0A # be= overwritten at next upgrade=2E=0D=0A $bindir/mysqld_safe --datadir=3D= $datadir --pid-file=3D$pid_file=0D=0A>/dev/null 2>& 1 &=0D=0A # Make l= ock for RedHat / SuSE=0D=0A if test -w /var/lock/subsys=0D=0A the= n=0D=0A touch /var/lock/subsys/mysql=0D=0A fi=0D=0A else=0D= =0A echo "Can't execute $bindir/mysqld_safe from dir $basedir"=0D=0A = fi=0D=0A ;;=0D=0A=0D=0A 'stop')=0D=0A # Stop daemon=2E We use a si= gnal here to avoid having to know the=0D=0A # root password=2E=0D=0A = if test -s "$pid_file"=0D=0A then=0D=0A mysqld_pid=3D`cat $pid_file= `=0D=0A echo "Killing mysqld with pid $mysqld_pid"=0D=0A kill $my= sqld_pid=0D=0A # mysqld should remove the pid_file when it exits, so w= ait for it=2E=0D=0A=0D=0A sleep 1=0D=0A while [ -s $pid_file -a "= $flags" !=3D=0D=0Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ]=0D=0A do=0D=0A = [ -z "$flags" ] && echo $echo_n "Wait for mysqld to exit$echo_c"=0D= =0A|| echo $echo_n "=2E$echo_c"=0D=0A flags=3Da$flags=0D=0A = sleep 1=0D=0A done=0D=0A if [ -s $pid_file ]=0D=0A then e= cho " gave up waiting!"=0D=0A elif [ -n "$flags" ]=0D=0A then = echo " done"=0D=0A fi=0D=0A # delete lock for RedHat / SuSE=0D=0A= if test -f /var/lock/subsys/mysql=0D=0A then=0D=0A rm -f = /var/lock/subsys/mysql=0D=0A fi=0D=0A else=0D=0A echo "No mysq= ld pid file found=2E Looked for $pid_file=2E"=0D=0A fi=0D=0A ;;=0D=0A= =0D=0A 'restart')=0D=0A # Stop the service and regardless of whether it= was=0D=0A # running or not, start it again=2E=0D=0A $0 stop=0D=0A = $0 start=0D=0A ;;=0D=0A=0D=0A *)=0D=0A # usage=0D=0A = echo "Usage: $0 start|stop|restart"=0D=0A exit 1=0D=0A ;;=0D=0Aesac= =0D=0A=0D=0A=0D=0A=0D=0A=0D=0A---------------------------------------------= ----------=0D=0AThis SF=2Enet email is sponsored by Demarc:=0D=0AA global p= rovider of Threat Management Solutions=2E=0D=0ADownload our HomeAdmin secur= ity software for free today!=0D=0Ahttp://www=2Edemarc=2Ecom/info/Sentarus/h= amr30=0D=0A_______________________________________ ________=0D=0ASnort-users= mailing list=0D=0ASnort-users@lists=2Esourceforge=2Enet=0D=0AGo to this UR= L to change user options or unsubscribe:=0D=0Ahttps://lists=2Esourceforge= =2Enet/lists/listinfo/snort-users=0D=0ASnort-users list archive:=0D=0Ahttp:= //www=2Egeocrawler=2Ecom/redir-sf=2Ephp3?list=3Dsnort-users=0D=0A=0D=0A=0D= =0A=0D=0A-----------------------------------------=0D=0ADisclaimer: This e= lectronic message, including any attachments, is=0D=0Aconfidential and inte= nded solely for use of the intended recipient(s)=2E This=0D=0Amessage may c= ontain information that is privileged or otherwise protected=0D=0Afrom disc= losure by applicable law=2E Any unauthorized disclosure,=0D=0Adissemination= , use or reproduction is strictly prohibited=2E If you have=0D=0Areceived t= his message in error, please delete it and notify the sender=0D=0Aimmediate= ly=2E=0D=0A ------------------------------------------------------- This SF.net email is sponsored by Demarc: A global provider of Threat Management Solutions. Download our HomeAdmin security software for free today! http://www.demarc.com/info/Sentarus/hamr30 _______________________________________________ Snort-users mailing list Snort-users@lists.sourceforge.net Go to this URL to change user options or unsubscribe: https://lists.sourceforge.net/lists/...fo/snort-users Snort-users list archive: http://www.geocrawler.com/redir-sf.p...st=snort-users |