You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like it's trying to execute next step too fast. I think it might be exiting before /var/run/iventoy.pid is created. Maybe there can be a very short sleep added at the end of the iventoy/lib/iventoy binary executable before it returns user to the shell. Or maybe there is a better way that avoids using sleep that can verify /var/run/iventoy.pid is populated before exiting. The reason it would be beneficial to be in the executable is if user makes custom script. For example a systemd unit file that doesn't rely on iventoy.sh
I was able to resolve by adding a 10 ms sleep line to iventoy.sh script, but this might not be the best solution:
start() {
local PID
local RETVAL
PID=$(iventoy_get_running_pid)
if [ $PID -ne 0 ]; then
echo "[ERROR] iventoy is already running. PID=$PID"
exit 1
fi
cd $PROJ_DIR
$PROC_ENV $PROJ_EXEC
RETVAL=$?
/bin/sleep 0.01
After /bin/sleep 0.01 addition to iventoy.sh: iventoy start SUCCESS PID=505
The text was updated successfully, but these errors were encountered:
smileymattj
changed the title
Starting iventoy sometimes returns PID=0
Starting iVentoy sometimes returns PID=0
Jan 4, 2025
Just a minor issue, because iVentoy is just too good and fast. :)
./iventoy.sh start output:
iventoy start SUCCESS PID=0
It seems like it's trying to execute next step too fast. I think it might be exiting before /var/run/iventoy.pid is created. Maybe there can be a very short sleep added at the end of the iventoy/lib/iventoy binary executable before it returns user to the shell. Or maybe there is a better way that avoids using sleep that can verify /var/run/iventoy.pid is populated before exiting. The reason it would be beneficial to be in the executable is if user makes custom script. For example a systemd unit file that doesn't rely on iventoy.sh
I was able to resolve by adding a 10 ms sleep line to iventoy.sh script, but this might not be the best solution:
After /bin/sleep 0.01 addition to iventoy.sh:
iventoy start SUCCESS PID=505
The text was updated successfully, but these errors were encountered: