SUSE service status is active (exited) instead of active (running)

Viewed 910

I have one service csiJetty.service, the unit file is automatically generated, but I used command "systemctl edit --full csiJetty.service" to make it as a systemd unit file instead of sysV unit file.

But I always get the service status as "active (exited)", cannot get the status "active (running)"

I put my unit file below, can anybody know why the service status is always active (exited) instead of active (running)?


[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/init.d/csiJetty
Description=LSB: Jetty  WebServer for security components, csi, eat, pnf

[Service]
Type=exec
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
SuccessExitStatus=5 6
ExecStart=/etc/init.d/csiJetty start
ExecStop=/etc/init.d/csiJetty stop

the start_function in the csiJetty file is:

start_function() {
        echo "111111111111111111111   start"
        echo -n "Starting $JETTY_SERV_NAME: "
        cd ${csi_HOME}

        csi_SERVER_PID=`get_csiadminserver_pid`

        if [ ${csi_SERVER_PID} ]
        then
                echo "${JETTY_SERV_NAME} is already running"
                return 1
        fi

        su - ${GEHC_SECURITY_USER} -s /bin/bash -c "cd ${csi_HOME};./jetty/WebAdmin.sh >& ${csi_HOME}/jetty/logs/csiAdminSrvOut &"
        sleep 1
        csi_SERVER_PID=`get_csiadminserver_pid`
        if [ ${csi_SERVER_PID} ]
        then
                echo ${csi_SERVER_PID} > ${PID_FILE}
        fi



        return 0
}
1 Answers

Actually, this is because of no pidfile for the service, after adding the PIDFILE definition in the csiJetty.service file.

PIDFile=/run/csijetty.pid

then the system will monitor the contents of this pid file, and will get the status running, instead of exited.

Related