The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Awk - to test multiple files "read" permission ? lokiman Shell Programming and Scripting 1 02-09-2008 12:10 PM
Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Lokesha UNIX for Dummies Questions & Answers 4 12-20-2007 01:52 AM
permission denied for ". " (dot space) shriashishpatil UNIX for Advanced & Expert Users 3 04-12-2007 03:28 PM
simple Unix Execute permission for "others" jsudha HP-UX 1 07-26-2004 04:45 PM
How to "Print Screen" from a dumb terminal on AIX? stembe UNIX for Advanced & Expert Users 3 11-15-2002 12:01 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-12-2006
miechu miechu is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 10
screen throws "permission denied"

Hi all,

i've got problem in running a script in background... i have written a script, and i want to run it everytime i log in, but when i log off i want the script to stay (i watch not to run two scripts at one time in the script).

so as a normal user i want to do:

$ screen my_script &

this works only when i'm on a root, but when i do it as a normal user i get:

shmat: Permission denied

i've noticed that i just can't run screen as a normal user...
so... can anyone tell me what the hell is going on?

btw. i'm on SunOS 5.9
  #2 (permalink)  
Old 10-17-2006
Yogesh Sawant's Avatar
Yogesh Sawant Yogesh Sawant is offline Forum Staff  
Part Time Moderator and Full Time Dad
  
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 1,086
try running your script with nohup
  #3 (permalink)  
Old 10-18-2006
miechu miechu is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 10
yup... tried that... it dosn't work... don't know why though (maybe solaris is a great system )... maybe i'm using it not right... anyway the scirpt is in PATH, and it's name is... eg. my_scirpt, with that how am i suppose to call nohup?
  #4 (permalink)  
Old 10-20-2006
Just Ice's Avatar
Just Ice Just Ice is offline Forum Advisor  
Lights on, brain off.
  
 

Join Date: Mar 2005
Location: in front of my computer
Posts: 637
try putting the script in a subshell in the background ...

(/dir/script </dev/null &)
  #5 (permalink)  
Old 10-20-2006
miechu miechu is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 10
you meant:


Code:
/dir/script > /dev/null &

it works ok... but when i want to logout (ctrl-d) my putty hangs... just closing it closes the session... and that is somewhat strange...
  #6 (permalink)  
Old 10-24-2006
Just Ice's Avatar
Just Ice Just Ice is offline Forum Advisor  
Lights on, brain off.
  
 

Join Date: Mar 2005
Location: in front of my computer
Posts: 637
i actually meant what i wrote ...

Code:
( /dir/script < /dev/null & )

the way you wrote yours connects your script to your current shell as well as sending any output to /dev/null ... the way i wrote mine, the script takes input from /dev/null while the output goes wherever it needs to go ...

good luck!
  #7 (permalink)  
Old 10-24-2006
saladoil saladoil is offline
Registered User
  
 

Join Date: Oct 2006
Location: Chicago, Il - Where else?
Posts: 1
Ran into this myself some time ago. The problem is due to permissions on the "device" screen is using. This is why you are getting the "permission denied" error. Can't quite remember which device right now, but I wrote a script to change perms on the device for users wishing to do very close to what you want to do. If I recall, I brought up screen while using another session to poll (cd <device_directory>; while true; do ls -ltr; done), the device list. This way, I could see which device was assigned a user, and know which device to change perms on. Hope this helps... if I remember, I can look for the script tomorrow and post it.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:48 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0