3
responses

Hi,

I have installed community version on Linux 18.04 AMD 64 and I encountered problem with stopping NX Log service. When I hit "sudo service nxlog stop", the command process but the service still persist. When I hit "sudo service nxlog status", the result is:
● nxlog.service - LSB: logging daemon
Loaded: loaded (/etc/init.d/nxlog; generated)
Active: failed (Result: exit-code) since Sun 2019-01-27 16:50:34 CET; 33s ago
Docs: man:systemd-sysv-generator(8)
Process: 8744 ExecStart=/etc/init.d/nxlog start (code=exited, status=1/FAILURE)
Tasks: 7 (limit: 2321)
CGroup: /system.slice/nxlog.service
└─30012 /usr/bin/nxlog

led 27 16:50:34 logstash-VirtualBox systemd[1]: Starting LSB: logging daemon...
led 27 16:50:34 logstash-VirtualBox nxlog[8744]: * Starting nxlog daemon...
led 27 16:50:34 logstash-VirtualBox nxlog[8744]: 2019-01-27 16:50:34 ERROR Another instance is already running (pid 30012);Resource temporarily unavailable
led 27 16:50:34 logstash-VirtualBox nxlog[8744]: Failed to start nxlog!
led 27 16:50:34 logstash-VirtualBox nxlog[8744]: ...fail!
led 27 16:50:34 logstash-VirtualBox systemd[1]: nxlog.service: Control process exited, code=exited status=1
led 27 16:50:34 logstash-VirtualBox systemd[1]: nxlog.service: Failed with result 'exit-code'.
led 27 16:50:34 logstash-VirtualBox systemd[1]: Failed to start LSB: logging daemon.

Could you please advice me how I can stop it and run it again?
Is the service working right when I do "sudo service nxlog status"?

Thank you for all your advice.

Kind regards,

Marek

AskedJanuary 27, 2019 - 5:27pm

Answer (1)

led 27 16:50:34 logstash-VirtualBox nxlog[8744]: 2019-01-27 16:50:34 ERROR Another instance is already running (pid 30012);Resource temporarily unavailable

This leads me to believe that it was already running or hung.
Verify with the ps command with something like ps ax| grep nxlog. If it is indeed not running, just remove the pid file at /run/nxlog/nxlog.pid and start it again. Possibly an unclean shutdown.

Comments (2)

  • Mareknejedly's picture

    Hello,

    this is the result of the command
    ps ax| grep nxlog
    9163 pts/1 S+ 0:00 grep --color=auto nxlog
    30012 ? Ssl 21:52 /usr/bin/nxlog

    It seems that the nxlog really is working.

    What happens if I remove the .pid file? Can I do it if it is running?

    Thank you very much for your input.

  • Zhengshi's picture
    (NXLog)

    You might want to check the contents of /run/nxlog/nxlog.pid to verify that the pid matches with ps is providing. It is possible that it got out of sync somehow.
    The error that there was already a service running makes sense.

    If service nxlog stop does not actually stop and clear /run/nxlog/nxlog.pid then you should kill the process and remove the pid. Then start nxlog again from the service command.
    nxlog -s can be used to stop a running instance.