Releem / mysqlconfigurer

Releem is a simple MySQL tuning tool to improve database performance and reduce servers costs.
https://releem.com
GNU General Public License v3.0
254 stars 26 forks source link

Releem Agent doesn't work under FreeBSD 13.2 #203

Closed drupaladmin closed 10 months ago

drupaladmin commented 10 months ago

Automatic installation after pasting the copied script, it immediately returns "Illegal variable name."

Manual installation:

I tried manual install, but still the installation failed at the step getting releem-agent:


 #curl -L -o /opt/releem/releem-agent https://releem.s3.amazonaws.com/v2/releem-agent-amd64
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   255    0   255    0     0    276      0 --:--:-- --:--:-- --:--:--   276
#cat /opt/releem/releem-agent
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>5G8V6EEDHANE2896</RequestId><HostId>O7ZYIvx9QLFbUlHvERrX+AfREqTnSs/QXNUXjXpzuPCrxT+rkp3b3+dgk90zjRA3hIuhDZN3mUg=</HostId></Error>

When I tried to download https://releem.s3.amazonaws.com/v2/releem-agent-x86_64


# /usr/local/releem/releem-agent -f 
ELF binary type "0" not known. 
-sh: /usr/local/releem/releem-agent: Exec format error
drupaladmin commented 10 months ago

Simply releem-agent install and releem-agent start does not do anything. I have to use releem-agent -f in order connect to releem server, and meanwhile, I have no way to check whether it is running or not. I should have let you know that FreeBSD is quite different from Linux especially the default conf directory for all applications. I have to manually adjust a few lines in order to make things work, for example FreeBSD uses "mkfifo" instead of "mknod p", and the my.cnf is in /usr/local/etc/mysql/. Restarting mysql server should be "service mysql-server restart". Bash is not the default shell etc

drupaladmin commented 10 months ago

After digging around,

"releem-agent install" will create the startup script in /usr/local/etc/rc.d and "releem-agent remove" will delete it:

# cat /usr/local/etc/rc.d/releem-agent

#!/bin/sh
#
# PROVIDE: releem-agent
# REQUIRE: networking syslog
# KEYWORD:

# Add the following lines to /etc/rc.conf to enable the releem-agent:
#
# releem-agent_enable="YES"
#

. /etc/rc.subr

name="releem-agent"
rcvar="releem-agent_enable"
command="/usr/local/bin/releem-agent"
pidfile="/var/run/$name.pid"

start_cmd="/usr/sbin/daemon -p $pidfile -f $command "
load_rc_config $name
run_rc_command "$1"

However, neither "releem-agent start" or "releem-agent stop" read the variable releem-agent_enable="YES" from /etc/rc.conf and does nothing. Currently I use "/usr/sbin/daemon -p /var/run/releem-agent.pid -f /usr/local/bin/releem-agent" to start, and kill the PID to stop, and seems it is working. (yes I put releem-agent as well as mysqlconfigurer.sh into /usr/local/bin because it is FreeBSD's standard, all user installed applications like httpd and mysqld are there)

drupaladmin commented 10 months ago

Added feature request #206