LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Symlink will not execute Shell Script in /etc/rc2.d (http://www.linuxquestions.org/questions/linux-software-2/symlink-will-not-execute-shell-script-in-etc-rc2-d-660109/)

netwrkengeer 08-03-2008 09:49 AM

Symlink will not execute Shell Script in /etc/rc2.d
 
I need to start an application on boot for us on dumb terminals.

I have created the following script called "S99unform.sh" to start an application called unform. the script looks like this.

###########################
#!/bin/bash

/usr/bin/uf71d start

###########################

I saved this script in /usr/unform directory.

I can execute the application from the command line with the following command.
./usr/bin/uf71d start

I can execute my shell script with the following ./usr/unform/S99unform.sh

Then I created a symlink to S99unform.sh in /etc/rc2.d
(i.e. ln -s /usr/unform/S99unform.sh S99unform)

I thought this would cause the application to startup on boot but it did not, what am I doing wrong?

Thanks for your help.

unSpawn 08-03-2008 10:50 AM

If you want to use SysV initscripts your script should conform to specs and you should use the appropriate tools for that. If you can't or don't want to do that you can add your script to any of /etc/rc.d/rc.local (preferred), the system crontab as an @reboot job or /etc/inittab depending on your needs.

netwrkengeer 08-03-2008 12:06 PM

Inittab would probably work. I should use chkconfig to add it correct? would it accept my script or do I need a bourne shell script to run it?

unSpawn 08-03-2008 02:12 PM

In your case 'echo "/usr/bin/uf71d start" >> /etc/rc.d/rc.local' should do. By default rc.local is started in runlevels three to five [EDIT]but you can link rc.local to runlevel two like the other symlinks even though thats probably non-standard[/EDIT]. No extra whatever needed to start the daemon (provided you got your licensing right). With respect to the licensing part: as far as I can see UnForm is a commercial product and not subject to any OSS-compatible License (please correct me if I'm wrong) and in my humble and personal opinion the vendor (who also bills for license resets) should be your first port of call with respect to support for this product.

netwrkengeer 08-03-2008 03:35 PM

Your probably right, I should contact the vendor, I just didn't want to wait till monday to get this server running.

Thanks for your help.


All times are GMT -5. The time now is 04:53 AM.