Score:1

WSL Ubuntu cycles through Agend pid #'s endlessly until I press cntrl c on startup or login

ls flag

I've got an ubuntu installation that is running some software for my company, and I've added some paths to the .bashrc file. When I start WSL with wsl -b ubuntu, it prints out this, and keeps going until I hit control-c.

Agent pid 549
Agent pid 556
Agent pid 563
Agent pid 570
Agent pid 577
Agent pid 584

This is the line I've added

export PATH=$PATH:/usr/local/go/bin && source $HOME/.profile

Do I need to add something else, or a kill statement?

Score:1
mx flag

Remove && source $HOME/.profile from the add'ed line.

As it is now, it reloads your .profile which apparently starts Agent program before ,profile is reloaded (soure'd) again.

Score:0
hr flag

If your ~/.profile is based on the default Ubuntu one (copied from the /etc/skel directory on account creation), then you'll notice that it contains the following lines:

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

in other words, ~/.profile sources ~/.bashrc when it detects that you are running a bash shell. The intention is to make login shells behave as similarly as possible to interactive non-login shells.

Hence if you also source ~/.profile from ~/.bashrc, you end up in an infinite loop in which one file repeatedly sources the other.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.