You are not logged in.

#1 2013-09-16 18:50:00

maggie
Member
Registered: 2011-02-12
Posts: 255

How can I get arch-chroot to source /root/.profile [solved]

I really like the arch-chroot script. When I come into the chroot using the script, I see that the shell is /bin/sh instead of bash. That is ok. How can I get the root user inside the chroot to source /root/.profile automatically? I have a line in there that will

exec /usr/bin/bash

. Thank you.

Last edited by maggie (2013-09-16 19:27:20)

Offline

#2 2013-09-16 18:58:57

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: How can I get arch-chroot to source /root/.profile [solved]

Beginner's Guide wrote:

Note: Use

arch-chroot /mnt /bin/bash

to chroot into a bash shell.

Last edited by 2ManyDogs (2013-09-16 19:00:09)

Offline

#3 2013-09-16 19:10:06

progandy
Member
Registered: 2012-05-17
Posts: 5,201

Re: How can I get arch-chroot to source /root/.profile [solved]

If you run bash with exec, you could try to set the ENV variable to a script you want to source. (reset ENV in this script to be sure no later shells will use it)
If bash should source .profile afterwards, make sure to start it as login shell.

Last edited by progandy (2013-09-16 19:13:49)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#4 2013-09-16 19:26:56

maggie
Member
Registered: 2011-02-12
Posts: 255

Re: How can I get arch-chroot to source /root/.profile [solved]

2ManyDogs wrote:
Beginner's Guide wrote:

Note: Use

arch-chroot /mnt /bin/bash

to chroot into a bash shell.

That works. Thank you.

Offline

Board footer

Powered by FluxBB