FN11 postinit script not working

Status
Not open for further replies.

Grewterd

Dabbler
Joined
Nov 30, 2015
Messages
31
I have a postinit script that I setup in FN9 to email me the boot log when the system starts. This is not longer working on FN11. Has anyone else had this experience?

I have it setup as a command running a .sh script.

Thanks.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Doesn't that replicate most/all of the security run email you'd get anyway after rebooting?
 

Grewterd

Dabbler
Joined
Nov 30, 2015
Messages
31
dlavigne:
I could not find anything referencing the script in either of the log files.

Ericloewe:
I don't know, I don't get any email after rebooting. Just tested, no email from this script or at all after reboot.

Maybe I'll rewrite in Perl and use sendmail to learn more Perl (I'm a bit off my path because of CISSP bootcamp at work is taking all my reading time now, I had most of the smart report re-written, well the hard parts).
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
I have a postinit script that I setup in FN9 to email me the boot log when the system starts. This is not longer working on FN11. Has anyone else had this experience?

I have it setup as a command running a .sh script.

Thanks.

Are you running it via full path?
 

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
I don't know, I don't get any email after rebooting. Just tested, no email from this script or at all after reboot.
Sounds like your script is executing just fine: it just doesn't send the email message you're expecting. Try modifying the script, adding code to echo the date or other text to a log file, then execute it. You can check the log file to see what's happening. This will help determine whether or not the script is actually running.

If you determine for a fact that it is running, but just not sending an email, then you know to debug the script itself instead of investigating FreeNAS Init/Shutdown Script support.
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
Sounds like your script is executing just fine: it just doesn't send the email message you're expecting. Try modifying the script, adding code to echo the date or other text to a log file, then execute it. You can check the log file to see what's happening. This will help determine whether or not the script is actually running.

If you determine for a fact that it is running, but just not sending an email, then you know to debug the script itself instead of investigating FreeNAS Init/Shutdown Script support.

Which is exactly why my start_fan_controller script starts with

Code:
#!/bin/bash
echo "Starting Hybrid Fan Controller..."
/mnt/tank/server/scripts/hybrid_fan_controller.pl &>> /mnt/tank/server/logs/fan_control.log &


It appears nicely in the log as it pushes the fan controller into the background.
 
Status
Not open for further replies.
Top