You are not logged in.

#1 2023-10-19 16:15:25

snack
Member
From: Italy
Registered: 2009-01-13
Posts: 893

[SOLVED] Missing append_path

I get the following error when running gitlab-runner:

/etc/profile.d/jre.sh: line 3: append_path: command not found

On the web I found that this is often due to an unmerged /etc/profile.pacnew. I actually had that issue so I went on merging but it didn't solve the problem. So I removed /etc/profile and installed filesystem from scratch, to no avail. So I looked in the file and I found at lines 30-31:

# Unload our profile API functions
unset -f append_path

So it seems quite obvious to me that append_path is not available even after sourcing the correct /etc/profile. Am I missing something? If not, how can I fix the error?

Edit: nevermind, now after all the steps described above append_path is still not available on command line, but gitlab-runner doesn't give the error anymore. I suppose that's the way it should behave...

Last edited by snack (2023-10-19 16:18:44)

Offline

#2 2023-10-19 16:24:21

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,654

Re: [SOLVED] Missing append_path

Why does gitlab-runner run random scripts from your /etc/profile.d ?
Please post your /etc/profile

Edit: fuck.
Yes, is - append_path is available to the scripts in /etc/profile.d when they're sourced by /etc/profile. Not otherwise.

Last edited by seth (2023-10-19 16:25:14)

Offline

#3 2023-10-19 16:28:53

snack
Member
From: Italy
Registered: 2009-01-13
Posts: 893

Re: [SOLVED] Missing append_path

As I wrote in the edit of my first post, now that I have an up-to-date /etc/profile gitlab-runne it does not complain anymore about missing append_path. But I don't know if it's still trying to execute scripts in /etc/profile.d/.
Anyway here's my current /etc/profile (the original problematic one has been wiped out during my tentatives to solve the problem):

# /etc/profile

# Append "$1" to $PATH when not already in.
# This function API is accessible to scripts in /etc/profile.d
append_path () {
    case ":$PATH:" in
        *:"$1":*)
            ;;
        *)
            PATH="${PATH:+$PATH:}$1"
    esac
}

# Append our default paths
append_path '/usr/local/sbin'
append_path '/usr/local/bin'
append_path '/usr/bin'

# Force PATH to be environment
export PATH

# Load profiles from /etc/profile.d
if test -d /etc/profile.d/; then
        for profile in /etc/profile.d/*.sh; do
                test -r "$profile" && . "$profile"
        done
        unset profile
fi

# Unload our profile API functions
unset -f append_path

# Source global bash config, when interactive but not posix or sh mode
if test "$BASH" &&\
   test "$PS1" &&\
   test -z "$POSIXLY_CORRECT" &&\
   test "${0#-}" != sh &&\
   test -r /etc/bash.bashrc
then
        . /etc/bash.bashrc
fi

# Termcap is outdated, old, and crusty, kill it.
unset TERMCAP

# Man is much better than us at figuring this out
unset MANPATH

# Disable Qt debug logs (https://forum.manjaro.org/t/kde-plasma-related-error-messages-in-journal/21790/3)
QT_LOGGING_RULES='*.debug=false'
export QT_LOGGING_RULES

It's almost vanilla, except for the last QT settings.

Edit: I didn't see your edit before answering big_smile

Last edited by snack (2023-10-19 16:29:45)

Offline

Board footer

Powered by FluxBB