Question

I need to check weather the required service is up on XAMPP on shell terminal for automation purpose.

I tried service cmd but service is not listed there.

Was it helpful?

Solution

In xampp start/stop script, two parts are related with startappache and startmysql, both start with the status check.

    "startapache")
            if $XAMPP_ROOT/share/xampp/testrun $XAMPP_ROOT/logs/httpd.pid httpd
            then
                    $de && echo "XAMPP: XAMPP-Apache läuft bereits."
                    $de || echo "XAMPP: XAMPP-Apache is already running."
            fi

    "startmysql")
            if $XAMPP_ROOT/share/xampp/testrun $XAMPP_ROOT/var/mysql/`/bin/hostname`.pid mysqld
            then
                    $de && echo "XAMPP: XAMPP-MySQL läuft bereits."
                    $de || echo "XAMPP: XAMPP-MySQL is already running."
            fi

So the command $XAMPP_ROOT/share/xampp/testrun is used to check weather the required service is up on XAMPP.

Another way, check by process name directly.

ps -ef |grep xampp

If you need check xampp apache services:

ps -ef |grep xampp|grep httpd

If you need check xampp mysql services:

ps -ef |grep xampp |grep mysql
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top