OpenVZ Forum


Home » Mailing lists » Users » "permission denied" error on CT rc.local script to add custom commands by regular
"permission denied" error on CT rc.local script to add custom commands by regular [message #42989] Sat, 25 June 2011 16:56 Go to previous message
knawnd is currently offline  knawnd
Messages: 27
Registered: April 2011
Junior Member
Hi!

I need to add in script some custom commands into /etc/rc.local file
located in CT filesystem in order to execute them on CT start up. It
needs to be done under regular user with full root rights granted via
sudo. But "permission denied" error appears.

$ sudo echo "# oneadmin test" >> /vz/private/164/etc/rc.d/rc.local
-bash: /vz/private/164/etc/rc.d/rc.local: Permission denied

$ grep -v ^# /etc/sudoers|grep -v ^$
Defaults env_reset
Defaults env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR \
LS_COLORS MAIL PS1 PS2 QTDIR USERNAME \
LANG LC_ADDRESS LC_CTYPE LC_COLLATE
LC_IDENTIFICATION \
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME
LC_NUMERIC \
LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE
LINGUAS \
_XKB_CHARSET XAUTHORITY"
root ALL=(ALL) ALL
%cloud ALL=(ALL) NOPASSWD: ALL

$ id
uid=9000(oneadmin) gid=9001(cloud) groups=9001(cloud)

$ sudo id
uid=0(root) gid=0(root)
groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(whe el)

$ sudo ls -al /vz/private/164/etc/rc.d/rc.local
-rwxr-xr-x 1 root root 227 Jun 25 20:17 /vz/private/164/etc/rc.d/rc.local

Whereas the same command (i.e. echo "# oneadmin test" >>
/vz/private/164/etc/rc.d/rc.local) is performed normally under superuser.

CT is based on Scientific Linux 5 template. Hardware node is running
under CentOS 5.6.

Does someone have any ideas what can be the reason of insufficient
privileges for regular user with full root rights granted via sudo?

Thanks in advance,
Nikolay.
 
Read Message
Read Message
Read Message
Previous Topic: vzdev-3.3.13-1.4.swsoft
Next Topic: Strange mount problem
Goto Forum:
  


Current Time: Sat Nov 09 07:49:48 GMT 2024

Total time taken to generate the page: 0.03160 seconds