Sunday, 26 May 2013

Run a shell script on Ubuntu startup

Run a shell script on Ubuntu startup

I have a shell scrip that runs on jvm, it works as I write: sh /opt/bin/myshel.sh I added a shell script to /etc/inti.d with this detail:
#! /bin/sh
### BEGIN INIT INFO
# Provides:          WSO2Services.sh
# Required-Start:    $local_fs
# Required-Stop:     $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:       Enable service provided by daemon.
### END INIT INFO

/opt/bin/myshel.sh
I saved this file as "myShell.sh" in "/etc/init.d" and change it's mode to executable. And also I used sudo update-rc.d myShell.sh defaults to update the "rc*.d" files. The problem is that it is not running on the reboot.

No comments:

Post a Comment