/var/lock/subsys permission denied for root


 
Thread Tools Search this Thread
Operating Systems Linux /var/lock/subsys permission denied for root
# 1  
Old 05-15-2012
/var/lock/subsys permission denied for root

Hello

I have simple line of code here:
Code:
FILE *lockfp = fopen("/var/lock/subsys/processName", "w");

which is denied even running as root. The result is
Code:
locking failed for the following reason: Permission denied

How is this possible? Why is this happening?

Thanks for your help
# 2  
Old 05-15-2012
I don't see how that line of code could print that error message. Could you show the rest of it?

Also, do
Code:
ls -ld /var/lock/subsys /var/lock/subsys/processName

# 3  
Old 05-15-2012
the file doesn't exist and I am trying to create it. however, for the whole directory, the permissions are:
Code:
drwxr-xr-x 2 root root 4096 May 15 14:23 /var/lock/subsys

there are no more error messages, thats the only one and the program exists. I have narrowed it down to that one line; if i take it out the program continues to the next section and so forth.
# 4  
Old 05-15-2012
If you take out that line, other things using lockfp ought to complain about that variable not even existing.

And what the rest of the code does is certainly important. There may be bugs that misinterpret its return value, for instance.

Can we please see more of the code?

Also, a df -h just to make sure /var/lock/subsys/ isn't some odd filesystem that even root can't write to.
# 5  
Old 05-15-2012
hmm you are right, I wasn't being logical with my testing.

if I have that line in, both a regular user and root have issues. (by line, i mean the code associated with using that variable as well, which is just a simple if-statement to use lockfp) if i take out that section, the regular user can execute the code but then the root still has the same problem.

thanks, i'll investigate some more.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Can't open nodes-6379.conf in order to acquire a lock: Permission denied

I am getting error on redis server on linux 7.5 after change the default path /var/lib/redis to /redisdata, and enable cluster-enabled yes. It would be really appreciate if some one can check and suggest on this issue. error code: 1240:C 09 Sep 2018 13:53:51.058 # oO0OoO0OoO0Oo Redis is... (3 Replies)
Discussion started by: nadeemrafikhan
3 Replies

2. Shell Programming and Scripting

Trying to create a script to run as root, permission denied

Hello all, I am trying to create a script or a .command file that will run for me and my other techs on many, many Mac OSX computers that will add a file to the /etc/ folder called /etc/launchd.conf Every time I try to run the script, I get "Permission Denied" when trying to put the file into... (13 Replies)
Discussion started by: DonnieNarco
13 Replies

3. AIX

Permission Denied issue on AIX 6.1 using Root

I have the following problem on my AIX 6.1 server. I logged in with Root ID to this folder etc/opt/symantec/scspagent/lib/instfunlib I try changing the folder permission but I keep getting this output : chmod: /opt/symantec/scspagent/lib/instfunlib: Permission Denied I did a listing on it... (3 Replies)
Discussion started by: mcdsweet98
3 Replies

4. UNIX for Advanced & Expert Users

/var/mail/$LOGINNAME.lock

I'm not able to view my inbox mails, I'm using Thunderbird. I have checked the /var/mail/ directory files. There I saw the lock file. . I have removed the lock file and restarted the Thunderbird, again the lock file is created. I have changed the file group as mail from users. after that... (1 Reply)
Discussion started by: ungalnanban
1 Replies

5. UNIX for Advanced & Expert Users

Testing privileges -lock lockfile /var/lock/subsys/..- Permission denied

Hi all, I have to test some user priviliges. The goal is to be sure that an unauthorized user can't restart some modules (ssh, mysql etc...). I'm trying to automate it with a shell script but in same cases I got the syslog broadcast message. Is there any way to simply get a return code... (3 Replies)
Discussion started by: Dedalus
3 Replies

6. Shell Programming and Scripting

Permission denied

I created a user so that when he logs in he will be directed to a menu /etc/passwd user1:x:115:1:Support -SysAd:/export/home/user1:/export/home/suppotrmenu/script.sh However when I logged in remotely from another server by ssh user1@1.1.1.1 , it saysexport/home/suppotrmenu/script.sh:... (4 Replies)
Discussion started by: lhareigh890
4 Replies

7. Red Hat

Permission denied

Hi guys im new to this db i have a small prob while installing websphereportal6.1i think i was installed succesfully but the error im getting is while starting server. check this out # ./serverStatus.sh -all Error loading: /usr/wps61/AppServer/java/jre/bin/classic/libjvm.so: cannot... (1 Reply)
Discussion started by: varma917989
1 Replies

8. UNIX for Dummies Questions & Answers

Permission denied when changing root password after reset

I have a Solaris 10 machine that I didn't know the root password to so I went into single user mode and removed the password from the shadow file and rebooted and I am able to login with no password now. But my problem is that when I try to change the root password from no password to something... (0 Replies)
Discussion started by: darkone_d1_2000
0 Replies

9. UNIX for Advanced & Expert Users

Permission denied

Hi, I can not execute a .env file $ . /Data/oracle/d03/mydbora/8.0.6/MYDB.env -bash: /Data/oracle/d03/mydbora/8.0.6/MYDB.env: Permission denied Even if : -rwxrwxrwx 1 oracle dba 2903 Mar 5 2007 /Data/oracle/d03/mydbora/8.0.6/MYDB.env Please help. Many thanks. (1 Reply)
Discussion started by: big123456
1 Replies

10. UNIX for Dummies Questions & Answers

./ Permission Denied.

Could someone tell me why I am getting a permission denied message when I attempt to run this on an out file? Thanks! (8 Replies)
Discussion started by: trouscaillon
8 Replies
Login or Register to Ask a Question