Script running even after execute permission removed.

Hi All,

I'm new to solaris and this site but the advices in this site have helped me a lot.

Today i am facing a new issue.

We have a script for BMCDashboard and this script is not supposed to run evrytime the server is booted so we disabled the services and removed the execute permissions for root also but still whenever the server is rebooted, we see that the services are enabled and we even made changes in rc script but still we see these services are running.

Need your help on this.

Thanks in Advance.

Regards,
Rocky

Scripts without execute permissions can still be sourced.

What are the contents of this file? Its permissions? Where is it placed?

hi ,
this script is in default run level .. first you find where script is running and also chk any symbolic link are create ...
your script in default run level if yes . then u remove it

Hi Corona,

This script is an application for BMC which is not being used. It is an application named Dashboard which is used in BMC.It resides in /opt.

As you mentioned above, ' Scripts without execute permissions can still be sourced.' can you please name few scripts for my knowledge in future.

Thanks
Rocky

---------- Post updated at 09:21 AM ---------- Previous update was at 09:19 AM ----------

Hi Coolboys,

I had earlier done the same as you mentioned it but still it is running.

Regards,
Rocky

I had the same issue some time ago,and i simply solved it by commenting the commands inside the script,hope it helps.

Regards.

1 Like

Can anybody please explain whats going on here below...:confused:

$ cat test.sh
echo "print"

$ sh test.sh
print

$ ./test.sh
-bash: ./test.sh: Permission denied

$ ls -lt test.sh
-rw-rw-r-- 1 gerbil gerbil 13 Sep  5 10:34 test.sh

$ chmod 754 test.sh

$ ./test.sh
print

$ ls -lt test.sh
-rwxr-xr-- 1 gerbil gerbil 13 Sep  5 10:34 test.sh

When you run it with 'sh scriptname', you're not executing scriptname -- you're executing sh, a separate program. All it does is read the script.

When you run it with ./test.sh, you need permissions to execute the file, since you're running it direct.

'Gerbil' is a great name for a test user. :smiley:

Hi Corona,

Thanks for above information.

but still have confusion...:confused:

could you please explain difference between sh script and ./script in detail.

and about Gerbil i like this name, feels something special and different . :slight_smile:

Thanks,

pamu