|
currently works in following way:
[root@localhost ~]# service maxscale start
Starting maxscale (via systemctl): [ OK ]
[root@localhost ~]# service maxscale status
Checking MaxScale status: maxscale.service - MariaDB MaxScale Database Proxy
Loaded: loaded (/usr/lib/systemd/system/maxscale.service; disabled)
Active: active (running) since Mon 2015-06-15 20:27:42 EEST; 3s ago
Process: 9333 ExecStart=/usr/bin/maxscale --user=maxscale (code=exited, status=0/SUCCESS)
Main PID: 9334 (maxscale)
CGroup: /system.slice/maxscale.service
└─9334 /usr/bin/maxscale --user=maxscale
Jun 15 20:27:42 localhost.localdomain systemd[1]: PID file /var/run/maxscale/maxscale.pid not readable (yet?) after start.
Jun 15 20:27:42 localhost.localdomain maxscale[9333]: Error log : /var/log/maxscale/error1.log
Jun 15 20:27:42 localhost.localdomain maxscale[9333]: Message log : /var/log/maxscale/messages1.log
Jun 15 20:27:42 localhost.localdomain maxscale[9333]: Trace log : /var/log/maxscale/trace1.log
Jun 15 20:27:42 localhost.localdomain maxscale[9333]: Debug log : /var/log/maxscale/debug1.log
Jun 15 20:27:42 localhost.localdomain maxscale[9333]: Opened /var/log/maxscale/error1.log
Jun 15 20:27:42 localhost.localdomain maxscale[9333]: Opened /var/log/maxscale/messages1.log
Jun 15 20:27:42 localhost.localdomain maxscale[9333]: Opened /var/log/maxscale/trace1.log
Jun 15 20:27:42 localhost.localdomain maxscale[9333]: Opened /var/log/maxscale/debug1.log
Jun 15 20:27:42 localhost.localdomain systemd[1]: Started M[ OK ]axScale Database Proxy.
[root@localhost ~]# service maxscale stop
Stopping maxscale (via systemctl): [ OK ]
[root@localhost ~]# service maxscale status
Checking MaxScale status: maxscale.service - MariaDB MaxScale Database Proxy
Loaded: loaded (/usr/lib/systemd/system/maxscale.service; disabled)
Active: inactive (dead)
Jun 15 20:27:42 localhost.localdomain maxscale[9333]: Opened /var/log/maxscale/debug1.log
Jun 15 20:27:42 localhost.localdomain systemd[1]: Started MariaDB MaxScale Database Proxy.
Jun 15 20:28:33 localhost.localdomain systemd[1]: Stopping MariaDB MaxScale Database Proxy...
Jun 15 20:28:33 localhost.localdomain maxscale[9333]: Closed /var/log/maxscale/error1.log
Jun 15 20:28:33 localhost.localdomain maxscale[9333]: Closed /var/log/maxscale/messages1.log
Jun 15 20:28:33 localhost.localdomain maxscale[9333]: Closed /var/log/maxscale/trace1.log
Jun 15 20:28:33 localhost.localdomain maxscale[9333]: Closed /var/log/maxscale/debug1.log
Jun 15 20:28:33 localhost.localdomain maxscale[9333]: Running MaxScale as: maxscale 998:997
Jun 15 20:28:33 localhost.localdomain maxscale[9333]: Syslog logging is disabled.
Jun 15 20:28:33 localhost.localdomain systemd[1]: Stopped M[FAILED]axScale Database Proxy.
[root@localhost ~]#
|
|
if config file is missing Maxscale fails to start:
[root@localhost ~]# rm /etc/maxscale.cnf
rm: remove regular file ‘/etc/maxscale.cnf’? y
[root@localhost ~]# service maxscale start
Starting maxscale (via systemctl): Job for maxscale.service failed. See 'systemctl status maxscale.service' and 'journalctl -xn' for details.
[FAILED]
[root@localhost ~]# service maxscale status
Checking MaxScale status: maxscale.service - MariaDB MaxScale Database Proxy
Loaded: loaded (/usr/lib/systemd/system/maxscale.service; disabled)
Active: failed (Result: resources) since Mon 2015-06-15 20:31:47 EEST; 1min 35s ago
Process: 9450 ExecStart=/usr/bin/maxscale --user=maxscale (code=exited, status=0/SUCCESS)
Jun 15 20:31:47 localhost.localdomain maxscale[9450]: MariaDB Corporation MaxScale 1.1.1 Mon Jun 15 20:31:47 2015
Jun 15 20:31:47 localhost.localdomain maxscale[9450]: ------------------------------------------------------
Jun 15 20:31:47 localhost.localdomain maxscale[9450]: Info : MaxScale will be run in a daemon process.
Jun 15 20:31:47 localhost.localdomain maxscale[9450]: See the log from the following log files :
Jun 15 20:31:47 localhost.localdomain maxscale[9450]: Running MaxScale as: maxscale 998:997
Jun 15 20:31:47 localhost.localdomain systemd[1]: PID file /var/run/maxscale/maxscale.pid not readable (yet?) after start.
Jun 15 20:31:47 localhost.localdomain maxscale[9450]: Running MaxScale as: maxscale 998:997
Jun 15 20:31:47 localhost.localdomain systemd[1]: maxscale.service never wrote its PID file. Failing.
Jun 15 20:31:47 localhost.localdomain systemd[1]: Failed to start MariaDB MaxScale Database Proxy.
Jun 15 20:31:47 localhost.localdomain systemd[1]: Unit maxs[FAILED]vice entered failed state.
|
|
GeoffMontee
please try with latest code from http://jenkins.engskysql.com/repo/develop-test/centos7.0_x86_64/
(change baseurl line in the /etc/yum.repos.d/maxscale.repo file to baseurl=http://jenkins.engskysql.com/repo/develop-test/centos7.0_x86_64/ and then execute 'yum clean all; yum reinstall maxscale')
after it
service maxscale start
service maxscale stop
service maxscale status
should work
|
|
Hi tturenko,
I followed your directions, and now the output of that version of the init script seems to be working much better. Thanks!
Unfortunately, maxscale won't seem to start with it.
[gmontee@localhost ~]$ sudo service maxscale start
|
Starting maxscale (via systemctl): Job for maxscale.service failed. See 'systemctl status maxscale.service' and 'journalctl -xn' for details.
|
[FAILED]
|
[gmontee@localhost ~]$ systemctl status maxscale.service
|
maxscale.service - MariaDB MaxScale Database Proxy
|
Loaded: loaded (/usr/lib/systemd/system/maxscale.service; disabled)
|
Active: failed (Result: resources) since Tue 2015-06-16 12:44:05 EDT; 12s ago
|
Process: 5440 ExecStart=/usr/bin/maxscale --user=maxscale (code=exited, status=0/SUCCESS)
|
/var/log/messages shows:
Jun 16 12:44:05 localhost systemd: Starting MariaDB MaxScale Database Proxy...
|
Jun 16 12:44:05 localhost maxscale: MariaDB Corporation MaxScale 1.1.1 Tue Jun 16 12:44:05 2015
|
Jun 16 12:44:05 localhost maxscale: ------------------------------------------------------
|
Jun 16 12:44:05 localhost maxscale: Info : MaxScale will be run in a daemon process.
|
Jun 16 12:44:05 localhost maxscale: See the log from the following log files :
|
Jun 16 12:44:05 localhost maxscale: Running MaxScale as: maxscale 990:988
|
Jun 16 12:44:05 localhost systemd: PID file /var/run/maxscale/maxscale.pid not readable (yet?) after start.
|
Jun 16 12:44:05 localhost maxscale: Running MaxScale as: maxscale 990:988
|
Jun 16 12:44:05 localhost systemd: maxscale.service never wrote its PID file. Failing.
|
Jun 16 12:44:05 localhost systemd: Failed to start MariaDB MaxScale Database Proxy.
|
Jun 16 12:44:05 localhost systemd: Unit maxscale.service entered failed state.
|
/var/log/maxscale is empty.
[gmontee@localhost ~]$ ls -l /var/log/maxscale/
|
total 0
|
It looks like the RPM didn't create the /var/run/maxscale directory where it places the PID file. Maybe that's related?
[gmontee@localhost ~]$ ls -l /var/run/maxscale/
|
ls: cannot access /var/run/maxscale/: No such file or directory
|
[gmontee@localhost ~]$ sudo mkdir /var/run/maxscale/
|
[gmontee@localhost ~]$ sudo chown maxscale:maxscale /var/run/maxscale
|
But even after manually creating the directory, it still won't start. If I try to skip the init script and run it manually, that also fails:
[gmontee@localhost ~]$ sudo /usr/bin/maxscale --user=maxscale
|
|
|
MariaDB Corporation MaxScale 1.1.1 Tue Jun 16 12:53:16 2015
|
------------------------------------------------------
|
Running MaxScale as: maxscale 990:988
|
Info : MaxScale will be run in a daemon process.
|
See the log from the following log files :
|
So maybe this particular problem is unrelated to the init script now?
|
|
It started up for me after I copied the template configuration file to /etc/.
If it fails to start because the configuration file isn't present, it should probably say so, right?
[root@localhost ~]# cp /usr/share/maxscale/maxscale_template.cnf /etc/maxscale.cnf
|
[root@localhost ~]# service maxscale start
|
Starting maxscale (via systemctl): [ OK ]
|
[root@localhost ~]# service maxscale status
|
Checking MaxScale status: maxscale.service - MariaDB MaxScale Database Proxy
|
Loaded: loaded (/usr/lib/systemd/system/maxscale.service; disabled)
|
Active: active (running) since Tue 2015-06-16 19:06:00 EDT; 5s ago
|
Process: 5778 ExecStart=/usr/bin/maxscale --user=maxscale (code=exited, status=0/SUCCESS)
|
Main PID: 5779 (maxscale)
|
CGroup: /system.slice/maxscale.service
|
ââ5779 /usr/bin/maxscale --user=maxscale
|
|
Jun 16 19:06:00 localhost.localdomain systemd[1]: PID file /var/run/maxscale/maxscale.pid not readable (yet?) after start.
|
Jun 16 19:06:00 localhost.localdomain maxscale[5778]: Error log : /var/log/maxscale/error1.log
|
Jun 16 19:06:00 localhost.localdomain maxscale[5778]: Message log : /var/log/maxscale/messages1.log
|
Jun 16 19:06:00 localhost.localdomain maxscale[5778]: Trace log : /var/log/maxscale/trace1.log
|
Jun 16 19:06:00 localhost.localdomain maxscale[5778]: Debug log : /var/log/maxscale/debug1.log
|
Jun 16 19:06:00 localhost.localdomain maxscale[5778]: Opened /var/log/maxscale/error1.log
|
Jun 16 19:06:00 localhost.localdomain maxscale[5778]: Opened /var/log/maxscale/messages1.log
|
Jun 16 19:06:00 localhost.localdomain maxscale[5778]: Opened /var/log/maxscale/trace1.log
|
Jun 16 19:06:00 localhost.localdomain maxscale[5778]: Opened /var/log/maxscale/debug1.log
|
Jun 16 19:06:00 localhost.localdomain systemd[1]: Started M[ OK ]axScale Database Proxy.
|
|
|
Thanks GeoffMontee, we will make this enhancement in next release. For now I am making this minor.
|
|
Thanks, dshjoshi! It looks like "start" and "status" return correct information with tturenko's build, so I agree that the most serious issue has been fixed. Would you prefer if that enhancement were moved to a new JIRA issue?
|
|
GeoffMontee Could you verify that this is solved with the introduction of systemd service files?
|
|
markus makela,
I just installed MaxScale 1.2.0 and the systemd service is working great. Thanks!
After upgrading from MaxScale 1.1.1 and trying to use the service description for the first time, I did receive a message to run {{systemctl daemon-reload}. Should that step be added to the upgrade documentation? Or maybe the RPM's postinst script should handle that?
[gmontee@localhost ~]$ sudo systemctl start maxscale.service
|
Warning: Unit file of maxscale.service changed on disk, 'systemctl daemon-reload' recommended.
|
|
|
Added systemctl daemon-reoad to the post-install script.
|
|
Hi Markus,
if you create a directory such as /var/run/maxscale/ in the package, this won't work since /run is on a tmpfs in CentOS 7, so you have to create those directories in the systemd file.
We had it working on CentOS 7 by adding the following commands:
ExecStartPre=-/usr/bin/mkdir /run/maxscale
ExecStartPre=/usr/bin/chown maxscale:maxscale /run/maxscale
|
|
Please see previous comments from Guillaume.
|
|
Pull request in https://github.com/mariadb-corporation/MaxScale/pull/88
|
|
The issue is similar in Ubuntu and Debian, because /var/run is also on a tmpfs. for systemv init, directory creation must also be added in the init.d script.
|
|
Pull request in https://github.com/mariadb-corporation/MaxScale/pull/89
|
|
markus makela Have we merged this pull request ?
Dipti
|
|
markus makela Do we have update on this pull request
|
|
Fixed by re-creating the folder on script startup.
|