Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update /etc/init.d/proxysql #2115

Closed
v0112358 opened this issue Jul 2, 2019 · 2 comments
Closed

Update /etc/init.d/proxysql #2115

v0112358 opened this issue Jul 2, 2019 · 2 comments
Assignees

Comments

@v0112358
Copy link

v0112358 commented Jul 2, 2019

Hi,
The script /etc/init.d/proxysql for start/stop ProxySQL should be modified for store /var/run/proxysql/proxysql.sock

start() {
  echo -n "Starting ProxySQL: "
	mkdir $DATADIR 2>/dev/null
  getpid
  if [ "X$pid" = "X" ]
   then
                if [ -d /var/run/proxysql ]; then
                        chmod 1777 /var/run/proxysql
                else
                        mkdir /var/run/proxysql && chmod 1777 /var/run/proxysql
                fi
		if [ -f $OLDDATADIR/proxysql.db ]
		then
			if [ ! -f $DATADIR/proxysql.db ]
			then
				mv -iv $OLDDATADIR/proxysql.db $DATADIR/proxysql.db
                                chown proxysql $DATADIR/proxysql.db
			fi
		fi
	 	su - $USER -s /bin/bash -c "proxysql $OPTS"
		if [ "$?" = "0" ]; then
			echo "DONE!"
			return 0
		else
			echo "FAILED!"
			return 1
		fi
	else
		echo "ProxySQL is already running."
		exit 0
	fi
}

Env:

  • CentOS 7.6.1810
  • Proxysql-2.0.5-1.x86_64
@renecannao
Copy link
Contributor

Assigning to @pondix

@pondix
Copy link
Contributor

pondix commented Oct 8, 2019

The init script is no longer used for the CentOS 7 build - this uses https://github.com/sysown/proxysql/blob/v2.0.7/systemd/system/proxysql.service instead.

Perhaps this still makes sense for CentOS 6 however the logic can still apply to the systemd unit file.

This will be considered for v2.0.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants