Error: runuser[1205951]: /etc/profile.d/perlbin.sh?

In a systemd service adjusted by me i change to user john1 and get this message:

    Process: 1205948 ExecStart=runuser - john1 -c rm -rf /var/tmp/pamac-build-john1/* (code=exited, status=0/SUCCESS)
   Main PID: 1205948 (code=exited, status=0/SUCCESS)
        CPU: 29ms

Sep 29 23:00:20 manjaro pamac[1205946]: Anzahl der Versionen je Paket die im Puffer gehalten werden: 0
Sep 29 23:00:20 manjaro pamac[1205946]: Zum Löschen: 0 Dateien
Sep 29 23:00:20 manjaro runuser[1205948]: pam_unix(runuser-l:session): session opened for user john1(uid=1000) by (uid=0)
Sep 29 23:00:20 manjaro runuser[1205948]: pam_env(runuser-l:session): deprecated reading of user environment enabled
Sep 29 23:00:20 manjaro runuser[1205951]: ***/etc/profile.d/perlbin.sh: Zeile 5: append_path: Kommando nicht gefunden.***
Sep 29 23:00:20 manjaro runuser[1205952]: /etc/profile.d/perlbin.sh: Zeile 7: append_path: Kommando nicht gefunden.
Sep 29 23:00:20 manjaro runuser[1205953]: /etc/profile.d/perlbin.sh: Zeile 9: append_path: Kommando nicht gefunden.
Sep 29 23:00:20 manjaro runuser[1205948]: pam_unix(runuser-l:session): session closed for user john1


I don’t know if thats an error that manjaro developers should fix?!

Info:

Generated on 2021-09-30 11:51:1632995497

#################### inxi -Fxzc0 ########################

System:    Kernel: 5.10.68-1-MANJARO x86_64 bits: 64 compiler: gcc v: 11.1.0 Desktop: Xfce 4.16.0 
           Distro: Manjaro Linux base: Arch Linux 
Machine:   Type: Laptop System: LENOVO product: 81RS v: Lenovo Yoga S740-14IIL serial: <filter> 
           Mobo: LENOVO model: LNVNB161216 v: SDK0J40709 WIN serial: <filter> UEFI: LENOVO 
           v: BYCN38WW date: 12/10/2020 
Battery:   ID-1: BAT0 charge: 61.8 Wh (94.6%) condition: 65.3/62.0 Wh (105.3%) volts: 17.0 
           min: 15.4 model: LGC L19L4PD2 status: Unknown 
CPU:       Info: Quad Core model: Intel Core i7-1065G7 bits: 64 type: MT MCP arch: Ice Lake rev: 5 
           cache: L2: 8 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 23968 
           Speed: 1200 MHz min/max: 400/3900 MHz Core speeds (MHz): 1: 1200 2: 1201 3: 1200 
           4: 1200 5: 1201 6: 1202 7: 1201 8: 1200 
Graphics:  Device-1: Intel Iris Plus Graphics G7 vendor: Lenovo driver: i915 v: kernel 
           bus-ID: 00:02.0 
           Device-2: NVIDIA GP108M [GeForce MX250] vendor: Lenovo driver: nvidia v: 470.63.01 
           bus-ID: 2b:00.0 
           Device-3: Chicony Integrated Camera type: USB driver: uvcvideo bus-ID: 3-5:4 
           Display: x11 server: X.Org 1.20.13 driver: loaded: modesetting,nvidia unloaded: nouveau 
           resolution: 1: 1680x1050~60Hz 2: 1680x1050~60Hz 
           Message: Unable to show advanced data. Required tool glxinfo missing. 
Audio:     Device-1: Intel Ice Lake-LP Smart Sound Audio vendor: Lenovo driver: sof-audio-pci 
           bus-ID: 00:1f.3 
           Sound Server-1: ALSA v: k5.10.68-1-MANJARO running: yes 
           Sound Server-2: sndio v: N/A running: no 
           Sound Server-3: JACK v: 1.9.19 running: no 
           Sound Server-4: PulseAudio v: 15.0 running: yes 
Network:   Device-1: Intel Ice Lake-LP PCH CNVi WiFi driver: iwlwifi v: kernel port: 4000 
           bus-ID: 00:14.3 
           IF: wlp0s20f3 state: down mac: <filter> 
           Device-2: Realtek RTL8153 Gigabit Ethernet Adapter type: USB driver: r8152 
           bus-ID: 3-1:2 
           IF: enp0s20f0u1 state: up speed: 1000 Mbps duplex: full mac: <filter> 
           IF-ID-1: pan1 state: down mac: <filter> 
Bluetooth: Device-1: Intel AX201 Bluetooth type: USB driver: btusb v: 0.8 bus-ID: 3-10:6 
           Report: rfkill ID: hci0 rfk-id: 3 state: up address: see --recommends 
Drives:    Local Storage: total: 1.86 TiB used: 364.15 GiB (19.1%) 
           ID-1: /dev/nvme0n1 vendor: Micron model: MTFDHBA1T0TCK size: 953.87 GiB temp: 38.9 C 
           ID-2: /dev/sda type: USB vendor: Western Digital model: WD10EARX-00N0YB0 
           size: 931.51 GiB 
           ID-3: /dev/sdb type: USB vendor: Kingston model: DataTraveler 2.0 size: 14.54 GiB 
           ID-4: /dev/sdc type: USB model: Kindle Internal Storage size: 2.77 GiB 
Partition: ID-1: / size: 57.9 GiB used: 34.27 GiB (59.2%) fs: ext4 dev: /dev/nvme0n1p8 
           ID-2: /boot/efi size: 259.5 MiB used: 105.5 MiB (40.7%) fs: vfat dev: /dev/nvme0n1p1 
Swap:      ID-1: swap-1 type: partition size: 16.67 GiB used: 4.5 MiB (0.0%) dev: /dev/nvme0n1p9 
Sensors:   System Temperatures: cpu: 48.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Info:      Processes: 276 Uptime: 1d 15h 31m Memory: 15.2 GiB used: 1.99 GiB (13.1%) Init: systemd 
           Compilers: gcc: 11.1.0 Packages: 1744 Client: Unknown Client: wrapper-2.0 inxi: 3.3.06 




If you change something why do you think someone else is responsible?
What exactly did you change?

I changed

See the line runuser:

[Unit]
Description=Clean packages cache

[Service]
Type=oneshot
ExecStart=/usr/bin/pamac clean -v --no-confirm
# ExecStart=runuser - john1 -c "/usr/bin/pamac clean -b -v --no-confirm"
# ExecStart=rm -rf /var/tmp/pamac-build-john1/*
# ExecStart=/home/john1/my_pamac_clean_build.sh
ExecStart=runuser - john1 -c 'rm -rf /var/tmp/pamac-build-john1/*'

Systemctl tells me its ok, but

 sudo systemctl status   pamac-cleancache.service
[sudo] Passwort für john1: 
○ pamac-cleancache.service - Clean packages cache
     Loaded: loaded (/usr/lib/systemd/system/pamac-cleancache.service; static)
     Active: inactive (dead) since Wed 2021-09-29 23:00:20 CEST; 12h ago
TriggeredBy: ● pamac-cleancache.timer
    Process: 1205946 ExecStart=/usr/bin/pamac clean -v --no-confirm (code=exited, status=0/SUCCESS)
    Process: 1205948 ExecStart=runuser - john1 -c rm -rf /var/tmp/pamac-build-john1/* (code=exited, status=0/SUCCESS)
   Main PID: 1205948 (code=exited, status=0/SUCCESS)
        CPU: 29ms

Sep 29 23:00:20 manjaro pamac[1205946]: Anzahl der Versionen je Paket die im Puffer gehalten werden: 0
Sep 29 23:00:20 manjaro pamac[1205946]: Zum Löschen: 0 Dateien
Sep 29 23:00:20 manjaro runuser[1205948]: pam_unix(runuser-l:session): session opened for user john1(uid=1000) by (uid=0)
Sep 29 23:00:20 manjaro runuser[1205948]: pam_env(runuser-l:session): deprecated reading of user environment enabled
Sep 29 23:00:20 manjaro runuser[1205951]: /etc/profile.d/perlbin.sh: Zeile 5: append_path: Kommando nicht gefunden.
Sep 29 23:00:20 manjaro runuser[1205952]: /etc/profile.d/perlbin.sh: Zeile 7: append_path: Kommando nicht gefunden.
Sep 29 23:00:20 manjaro runuser[1205953]: /etc/profile.d/perlbin.sh: Zeile 9: append_path: Kommando nicht gefunden.
Sep 29 23:00:20 manjaro runuser[1205948]: pam_unix(runuser-l:session): session closed for user john1
Sep 29 23:00:20 manjaro systemd[1]: pamac-cleancache.service: Deactivated successfully.
Sep 29 23:00:20 manjaro systemd[1]: Finished Clean packages cache.

Ok, i could change my question:

Is the line with runuser really an error?

If i execute the runuser line in a root terminal i get

njaro cron.hourly]# runuser - john1 -c 'rm -rf /var/tmp/pamac-build-john1/*'
/etc/profile.d/perlbin.sh: Zeile 5: append_path: Kommando nicht gefunden.
/etc/profile.d/perlbin.sh: Zeile 7: append_path: Kommando nicht gefunden.
/etc/profile.d/perlbin.sh: Zeile 9: append_path: Kommando nicht gefunden.
[manjaro cron.hourly]# 

So for me thats an error i can’t fix!

append_path is a function which should have been defined via /etc/profile.
Is there a /etc/profile.pacnew which you did not yet merge?
Please post output of:

$ ls -lh /etc/profile*
$ cat /etc/profile
1 Like

Here it is:

[manjaro cron.hourly]# ls -lh /etc/profile*
-rw-r--r-- 1 root root  811  6. Apr 2020  /etc/profile

/etc/profile.d:
insgesamt 72K
-rw-r--r-- 1 root root  545 21. Sep 23:39 freetype2.sh
-rw-r--r-- 1 root root 1,1K 15. Apr 2020  gawk.csh
-rw-r--r-- 1 root root  757 15. Apr 2020  gawk.sh
-rw-r--r-- 1 root root  105 31. Aug 21:06 gpm.sh
-rw-r--r-- 1 root root   37 20. Jan 2021  home-local-bin.sh
-rw-r--r-- 1 root root  207 16. Mai 2020  jre.csh
-rw-r--r-- 1 root root  205 16. Mai 2020  jre.sh
-rw-r--r-- 1 root root  191 17. Sep 18:17 libreoffice-fresh.csh
-rw-r--r-- 1 root root  191 17. Sep 18:17 libreoffice-fresh.sh
-rw-r--r-- 1 root root  766 20. Jan 2021  locale.sh
-rwxr-xr-x 1 root root   50 16. Mai 2020  mozilla-common.csh
-rwxr-xr-x 1 root root   50 16. Mai 2020  mozilla-common.sh
-rw-r--r-- 1 root root  468 18. Jul 19:20 perlbin.csh
-rw-r--r-- 1 root root  464 18. Jul 19:20 perlbin.sh
-rw-r--r-- 1 root root  849 27. Jul 18:46 snapd.sh
-rwxr-xr-x 1 root root   86 25. Mai 2020  splint.sh
-rw-r--r-- 1 root root  963  6. Jun 11:01 vte.csh
-rw-r--r-- 1 root root 1,4K  6. Jun 11:01 vte.sh

AND

njaro cron.hourly]# cat /etc/profile
# /etc/profile

# Set our umask
umask 022

# Append our default paths
appendpath () {
    case ":$PATH:" in
        *:"$1":*)
            ;;
        *)
            PATH="${PATH:+$PATH:}$1"
    esac
}

appendpath '/usr/local/sbin'
appendpath '/usr/local/bin'
appendpath '/usr/bin'
# von mir ergaenzt
appendpath '/home/john1/lazarus'
unset appendpath

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

# Source global bash config
if test "$PS1" && test "$BASH" && test -z ${POSIXLY_CORRECT+x} && 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
[manjaro cron.hourly]# 

YES, i have edit profile to have lazarus executable in $PATH

So there is no /etc/profile.pacnew but at some time there must have been and the merge wasn’t done properly. Your version still has the old appendpath function defined, where it’s now append_path.
Edit your /etc/profile to define this function, here’s the complete content of current /etc/profile as it’s installed via filesystem package:

# /etc/profile

# Set our umask
umask 022

# 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

It’s now defined append_path and does not unset it to provide it to other scripts in /etc/profile.d for example.

Thank you!!

I’ll do that tomorrow … bathtub is waiting

I think there is no *.pacnew because i tried to use pacdiff(?) and got angry while handling differences with vi.

Yes i hate vi so i will never become a real linux- enthusiast
:slight_smile:

Problem solved, i mark your answer as solution.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.