14-Mar-2017 21:04:11.465] Log file opened
[14-Mar-2017 21:04:11.884] [INFO ] Platform subagent "/usr/lib/x86_64-linux-gnu/netxms/linux.nsm" successfully loaded
[14-Mar-2017 21:04:12.362] [INFO ] Database driver "pgsql.ddr" loaded and initialized successfully
[14-Mar-2017 21:04:37.534] [ERROR] Unable to establish connection with database (FATAL: the database system is starting up
FATAL: the database system is starting up)
Whenever the computer restarts uncleanly I keep getting the above error and netxms doesn't run. Have to start netxsms manually through sudo netxmsd -d
kiki,
obviously the DB startup lasts a little longer than usual when recovering from the unclean shutdown.
I would try to sleep() for a minute or two in the netxmsd startup file (maybe in /etc/init.d/netxmsd).
Kind regards,
Thomas
Yes. That must be the problem. This is what I have in the start up script.
# Description:
### END INIT INFO
#######################################
#
# NetXMS server startup script
# For Ubuntu Linux
#
# Written by Dmitry Chernyshov
# [email protected]
#
#######################################
NETXMS_BINDIR="~BINDIR~"
NETXMS_LIBDIR="~LIBDIR~"
NAME=netxmsd
DAEMON=$NETXMS_BINDIR/netxmsd
PIDFILE=/var/run/netxmsd.pid
test -x $DAEMON || exit 5
. /lib/lsb/init-functions
case "$1" in
start)
# start daemon
log_daemon_msg "Starting NetXMS server" "netxmsd"
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- -p $PIDFILE -d
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping NetXMS server" "netxmsd"
start-stop-daemon --stop --quiet --pidfile $PIDFILE
log_end_msg $?
;;
restart)
$0 stop && sleep 2 && $0 start
;;
esac
What line should I modify to make the netxms launch after 5 minutes?
insert a line below the "# start daemon" comment:
sleep 300 # wait 5 minutes
You might want to read a little about shell programming ....
Kind regards,
Thomas