1

I am working on a Raspberry Pi project; it includes NUT server configuration and making the OS Image read-only.

I have completed the required steps and configured the NUT server.

I uninstalled the cron and required a alternate method to launch my application script on start up. after looking up some online resources, I have decided to use the rc.local file to launch my application script.

But when the system reboots I am seeing the my application script is continuously displaying the message generate by the NUT server command. Which used to be not visible when I was using the cron.

The following is the command that is generating a message every time the script is called. (My application script runs in a infinite loop).

Command:

upsc myups

Response:

Init SSL without certificate database

I have tried dumping the script output to /dev/null but it did not help.

/etc/rc.local

printf "Launching Script \n"

/home/pi/dataLog.sh & > /dev/null  2>&1

I am not sure if this is the right approach.

Anthony Geoghegan
  • 12,605
  • 7
  • 59
  • 62
Kunal Sonone
  • 65
  • 1
  • 9

1 Answers1

1

Thank you, Christopher for the answer. The right method is

/home/pi/script > /dev/null 2>&1 & 
Anthony Geoghegan
  • 12,605
  • 7
  • 59
  • 62
Kunal Sonone
  • 65
  • 1
  • 9
  • 1
    @ Anthony Geoghegan There is 2 day wait time before I can accept my answer – Kunal Sonone Sep 17 '19 at 14:35
  • 1
    OK, that makes sense. I don't ask many questions here but when I do I'm usually happy to wait a while for the best answer so I wasn't aware of this delay. BTW, I'd suggest that whenever you're writing shell scripts, it's always worth checking them with [shellcheck](https://www.shellcheck.net/). – Anthony Geoghegan Sep 18 '19 at 09:13
  • @AnthonyGeoghegan thank you for the information, I was not aware about this tool. – Kunal Sonone Sep 18 '19 at 12:16