UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21. Read more.
UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21.Read more.
Absent Member.
Absent Member.
3144 views

Error executing startExecServer.sh in start up script

Jump to solution

I followed this post to create a start up script so startExecServer.sh would be executed upon system restart.

http://askubuntu.com/questions/228304/how-do-i-run-a-script-at-start-up

I created 'start-silk' in /etc/init.d/ and chmod as the instruction.

#!/bin/sh 

/usr/local/LinuxExecServer-16.0.0/startExecServer.sh

When I tried to launch start-silk manually by type: ./start-silk, I got this error:

/usr/local/LinuxExecServer-16.0.0/startExecServer.sh: 1: /usr/local/LinuxExecServer-16.0.0/startExecServer.sh: cannot open ./execServer.options: No such file
Error: Could not find or load main class com.segue.scc.internal.execserver.ExecServer

I can go to /usr/local/LinuxExecServer-16.0.0 and launch ./startExecServer.sh successfully

ExecServer was installed on Ubuntu 14.04.3 LTS

0 Likes
1 Solution

Accepted Solutions
Absent Member.
Absent Member.

Hi Jason,

The way I got this working was through the start-up application feature in Ubuntu.

Once this is open then add a new start-up application, using the command for starting your shell script,

This will now run this shell script on every start of Ubuntu.

The script itself contains the following information

#!/bin/sh

echo "$(date) About to run Execution Server"
cd /home/matt/LinuxExecServer-16.0.0
sh ./startExecServer.sh
echo "$(date) Execution Server launched..., process list is $(ps -ef)"

This will change the directory to the location of the startExecServer.sh script and execute the file, logging some information about the processes that have started.

Every time you start your Ubuntu Execution Server now this will also start with the machine and start your execution server.

Regards,

Matthew

View solution in original post

0 Likes
4 Replies
Absent Member.
Absent Member.

Hi jdt2007,

This issue is caused whenever you try to run the script from a command prompt and you are outside the directory that the file is in.

The shell script is looking for these files locally as in ./execServer.options, so you will need to run the script from this directory as well, so that it can recognise the files.

For example if I do this:

cd ~

sh '/home/matt/Downloads/LinuxExecServer-16.0.0/startExecServer.sh'

This will return the same error as yourself:

Make sure that you are running the script from the correct directory on start-up or modify the startExecServer.sh to include full paths to the option set and jar files. 

This should resolve your issues.

Thanks,

0 Likes
Absent Member.
Absent Member.

Thanks Matthew for pointing that out!

I created a symbolic link using this command:  ln -s /usr/local/LinuxExecServer-16.0.0/   ~/LinuxExecServer

LinuxExecServer is created at '/home/silkadmin/' directory

Then update my script to:

----

#!/bin/sh

cd ~/LinuxExecServer

./startExecServer.sh

---

When I run this manually, it works. But when it runs upon restart, it can't 'cd ~/LinuxExecServer'. (I output the log into a file to check the error).

Any idea?

0 Likes
Absent Member.
Absent Member.

Hi Jason,

The way I got this working was through the start-up application feature in Ubuntu.

Once this is open then add a new start-up application, using the command for starting your shell script,

This will now run this shell script on every start of Ubuntu.

The script itself contains the following information

#!/bin/sh

echo "$(date) About to run Execution Server"
cd /home/matt/LinuxExecServer-16.0.0
sh ./startExecServer.sh
echo "$(date) Execution Server launched..., process list is $(ps -ef)"

This will change the directory to the location of the startExecServer.sh script and execute the file, logging some information about the processes that have started.

Every time you start your Ubuntu Execution Server now this will also start with the machine and start your execution server.

Regards,

Matthew

View solution in original post

0 Likes
Absent Member.
Absent Member.

Thanks Matthew! Instead of 'cd /home/matt/LinuxExecServer-16.0.0', I created a symbolic link like I mentioned above, then it works for me. Again, thanks for your help!

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.