NetXMS Support Forum

English Support => General Support => Topic started by: PERIER on January 31, 2023, 01:51:38 PM

Title: a stop job is running for NetXMS core server
Post by: PERIER on January 31, 2023, 01:51:38 PM
Hello all.
My NetXMS 4.3.0 run on Debian 10.
When I stop my server, I get the message "a stop job is running for NetXMS core server" lasting 15 minutes. How to modify this timer?
Title: Re: a stop job is running for NetXMS core server
Post by: Filipp Sudanov on January 31, 2023, 02:31:16 PM
Most probable reason is that database engine gets stopped first. After that netxms waits for reconnection to the DB to write data prior to shutdown.

Title: Re: a stop job is running for NetXMS core server
Post by: PERIER on February 02, 2023, 08:13:56 PM
Thank you very much for your research lead. On the other hand, I don't know which file to modify so that MySQL stops after NetXMS Core server.
Title: Re: a stop job is running for NetXMS core server
Post by: Filipp Sudanov on February 03, 2023, 03:14:10 PM
Since Debian uses systemd, After=   parameter in netxmsd.service should help.
https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Before=

Pls update, if you need an example
Title: Re: a stop job is running for NetXMS core server
Post by: PERIER on February 04, 2023, 11:16:45 AM
Good morning. Fixed issue by changing TimeoutSec from 900 to 60 in netxmsd.service file.
Title: Re: a stop job is running for NetXMS core server
Post by: kronicklez on February 18, 2025, 03:57:32 AM
Hi,

May i know where is path location this  "netxmsd.service" this file?

I'm using ubuntu 22 server.

Thanks and appreciate your feedback
Title: Re: a stop job is running for NetXMS core server
Post by: Alex Kirhenshtein on February 18, 2025, 09:37:42 AM
Quote from: kronicklez on February 18, 2025, 03:57:32 AMHi,

May i know where is path location this  "netxmsd.service" this file?

I'm using ubuntu 22 server.

Thanks and appreciate your feedback


you can add override by running "systemctl edit netxms-server". It's not recommended to modify unit file directly - it might be overwritten by the upgrade.
Title: Re: a stop job is running for NetXMS core server
Post by: kronicklez on February 18, 2025, 11:42:10 AM
Hi Alex,

I try edit the file that u mention and uncomment "# TimeoutSec=900" to "# TimeoutSec=60" but get error below. Do i need to stop first service befor edit the file? Thanks and appreciate your feedback

root@ubuntu22:~# systemctl edit netxms-server
Editing "/etc/systemd/system/netxms-server.service.d/override.conf" canceled: temporary file is empty.
Title: Re: a stop job is running for NetXMS core server
Post by: Filipp Sudanov on February 18, 2025, 05:17:04 PM
I'd guess something wrong with how editor is configured in the system. You can try configuring that with:

update-alternatives --config editor
Title: Re: a stop job is running for NetXMS core server
Post by: Alex Kirhenshtein on February 18, 2025, 05:29:41 PM
There are comments by systemctl:

### Editing /etc/systemd/system/netxms-server.service.d/override.conf
### Anything between here and the comment below will become the new contents of the file

...

### Lines below this comment will be discarded


Your changes were just ignored.

Proper override should be something like this:

### Anything between here and the comment below will become the new contents of the file


[Unit]
After=network.target postgresql.service
TimeoutSec=900
... more overrides

### Lines below this comment will be discarded



But I want to point out that TimeoutSec=900 is default value in the unit file (check /lib/systemd/system/netxms-server.service)
Title: Re: a stop job is running for NetXMS core server
Post by: Alex Kirhenshtein on February 18, 2025, 05:31:29 PM
My guess is that DB is shutting down before the core process and netxmsd waits for connection to write cached information.

Add "After=" section to your unit override.
Title: Re: a stop job is running for NetXMS core server
Post by: kronicklez on February 22, 2025, 10:05:03 AM
Hi,

Quote from: Filipp Sudanov on February 18, 2025, 05:17:04 PMI'd guess something wrong with how editor is configured in the system. You can try configuring that with:

update-alternatives --config editor

Currently i'm using nano. Is it issue using nano?

root@ubuntu22:~# update-alternatives --config editor
There are 4 choices for the alternative editor (providing /usr/bin/editor).

  Selection    Path                Priority  Status
------------------------------------------------------------
* 0            /bin/nano            40        auto mode
  1            /bin/ed            -100      manual mode
  2            /bin/nano            40        manual mode
  3            /usr/bin/vim.basic  30        manual mode
  4            /usr/bin/vim.tiny    15        manual mode
Title: Re: a stop job is running for NetXMS core server
Post by: Filipp Sudanov on March 03, 2025, 04:38:55 PM
Nano is fine. Could be that you tried to add the text to the end of the file that opened for editing? Note that text should be added between

### Anything between here and the comment below will become the new contents of the file

and

### Lines below this comment will be discarded