IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

UNIX System Services Resource Busy


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Martin Wickenden

New User


Joined: 24 Apr 2018
Posts: 15
Location: USA

PostPosted: Thu Jun 14, 2018 5:51 pm
Reply with quote

I am trying to delete some directories and get message saying "RESOURCE BUSY". I enabled the sudo command in IBM ported tools and that does not work either. I get this message:
sudo: main: invoking user identity (XXXXTSO, 7640,595) does not match the invoking process identity (0,595)
How can I tell who is using this directory and how can I delete it please? There are no references to this in the USS commands manual that I can find, thanks, Marty
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8569
Location: Dubuque, Iowa, USA

PostPosted: Thu Jun 14, 2018 6:13 pm
Reply with quote

Code:
ps -ef
in OMVS will tell you active processes, although uncovering the user ids from the output may require some digging. Did you try with the su command (instead of sudo)? If you tried multiple times and got the same message, I would expect that you will find one of the daemons is using the directory and not necessarily any given user. If that is the case, you most likely do NOT want to delete the directory before doing something about that daemon!
Back to top
View user's profile Send private message
Martin Wickenden

New User


Joined: 24 Apr 2018
Posts: 15
Location: USA

PostPosted: Thu Jun 14, 2018 6:25 pm
Reply with quote

Thanks very much for your valued assistance. I will try to keep my daemons at bay! Marty icon_smile.gif
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1689
Location: Tiruppur, India

PostPosted: Fri Jun 15, 2018 12:07 am
Reply with quote

I am somewhat new to USS. But I think this solution would work.

From Shell(not ishell) or omvs,
CD to the directory which says that the resource is busy.
Issue command
Code:
fuser -u *

This would list all the files in the directory + the process number and the user running the process.
Code:
# cd /u/wells
# fuser -u *
prvt_wells_KEY: 16909001(USERID) 16909001(USERID)   <--- resource being held
test_rsa:          <--- peaceful resource not being used
test_rsa.pub:      <--- peaceful resource not being used
#


Hope it helps.
Vasanth.S
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1689
Location: Tiruppur, India

PostPosted: Fri Jul 20, 2018 11:49 pm
Reply with quote

Found this IBM utility which would satisfy the question - zlsof - works great

www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxa500/zlsof.htm#zlsof
Back to top
View user's profile Send private message
phunsoft

New User


Joined: 19 Jul 2018
Posts: 11
Location: Switzerland

PostPosted: Sat Jul 21, 2018 1:57 pm
Reply with quote

Robert Sample wrote:
Code:
ps -ef
in OMVS will tell you active processes, although uncovering the user ids from the output may require some digging.


Use
Code:
ps -ef -ojobname,user,xasid=ASID -opid,ppid,stime,tty=TTY -oargs
and ps delivers jobname and userid (and some more) for the processes.
Back to top
View user's profile Send private message
phunsoft

New User


Joined: 19 Jul 2018
Posts: 11
Location: Switzerland

PostPosted: Sat Jul 21, 2018 2:30 pm
Reply with quote

Martin Wickenden wrote:
I am trying to delete some directories and get message saying "RESOURCE BUSY".



In UNIX you can delete a file or directory even when it is in use by other processes. RESOURCE BUSY is not an indication the file or directory is being used.

It is more likely that the directory you tried to delete is currently being use as an active mount point, and a file system is mounted. The df command should tell you:

Code:
cd directory-of-interest
df .
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1689
Location: Tiruppur, India

PostPosted: Sun Jul 22, 2018 11:23 am
Reply with quote

Quote:
In UNIX you can delete a file or directory even when it is in use by other processes.
Thanks for the useful information. I didn't knew that. In Mainframe datasets its the opposite
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Looking for mainframe system programmers Mainframe Jobs 0
No new posts CICS Web services Assistant - Handlin... CICS 3
No new posts File transfer to remote system using ... TSO/ISPF 2
No new posts Insert System Runtime in HEADER In SY... SYNCSORT 9
No new posts Batch JCL to Copy from Unix Directory... JCL & VSAM 5
Search our Forums:

Back to Top