diff --git a/etc/postinst.in b/etc/postinst.in index 34133b961..f4c8673a7 100755 --- a/etc/postinst.in +++ b/etc/postinst.in @@ -54,6 +54,8 @@ then mkdir -p /usr/lib/systemd/system/maxscale.service.d systemctl daemon-reload fi + + systemctl enable maxscale.service else if [ -d "/etc/init/" ] && [ -f "@CMAKE_INSTALL_PREFIX@/@MAXSCALE_SHAREDIR@/upstart/maxscale.conf" ] then diff --git a/etc/postrm.in b/etc/postrm.in index 1e31d788f..5e477037e 100755 --- a/etc/postrm.in +++ b/etc/postrm.in @@ -17,9 +17,11 @@ then if [ -f /usr/lib/systemd/system/maxscale.service ] then + systemd stop maxscale.service rm /usr/lib/systemd/system/maxscale.service elif [ -f /lib/systemd/system/maxscale.service ] then + systemd stop maxscale.service rm /lib/systemd/system/maxscale.service fi diff --git a/maxscale-system-test/test_ctrl_c/start_killer.sh b/maxscale-system-test/test_ctrl_c/start_killer.sh index 697db3571..b5998a86b 100755 --- a/maxscale-system-test/test_ctrl_c/start_killer.sh +++ b/maxscale-system-test/test_ctrl_c/start_killer.sh @@ -1,3 +1,3 @@ sleep 5 -sudo /usr/bin/killall maxscale -s INT +sudo /usr/bin/killall maxscale -s INT || sudo pkill -INT maxscale diff --git a/maxscale-system-test/test_ctrl_c/test_ctrl_c.sh b/maxscale-system-test/test_ctrl_c/test_ctrl_c.sh index 0eb2d64d8..be17ee7f7 100755 --- a/maxscale-system-test/test_ctrl_c/test_ctrl_c.sh +++ b/maxscale-system-test/test_ctrl_c/test_ctrl_c.sh @@ -10,7 +10,7 @@ fi T="$(date +%s)" -sudo maxscale -d -U root +sudo maxscale -d -U maxscale if [ $? -ne 0 ] ; then exit 1 fi diff --git a/server/core/session.cc b/server/core/session.cc index d7db7af7f..3c0929d0e 100644 --- a/server/core/session.cc +++ b/server/core/session.cc @@ -232,23 +232,6 @@ void session_close(MXS_SESSION* session) } } -class ServiceDestroyTask : public Worker::DisposableTask -{ -public: - ServiceDestroyTask(Service* service) - : m_service(service) - { - } - - void execute(Worker& worker) override - { - service_free(m_service); - } - -private: - Service* m_service; -}; - /** * Deallocate the specified session * @@ -1151,7 +1134,6 @@ Session::Session(const SListener& listener) mxb::atomic::add(&service->stats.n_current, 1, mxb::atomic::RELAXED); mxb_assert(service->stats.n_current >= 0); - mxb::atomic::add(&service->client_count, 1, mxb::atomic::RELAXED); } Session::~Session() @@ -1169,17 +1151,6 @@ Session::~Session() mxb::atomic::add(&service->stats.n_current, -1, mxb::atomic::RELAXED); mxb_assert(service->stats.n_current >= 0); - - bool should_destroy = !mxb::atomic::load(&service->active); - - if (mxb::atomic::add(&service->client_count, -1) == 1 && should_destroy) - { - // Destroy the service in the main routing worker thread - mxs::RoutingWorker* main_worker = mxs::RoutingWorker::get(mxs::RoutingWorker::MAIN); - main_worker->execute( - std::unique_ptr(new ServiceDestroyTask(static_cast(service))), - Worker::EXECUTE_AUTO); - } } void Session::set_client_dcb(DCB* dcb) diff --git a/server/modules/protocol/MySQL/mariadbbackend/mysql_backend.cc b/server/modules/protocol/MySQL/mariadbbackend/mysql_backend.cc index c8c4bb81a..7906d43b0 100644 --- a/server/modules/protocol/MySQL/mariadbbackend/mysql_backend.cc +++ b/server/modules/protocol/MySQL/mariadbbackend/mysql_backend.cc @@ -1425,7 +1425,7 @@ static int gw_backend_close(DCB* dcb) || proto->protocol_auth_state == MXS_AUTH_STATE_CONNECTED) { MYSQL_session client; - gw_get_shared_session_auth_info(dcb->session->client_dcb, &client); + gw_get_shared_session_auth_info(dcb, &client); memset(proto->scramble, 0, sizeof(proto->scramble)); dcb_write(dcb, gw_generate_auth_response(&client, proto, false, false, 0)); }