It's started a while back, don't remember the exact date.

Anyway, 'vzctl enter CT' then 'crontab -e -u' in a cpanel
container now uses nano, not vi(m).

example:

# vzctl enter 9371
entered into CT 9371
root@host [/]# grep PATH /root/.bash_profile
PATH=$PATH:$HOME/bin
export PATH
root@host [/]# echo $PATH
/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/jdk/bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/sbin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin::/opt/cpanel/composer/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin

root@host [/]# sed -i -e 's#^\(PATH.*\)$#\1:/param/pam/pam#g'
/root/.bash_profile

root@host [/]# grep PATH /root/.bash_profile
PATH=$PATH:$HOME/bin:/param/pam/pam
export PATH
root@host [/]# echo $PATH
/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/jdk/bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/sbin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin::/opt/cpanel/composer/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin
root@host [/]# exit
logout
exited from CT 9371
# vzctl enter 9372
entered into CT 9371
root@host [/]# echo $PATH
/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/jdk/bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/sbin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin::/opt/cpanel/composer/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin:/param/pam/pam
root@host [/]#

so a change in /root/.bash_profile does affect a 'vzctl enter CT' session. Don't know if it's good or bad, I do remember 'never use
"vzctl enter" on a production system, use "vzctl exec(2) instead"'
recommendations, I probably missed when it was changed to a safe
thing.

On 7/2/21 10:49 AM, Konstantin Khorenko wrote:
On 07/02/2021 04:19 PM, Oleksiy Tkachenko wrote:

.bash_profile is not intended to be executed on "vzctl enter CT".
Never was.

Please give an example when it's executed.

--
Konstantin

_______________________________________________
Users mailing list
Users@openvz.org
https://lists.openvz.org/mailman/listinfo/users

Reply via email to