I’m new to Scale, In Core I used this script to unlock a pool on an IP being available. In new scale migration this sh script failed so DuckAI converted it to run in Linux/Scale but Post init fails to launch as well. Since I have another Post init script in perl that works I converted the sh script to perl but again Post Init fails to launch.
Using the shell both work without error. This is a Post init issue? Permission are 770 so Owner and group have Read Write and Execute as I can run from the shell.
I have also tried both Post Init Command and Script, neither launch.
Though I don’t think necessary being a Post Init issue I posted the script below anyway, just in case.
The scripts job: It loops until IP 192.168.xxx.xxx is detected on the network then launches xxxx.pl which unlocks the pool, finishing by cancelling this script on detection of /Statement_Check becomes available in the unlocked pool.
The script works so why can’t I launch it.
#!/bin/bash
#Post Init will not launch but shell will.
# Define the IP address to check
IP_addr="192.168.xx.xxx"
if [ -e /mnt/xxxxxxx/xxxxxxStatement_Check ]; then
echo "System Already Mounted..Script Cancelled." >&2
exit 1 # Exit the script with an error code
else
count1=0
count2=0
# Use -c to specify the number of packets to send
Ping=$(ping -c 1 -i 20 "$IP_addr" 2>/dev/null | grep -oP '\d+(?=% packet loss)')
# Check if the ping command was successful
if [ $? -ne 0 ]; then
echo "Ping command failed. Please check the network connection or the IP address." >&2
exit 1 # Exit the script with an error code
fi
if [ "$Ping" = "0" ]; then # Check if packet loss is 0%
count1=$((count1 + 1))
echo "$IP_addr UP" # Output the IP address status
/mnt/xxxxxxx/xxxxxxxxxxxx/xxxxxxxxxx/xxxxxx.pl
else
count2=$((count2 + 1))
echo "$IP_addr DOWN" # Output the IP address status
/mnt/xxxxxxx/xxxxxxxxxx/xxxxxxxxxxx/System_IP_105_Available.sh
fi
fi
echo "$count1 IP addresses UP and $count2 IP addresses DOWN"
In these two examples sh and pl scripts to me it seems a permissions issue as it can’t find the scripts? or something else.
[2025/10/17 16:38:14] (DEBUG) InitShutdownScriptService.execute_task():158 - Failed to execute ‘/bin/sh /mntxxxxxxxxxxxxxxxxxxxxxxxxxxxx_Available.sh’ with error ‘/bin/sh: 0: cannot open /mnt/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxAvailable.sh: No such file\n’
[2025/10/17 21:48:14] (DEBUG) InitShutdownScriptService.execute_task():158 - Failed to execute ‘/mnt/xxxxxxxxxxxxxxxxxxxxxxxxAvailable.pl’ with error ‘sh: 1: /mnt/xAvailable.pl: not found\n’
Maybe the script is executed before the pool is fully mounted? I don’t know if post-init scripts are guaranteed to execute post-mount. Could be a timing issue. Simplest solutions to that would be to change the command to:
Dam, Scale is slower than Core to boot on same PC with no hardware changes.
It goes to show you can be trapped in a bubble until somebody just nudges you and you then see what’s in front of you all along. That’s a few hours I’ll never get back.