Today (Saturday) We will make some minor tuning adjustments to MySQL.

You may experience 2 up to 10 seconds "glitch time" when we restart MySQL. We expect to make these adjustments around 1AM Eastern Daylight Saving Time (EDT) US.


Trying to make a script to run 3 other scripts in a screen.


 
Thread Tools Search this Thread
# 1  
Trying to make a script to run 3 other scripts in a screen.

Hello, my name is Spurkle. I'm new to linux stuff.

Currently I am trying to make a script which will run three other scripts in screen.

This is the code:
Code:
sudo screen -S hubServ /var/servers/hub/hub.sh
sudo screen -S facServh /var/servers/factions/factions.sh
sudo screen -S bunServ /var/servers/bungeecord/bungeecord.sh

And this is what these scripts contain:
Code:
java -Xmx768M -Xms768M -jar bukkit.jar nogui


But when i try to run the launch.sh script (The one which should start 3 other scripts) i get this:

Code:
Cannot exec '/var/servers/factions/factions.sh': Permission denied
Cannot exec '/var/servers/hub/hub.sh': Permission denied
Cannot exec '/var/servers/bungeecord/bungeecord.sh': Permission denied

I tried giving all the files chmod 777, but it does not seem to work.


Any help would be appreciated.

Best regards,
Spurkle.
# 2  
Strange if you can run the scripts interactively without a problem. Still you need to make sure the entire directory path is executeable as well.
# 3  
Please run
Code:
ls -ld /var/servers
ls -ld /var/servers/hub
ls -ld /var/servers/hub/hub.sh

Permissions should be 755 (not 777 that is unsafe)
# 4  
Quote:
Originally Posted by MadeInGermany
Please run
Code:
ls -ld /var/servers
ls -ld /var/servers/hub
ls -ld /var/servers/hub/hub.sh

Permissions should be 755 (not 777 that is unsafe)
This is what i got:
Code:
root@CrimeCentral:~# ls -ld /var/servers
drwxrwxrwx 5 ftpadmin root 4096 Dec 18 13:24 /var/servers


root@CrimeCentral:~# ls -ld /var/servers/hub
drwxrwxrwx 9 ftpadmin root 4096 Dec 21 07:50 /var/servers/hub


root@CrimeCentral:~# ls -ld /var/servers/hub/hub.sh
-rwxrwxrwx 1 ftpadmin ftpadmin 45 Dec 21 07:50 /var/servers/hub/hub.sh

# 5  
I think the problem is here:
Quote:
Originally Posted by Spurkle
Code:
sudo screen -S hubServ /var/servers/hub/hub.sh
sudo screen -S facServh /var/servers/factions/factions.sh
sudo screen -S bunServ /var/servers/bungeecord/bungeecord.sh

You see, running a command through "sudo" means it is not executed as your user but as some other user. Which one that is (most times it is "root", but that doesn't have to be so) can be found out only by inspecting the file /etc/sudoers. Have a look at it with "view", "more" or something similar (it is safe to view it but under no circumstances change it!).

As the scripts are executable for everybody already you might consider dumping the "sudo" altogether and just run

Code:
screen -S hubServ /var/servers/hub/hub.sh
screen -S facServh /var/servers/factions/factions.sh
screen -S bunServ /var/servers/bungeecord/bungeecord.sh

instead.

I hope this helps.

bakunin
# 6  
Quote:
Originally Posted by bakunin
I think the problem is here:


You see, running a command through "sudo" means it is not executed as your user but as some other user. Which one that is (most times it is "root", but that doesn't have to be so) can be found out only by inspecting the file /etc/sudoers. Have a look at it with "view", "more" or something similar (it is safe to view it but under no circumstances change it!).

As the scripts are executable for everybody already you might consider dumping the "sudo" altogether and just run

Code:
screen -S hubServ /var/servers/hub/hub.sh
screen -S facServh /var/servers/factions/factions.sh
screen -S bunServ /var/servers/bungeecord/bungeecord.sh

instead.

I hope this helps.

bakunin
Hello, i tried running it as you said, but i still get the permissions error.

Image

Best regards,
Spurkle.
 

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
help to make script run recursively
barrydocks
I have this little bash script I use to transcode mkv files using handbrake. #!/bin/bash sourcedir="/media/raid10/video/to_be_encoded_series" destdir="/media/raid10/video/series" cd "$sourcedir" for i in *.mkv; do HandBrakeCLI -i "$i" -o "$destdir/${i%.*}.mkv" -e x264 -q 20.0 -E copy -B...... Shell Programming and Scripting
4
Shell Programming and Scripting
Make script that run with argument if not run from configuration file argument
rohit22hamirpur
Hello, Is there any method thorugh which script can take argument if pass otherwise if argument doesn't pass then it takes the argument from the configuration file i.e I am workiing on a script which will run through crontab and the script will chekout the code ,zip and copy to the...... Shell Programming and Scripting
3
Shell Programming and Scripting
How to make the variables of one script available for the other scripts?
Kesavan
Hello Everyone, I want to know how can we make the variables of one script available for the other script? for example i have three scripts variable_availability.sh,first.sh,second.sh and a file containing variables called common ---------------------------------- cat variable_availability.sh...... UNIX for Advanced & Expert Users
2
UNIX for Advanced & Expert Users
Can anyone make this script run faster?
shew01
One of our servers runs Solaris 8 and does not have "ls -lh" as a valid command. I wrote the following script to make the ls output easier to read and emulate "ls -lh" functionality. The script works, but it is slow when executed on a directory that contains a large number of files. Can anyone make...... Shell Programming and Scripting
10
Shell Programming and Scripting
Run scripts within a script..
earnstaf
Hi all... I have several scripts of varying types (shell script, expect script, awk script) that I would like to run within 1 script.. They also take a command line argument (which it is getting successfully). The problem is, the parent script is exiting after the first script it calls is...... Shell Programming and Scripting
2
Shell Programming and Scripting

Featured Tech Videos