Init.D Script Hanging

Init.d script hanging

The answer was that bash was staying open because my init.d script was not redirecting the stderr output. I have now changed it to

$LDIR/$EXEC &> $LDIR/swapi.log & MYPID=$!

And it now functions perfectly.

Thanks for the help everyone!

init script hangs the complete system up

I got this resolved by directing the output of the script to /dev/null and adding an ampersand at the end kinda like

myscript.sh > /dev/null &

this will return control to the shell and keep executing the script in the back without reporting the results to stdout.

Init.d script causing boot hang

What I did to solve this is this, and I warn you, it involves Windows.

I mounted the flash card on my PC and edited "cmdline" and added "ro 1" to the end of the kernel config. This only allows boot to proceed thru runlevel 1 and then drops you into root shell after a prompt.

NOTE: Windows 8 can read the kernel config file unmodified - no special drivers needed.

Unix script on startup in /etc/init.d not working

When bash scripts are run, they are not automatically ran from the same directory that contains them.

You will either need to update your scripts to change directory to that which holds the scripts before starting the jar:

#!/bin/bash
cd /var/lib/myapp/
java -jar myapp-1.0.0RC.jar &

Or, refer to the jar file with a full path:

#!/bin/bash
java -jar /var/lib/myapp/myapp-1.0.0RC.jar &


Related Topics



Leave a reply



Submit