- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sh: Execute permission denied
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2015 03:52 AM
07-01-2015 03:52 AM
sh: Execute permission denied
Hello,
I'm getting an "execute permission denied" error though my file has "-rwxrwxrwx" permission, while executing a C object file (real_time.o) through makefile.
Error Desc:
------------
sh: ./real_time.o: Execute permission denied.
*** Error exit code 1
OS Version:
-------------
HP-UX netomy1 B.11.23 U ia64 0975212021 unlimited-user license
/usr/bin/sh --> "-r-xr-xr-x"
Could anyone please help in resolving this error?
- Santhosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2015 07:05 AM
07-01-2015 07:05 AM
Re: sh: Execute permission denied
It may be that the executable file cannot be run on your system.
What model of server? Is HP-UX 32-bit or 64-bit?
# model
# getconf KERNEL_BITS
Run the 'file' command against the executable like this:
# file real_time.o
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2015 07:23 AM
07-01-2015 07:23 AM
Re: sh: Execute permission denied
> sh: ./real_time.o: Execute permission denied.
> /usr/bin/sh --> "-r-xr-xr-x"
The problem is not with the permissions of "/usr/bin/sh".
"/usr/bin/sh" is complaining about "./real_time.o".
How did you create "./real_time.o"? A normal object file, like, say,
output from a command like:
cc -c real_time.c
is not executable. It's not a file-system permissions problem. There's
a difference between an object file (".o", compiler output) and an
executable file ("a.out", linker output).
What, exactly, are you trying to do?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2015 11:41 PM - edited 07-01-2015 11:46 PM
07-01-2015 11:41 PM - edited 07-01-2015 11:46 PM
Re: sh: Execute permission denied
Hi Patrick,
Below are the details you asked for
getconf KERNEL_BITS -> 64
model -> ia64 hp server rx2660
file real_time.o -> real_time.o: ELF-32 relocatable object file - IA64
Thanks,
Santhosh
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hi Steven,
I am new to makefile.
I am trying to modify the existing makefile sample delivered by the vendor to link my "real_time.c" and the api library.
'real_time.o' is generated by makefile (makefile_rt) using the command -> make -f makefile_rt all
Makefile Details:
------------------
# Using libapi.so/sl
ARBOR_LIBS = -lapi
# End of Using libapi.so/sl
#@echo $(ARBORSITE)
# Using libapi.a
ARBOR_LIBS = -lapi -ltablapi -lmpstsender -lducm_apisupport -lducm_manager -lducm_data \
-lmpssupport -lmpsmiddleware -lmps_cache -lACE \
-llate_fee -lacct_balance -lrc \
-larbor_init_thread -larbor_ipc -larbor_provlib -loam_emit -larbor_dbutils \
-larbor_$(DBMS:80=) -larbor_utils -larbor_zlib \
-larbor_thread -larbor_basiclib \
-ltax -lgeo -ltaxcommon -lbp_common \
$(LSALES) $(LCUSTOM) $(LCOMM) \
-lbtunicode
# End of Using libapi.a
#EXTRA_LDIR =
LDFLAGS = -L$(ARBORSITE)/lib -L$(ARBORDIR)/3p/rosette/lib $(EXTRA_LDIR)
LIBS = $(ARBOR_LIBS)
RT_SOURCES = real_time.c common.c
RT_OBJECTS = $(RT_SOURCES:.c=.o)
all: rt_call
rt_call: $(RT_OBJECTS) common.h
$(LINK) $(RT_OBJECTS) $(LINKFLAGS) $(LDFLAGS) $(LIBS) -o $@
Thanks,
Santhosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2015 12:31 AM
07-02-2015 12:31 AM
Re: sh: Execute permission denied
>while executing a C object file (real_time.o) through makefile.
>ELF-32 relocatable object file - IA64
As Steven said, object files can't be executed. They first must be made into a load module using ld(1) or by using the cc(1) driver to link.
>I am trying to modify the existing makefile sample delivered by the vendor to link my real_time.c and the api library.
>real_time.o is generated by makefile using the command -> make -f makefile_rt all
The main output of that makefile is rt_call, not real_time.o.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2015 01:43 AM
07-02-2015 01:43 AM
Re: sh: Execute permission denied
Hi Dennis,
I do agree that main output will be rt_Call, but real_time.o file got generated when I executed the make command (as highlighted earlier).
I am not trying to manually execute the C object file, it is executed as part of 'make' execution and the execute permission error is thrown
Thanks,
Santhosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2015 02:11 AM - edited 07-02-2015 02:12 AM
07-02-2015 02:11 AM - edited 07-02-2015 02:12 AM
Re: sh: Execute permission denied
>I am not trying to manually execute the C object file, it is executed as part of make execution
Then you need to add debugging statements in your makefile or use "make -d".
For each rule add:
echo "Building: $@"
But this is most likely because $(LINK) isn't defined.
LINK = $(CC)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2015 03:39 AM
07-02-2015 03:39 AM
Re: sh: Execute permission denied
Hi Dennis,
As per your suggestion I defined LINK -> LINK = $(CC) and now I'm getting a different below error,
ld: Can't find library or mismatched ABI for -lapi
Fatal error.
*** Error exit code 1
All the libraries are placed in $ARBORSITE/lib path which I already inlcuded in the makefile
Also included /usr/lib/hpux32, should I need to place the necessary library files (.so) in path "/usr/lib/hpux32" ?
Updated makefile contents (sharing only the modified contents from initial) :
IFLAGS = $(EXTRA_INCL) -I$(ARBORSITE)/include -I.
LIBS = $(ARBOR_LIBS)
LINK = $(CC)
CFLAGS = $(IFLAGS) $(EXTRA_INCL) $(DEBUG_FLAGS)
LDFLAGS = -L$(ARBORSITE)/lib -L$(ARBORDIR)/3p/rosette/lib $(EXTRA_LDIR) -L/usr/lib/hpux32
YFLAGS = -d
RT_SOURCES = real_time.c common.c
RT_OBJECTS = $(RT_SOURCES:.c=.o)
all: rt_call
rt_call: $(RT_OBJECTS) common.h
$(LINK) $(RT_OBJECTS) $(LINKFLAGS) $(LDFLAGS) $(LIBS) -o $@
Thanks,
Santhosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2015 03:51 AM
07-02-2015 03:51 AM
Re: sh: Execute permission denied
>ld: Can't find library or mismatched ABI for -lapi
Either the lib isn't in any -L paths or it is a 64 bit lib.
What does this show: file libapi.so
>should I need to place the necessary library files (.so) in path "/usr/lib/hpux32"?
Well, if it is in any of your -L paths, you shouldn't need to do that.
>LDFLAGS = -L$(ARBORSITE)/lib -L$(ARBORDIR)/3p/rosette/lib $(EXTRA_LDIR) -L/usr/lib/hpux32
Never add the default paths to the link line: -L/usr/lib/hpux32
Let the driver figure this out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2015 04:14 AM
07-02-2015 04:14 AM
Re: sh: Execute permission denied
Dennis,
> Either the lib isn't in any -L paths or it is a 64 bit lib.
What does this show: file libapi.so --> libapi.so: ELF-64 shared object file - IA64
As you said its a 64bit lib.
Please advise on the next course of action, I have no clue to proceed further.
> Never add the default paths to the link line: -L/usr/lib/hpux32
I'll refrain from defining the default paths going further, removed it in the existing file.
Thanks,
Santhosh