ERPNext Conference 2019* ERPNext.com Blog

Hint on Terminal Prompt


#1

I have a new install yesterday with physical server using CentOS 7. After the ERPNext prodction installation my terminal prompt changes from “[root@server1 ~]#” to “HEY! USE SCREEN -bash-4.2#”. I love to use screen but I am not used that my prompt is yelling at me.

I parsed the install.py and setup_frappe.sh but I cannot find where this code was embedded. My thanks to anyone knows how to disable this.

rgds,
_Yul


Failed to install ERPNext using production image and also manual installation
#2

This is an annoying bash setting…
The short answer is:
$ sudo nano /etc/profile.d/bashrc.sh
Add the line below
export PS1="\u@\h:\w$:”
save / exit file
$ exit
close terminal window and ssh in again and all should look good.

HTH


#3

You may need to sudo yum install nano first


#4

I thought I’m the only one having this. Thanks for reporting.

Is this bash problem @System19 or ERPNext script problem?

I’m using Ubuntu 16.04


#5

Yep it drove me crazy on centos7 the other day… Grrr… never happened before?


#6

Sorry… Yes its a bash issue. Is also caused by loads of other random things too… Not a new issue either… Possibly set off by frappe install script… But may just bad linux update?


#7

Doesn’t happen on arch linux :sunglasses: (bash 4.4.x)


#8

I wonder about using root to install ERPNext?

The install notes advise do not use root to install, best practice is to use sudo.

While I do all my own sysadmin, very rarely do I login as root.

Misuse of root plays havoc with permission issues for example.

One has to be an expert to use root I am told.


#9

Agree with @clarkej.
At a stretch ‘su’ can be used for OS upgrades etc on rare occasions.


#10

For example problems like this I suspect?


#11

Correction - this is not accurate

The install notes https://github.com/frappe/bench

simply advise this:

Install bench as a non root user

so for example

git clone https://github.com/frappe/bench bench-repo
sudo pip install -e bench-repo


#12

Yes It might be caused by root/sudo install of frappe script. Using easy install under a user account with sudo I found that sometimes the script crashed shortly after creating a new frappe user (something like error frappe user already exists). So its quite possible that account preferences get crushed in the process.


#13

On CentOS7, I finally found the script responsible. It is the screen_wall.sh. I just remove that script and I get my terminal prompt back to normal.

]# rm /etc/profile.d/screen_wall.sh

rgds,
_Yul


#14

@jcagbay thanks thats a cool discovery. what does screen_wall.sh actually do and what in the frappe script causes it comes crash?


#15

Also more importantly,
Does anybody here know how to change the frappe easy install script to avoid the million and one possible crashes that it invokes? Would it minimise issues if before running the easy install script it was expected there was a wheel user “frappe” already created?
Are we asking too much of an easy install script to create a new user as well as install all dependencies?


#16

@System19

User frappe is the target user for easy install so no need to create it in advance. During CentOS7 O/S install you have the option to create a user i.e. admin with sudo access, the one that belongs to group wheel. After the O/S installation, work from that user to install the python script for bench.

$ sudo python install.py --production --user frappe

If you have change to view closely the bench installation, you can glimpse: TASK: SCREEN WALL. I think that is where this screen configuration was installed. But it is not a functional issue. I just don’t used to it.

The bench installation hangs towards the middle of the script. This is more bigger issue. That issue is related to nginx linux package not installed.

$ sudo yum install nginx

Restart bench python installation script. It successfully completes the installation for me. Yours may vary.

rgds,
_Yul


#17

I had a similar situation on an Arch Linux install. I didn’t see the SCREEN WALL message, but the install wouldn’t complete.
After adding nginx every completed smoothly


#18

Below is mentioned under Easy Install

  1. Run the install script
    If you are on a fresh server and logged in as root, use --user flag to create a user and install using that user

#19

try running bash - from the command line you may be in a basic shell by default. If this fixes it you can run to fix it permanently.

login as root and run below command

chsh -s /bin/bash yourusername

source : https://askubuntu.com/questions/231429/terminal-not-configured-not-showing-folder-no-tab-completion-etc


#20

Happend to me as non-root as well; root doesn’t seem to be the problem.