TrueNAS-13.0-U6.2
I have a shutdown script used for over 10 years with no issues and have read that using midclt is better so I changed line 108 on the script. Script works, but now Cron will not start the script, even after reboot. Cron job is set to run the script every 11 minutes.
With midclt changes:
1-Cron will not start script.
2-Manual start of the script via Cron with ‘Run Now’ runs and TN shuts down.
3-Manual start of the script via console runs and TN shuts down.
If I replace the line 108 back to original, Cron will run the script and PC will shut down as normal.
If It runs manually why can’t Cron start it after the change to midclt?
I’ve included the full script. It’s line 100 since I removed my settings. shutdown.py.txt (5.9 KB)
First, on CORE if you want to call the middleware shutdown, you can just use the service command to call the rc.d script which calls the middleware service ix_shutdown stop.
Second, I have absolutely no idea if this would call the system–besides the middleware–to actually shutdown as well (probably doesn’t) but, I see no point in calling anything other than shutdown -p now because the whole point for having the rc.d script is so the system knows how to shut down the middleware–or more accurately: “tell it to cleanup and close shop because the system is shutting down”.
I would have to dig through the code for this “middleware shutdown” thing if I actually wanted to issue a shutdown. I wouldn’t blindly follow a directive like that without researching it a bit more.
Sorry John but I have absolutely and unequivocally no idea what you are talking about, yet alone why Cron won’t start the script after I replace the shutdown -p now with midclt unless I manually start it.