Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
UNIX System Services Resource Busy

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

New User


Joined: 24 Apr 2018
Posts: 12
Location: USA

PostPosted: Thu Jun 14, 2018 5:51 pm    Post subject: UNIX System Services Resource Busy
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: 8378
Location: Dubuque, Iowa, USA

PostPosted: Thu Jun 14, 2018 6:13 pm    Post subject:
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: 12
Location: USA

PostPosted: Thu Jun 14, 2018 6:25 pm    Post subject: Reply to: UNIX System Services Resource Busy
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: 1592
Location: Chennai

PostPosted: Fri Jun 15, 2018 12:07 am    Post subject:
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: 1592
Location: Chennai

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

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

https://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    Post subject:
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    Post subject: Re: UNIX System Services Resource Busy
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: 1592
Location: Chennai

PostPosted: Sun Jul 22, 2018 11:23 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Convert JCL to Unix Shell scripts mistah kurtz All Other Mainframe Topics 2 Sun Jul 01, 2018 7:21 pm
No new posts Finding IMS resource blocker after se... Hooman24 IMS DB/DC 1 Wed Aug 16, 2017 9:17 pm
No new posts How system know which REXX to excute? jackzhang75 CLIST & REXX 14 Thu Jul 06, 2017 1:09 am
No new posts FTP from Mainframe to Unix - with CRLF vasanthz All Other Mainframe Topics 7 Thu Mar 23, 2017 5:12 am
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us