[MXS-4562] When MaxScalle is installed from tarball and starded without -d option --basedir=. is not parsed properly and full directory needs to be specified Created: 2023-03-22  Updated: 2023-10-20  Resolved: 2023-10-20

Status: Closed
Project: MariaDB MaxScale
Component/s: Core
Affects Version/s: None
Fix Version/s: 6.4.11, 22.08.9, 23.02.5, 23.08.2

Type: Bug Priority: Minor
Reporter: Alexander Keremidarski Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None


 Description   

Steps to reproduce:

[maxscale@localhost ~]$ whoami
maxscale
[maxscale@localhost ~]$ pwd
/home/maxscale
[maxscale@localhost ~]$ tar xf maxscale-23.02.1.rhel.7.tar.gz
[maxscale@localhost ~]$ cd maxscale-23.02.1.rhel.7
[maxscale@localhost maxscale-23.02.1.rhel.7]$ cp etc/maxscale.cnf.template etc/maxscale.cnf
[maxscale@localhost maxscale-23.02.1.rhel.7]$ bin/maxscale --basedir=.
[maxscale@localhost maxscale-23.02.1.rhel.7]$ tail var/log/maxscale/maxscale.log
2023-03-22 08:12:47 notice : Log directory: ./var/log/maxscale
2023-03-22 08:12:47 notice : Data directory: ./var/lib/maxscale
2023-03-22 08:12:47 notice : Module directory: ./lib64/maxscale
2023-03-22 08:12:47 notice : Service cache: ./var/cache/maxscale
2023-03-22 08:12:47 notice : Working directory: ./var/log/maxscale
2023-03-22 08:12:47 error : Cannot create data directory './var/lib/maxscale': No such file or directory
2023-03-22 08:12:47 alert : Cannot create data directory './var/lib/maxscale': No such file or directory
2023-03-22 08:12:47 warning: Failed to remove pidfile ./var/run/maxscale/maxscale.pid: No such file or directory
2023-03-22 08:12:47 MariaDB MaxScale is shut down.
----------------------------------------------------

So either full directory has to be specified or simply use $(pwd)

Both
bin/maxscale --basedir = /home/maxscale/maxscale-23.02.1.rhel.7
and
bin/maxscale --basedir = $(pwd)
sucessfully start it



 Comments   
Comment by markus makela [ 2023-10-17 ]

Tested with 23.08 and it seems to work just fine:

[maxscale@a25cb20d0d5b ~]$ cat /etc/os-release 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
 
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
 
[maxscale@a25cb20d0d5b ~]$ whoami
maxscale
[maxscale@a25cb20d0d5b ~]$ pwd
/home/maxscale
[maxscale@a25cb20d0d5b ~]$ tar -axf maxscale-23.08.1.rhel.7.tar.gz
[maxscale@a25cb20d0d5b ~]$ cd maxscale-23.08.1.rhel.7
[maxscale@a25cb20d0d5b maxscale-23.08.1.rhel.7]$ cp etc/maxscale.cnf.template etc/maxscale.cnf
[maxscale@a25cb20d0d5b maxscale-23.08.1.rhel.7]$ bin/maxscale -d --basedir=.
2023-10-17 05:24:09   notice : MaxScale will be run in the terminal process.
 
Configuration file : /home/maxscale/maxscale-23.08.1.rhel.7/etc/maxscale.cnf
Log directory      : ./var/log/maxscale
Data directory     : ./var/lib/maxscale
Module directory   : ./lib64/maxscale
Service cache      : ./var/cache/maxscale
 
^C
 
Shutting down MaxScale
 

Seems to also work with 23.02:

[maxscale@a25cb20d0d5b maxscale-23.02.4.rhel.7]$ bin/maxscale -d --basedir=.
2023-10-17 05:27:10   notice : MaxScale will be run in the terminal process.
 
Configuration file : /home/maxscale/maxscale-23.02.4.rhel.7/etc/maxscale.cnf
Log directory      : ./var/log/maxscale
Data directory     : ./var/lib/maxscale
Module directory   : ./lib64/maxscale
Service cache      : ./var/cache/maxscale

Tested even the 23.02.1 release and that works:

[maxscale@a25cb20d0d5b ~]$ tar -axf maxscale-23.02.1.rhel.7.tar.gz 
[maxscale@a25cb20d0d5b ~]$ cd maxscale-23.02.1.rhel.7
[maxscale@a25cb20d0d5b maxscale-23.02.1.rhel.7]$ cp etc/maxscale.cnf.template etc/maxscale.cnf
[maxscale@a25cb20d0d5b maxscale-23.02.1.rhel.7]$ bin/maxscale -d --basedir=.
2023-10-17 05:29:50   notice : MaxScale will be run in the terminal process.
 
Configuration file : /home/maxscale/maxscale-23.02.1.rhel.7/etc/maxscale.cnf
Log directory      : ./var/log/maxscale
Data directory     : ./var/lib/maxscale
Module directory   : ./lib64/maxscale
Service cache      : ./var/cache/maxscale
 
^C
 
Shutting down MaxScale

I used the centos:7 image from DockerHub to test it and I prepared it for testing with this:

yum -y install openssl curl gnutls libatomic wget unixODBC
useradd maxscale
su maxscale

Did this happen with a service user or a normal user?

Comment by markus makela [ 2023-10-17 ]

OK, I followed the instructions to the letter and it still used the -d option when the bug report itself said it happened only when it wasn't used. I did manage to reproduce it now.

Comment by markus makela [ 2023-10-20 ]

The global path arguments are now correctly handled if they are relative paths.

Generated at Thu Feb 08 04:29:32 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.