Fixed init.d and systemd scripts.

This commit is contained in:
Markus Makela 2015-06-16 14:07:34 +03:00
parent 2775145f37
commit 2ea7ff61a2
3 changed files with 11 additions and 8 deletions

View File

@ -4,6 +4,7 @@ After=network.target
[Service]
Type=forking
Restart=on-failure
PIDFile=@MAXSCALE_VARDIR@/run/maxscale/maxscale.pid
ExecStart=@CMAKE_INSTALL_PREFIX@/@MAXSCALE_BINDIR@/maxscale --user=maxscale

View File

@ -44,8 +44,8 @@ _RETVAL_STATUS_NOT_RUNNING=3
# stop/start/status related vars
#################################
NAME=maxscale
DAEMON=@CMAKE_INSTALL_PREFIX@/@MAXSCALE_BINDIR@/maxscale --user=maxscale
DAEMON=@CMAKE_INSTALL_PREFIX@/@MAXSCALE_BINDIR@/maxscale
DAEMON_OPTS= --user=maxscale
# Source function library.
. /lib/lsb/init-functions
@ -57,11 +57,11 @@ RETVAL=0
start() {
log_daemon_msg "Starting MaxScale"
start_daemon -p $MAXSCALE_PIDFILE $DAEMON 2> /dev/null > /dev/null
start_daemon -p "$MAXSCALE_PIDFILE" "$DAEMON" "$DAEMON_OPTS" 2> /dev/null > /dev/null
sleep 2
status_of_proc -p $MAXSCALE_PIDFILE $DAEMON $NAME
status_of_proc -p "$MAXSCALE_PIDFILE" "$DAEMON" $NAME
log_end_msg $?
}
@ -77,13 +77,13 @@ stop() {
reload() {
log_daemon_msg "Reloading MaxScale"
kill -HUP $(cat $MAXSCALE_PIDFILE)
kill -HUP $(cat "$MAXSCALE_PIDFILE")
log_end_msg $?
}
maxscale_wait_stop() {
PIDTMP=$(pidofproc -p $MAXSCALE_PIDFILE @CMAKE_INSTALL_PREFIX@/@MAXSCALE_BINDIR@/maxscale)
PIDTMP=$(pidofproc -p "$MAXSCALE_PIDFILE" "$DAEMON")
kill -TERM "${PIDTMP:-}" 2> /dev/null;
if [ -n "${PIDTMP:-}" ] && kill -0 "${PIDTMP:-}" 2> /dev/null; then
local i=0
@ -115,7 +115,7 @@ case "$1" in
# return 3 on any error
log_daemon_msg "Checking MaxScale"
status_of_proc -p $MAXSCALE_PIDFILE $DAEMON $NAME
status_of_proc -p "$MAXSCALE_PIDFILE" "$DAEMON" $NAME
RETVAL=$?
if [ $RETVAL -ne 0 ]; then

View File

@ -26,7 +26,9 @@
/** Default file locations, configured by CMake */
static const char* default_cnf_fname = "maxscale.cnf";
static const char* default_configdir = "/etc/";
static const char* default_piddir = "@MAXSCALE_VARDIR@/run/maxscale/";
static const char* default_piddir = "@MAXSCALE_VARDIR@/run/maxscale/"; /*< This should be changed to just /run eventually,
* the /var/run folder is an old standard and the newe FSH 3.0
* uses /run for PID files.*/
static const char* default_logdir = "@MAXSCALE_VARDIR@/log/maxscale/";
static const char* default_datadir = "@MAXSCALE_VARDIR@/lib/maxscale/";
static const char* default_libdir = "@CMAKE_INSTALL_PREFIX@/@MAXSCALE_LIBDIR@";