OPNsense Forum

Archive => 17.7 Legacy Series => Topic started by: guest15389 on August 31, 2017, 03:03:02 pm

Title: Hopefully an easy question
Post by: guest15389 on August 31, 2017, 03:03:02 pm
I'm trying to start netdata on startup and I followed way to drop a shell script in to autostart and I must be missing something super silly:


Code: [Select]
-rwxr-xr-x   1 root  wheel    88 Aug  4 10:29 99-netdata.start
root@phoenix:/usr/local/etc/rc.syshook.d # cat 99-netdata.start
#!/bin/sh

echo -n "Starting Netdata: "
/usr/local/sbin/netdata -P /var/run/netdata.pid
root@phoenix:/usr/local/etc/rc.syshook.d # /usr/local/sbin/netdata -P /var/run/netdata.pid
root@phoenix:/usr/local/etc/rc.syshook.d # ps aux | grep netdata
root    9582   1.9  1.6  256880 129736  -  SN   08:58   0:00.12 /usr/local/sbin/netdata -P /var/run/netdata.pid
root    9974   0.5  0.0   14784   3056  -  SN   08:58   0:00.06 /usr/local/libexec/netdata/plugins.d/apps.plugin 1
root   18798   0.0  0.0 1080488   2840  0  S+   08:58   0:00.00 grep netdata

If I run the shell script by hand, it starts up no problem.
Title: Re: Hopefully an easy question
Post by: franco on August 31, 2017, 03:08:36 pm
Can you see the boot message (error)?

You could add "read KEY" to the script as the last line to let it pause until you press a key, or a "sleep 30".


Cheers,
Franco
Title: Re: Hopefully an easy question
Post by: guest15389 on August 31, 2017, 04:17:10 pm
I wonder if it is I'm not passing a start to it. I removed it and moved it to the other method and that worked fine:

Code: [Select]
root@phoenix:/etc/rc.conf.d # cat netdata
netdata_enable=YES
netdata_opnsense_bootup_run="/usr/local/sbin/netdata -P /var/run/netdata.pid"
Title: Re: Hopefully an easy question
Post by: franco on August 31, 2017, 04:21:05 pm
netdata_enable="YES"

...is all you need normally, can also push this to /etc/rc.conf directly, we don't touch it.


Cheers,
Franco