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
Julia: System Image File "Sys.Ji" Not Found
How to Increase The Size of Ephemeral Storage in a Kubernetes Worker Node
Monitoring (Sniffing) /Dev/Ttyusb0 Created by Ftdi Usb Serial Converter
Ssh-Add from Bash Script and Automate Passphrase Entry
Converting Date with Timezone in Unix Timestamp Shell/Bash
How to Disable Floating Point Unit (Fpu)
Run Linux Command in Background and Keep Runing After Closing Ssh
Getting Root Privileges in Ansible
How to Launch a Background Process Through a Wrapper That'Ll Undo The Sigint Ignore
Version Control for My Web Server
Time Taken by 'Less' Command to Show Output
Bash Script to Mkdir on Each Line of a File That Has Been Split by a Delimiter