From 368579ee5498b5051cc32fe42df2caff2573fc74 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 23 Sep 2020 13:19:09 +0200 Subject: [*] Remove "export PATH..." -> DefaultEnvironment= in system.conf.d Since we can set PATH for everything spawned by systemd, this boilerplate code is not needed anymore. Makes future changes much easier. --- core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx | 2 -- .../dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-dnbd3_proxy | 2 -- .../hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats | 2 -- .../data/opt/openslx/system-check/hooks.d/50-hardware-report | 2 -- .../idleaction/data/opt/openslx/scripts/idleaction-scheduled_action | 3 ++- .../iptables-helper/data/opt/openslx/iptables/iptables-reloader-worker | 2 -- .../data/opt/openslx/scripts/kiosk-launch.d/00-slxbrowser | 2 -- core/modules/run-virt/data/opt/openslx/scripts/systemd-mount_vm_store | 2 -- core/modules/run-virt/data/opt/openslx/scripts/systemd-run_virt_env | 2 -- core/modules/slx-issue/data/opt/openslx/scripts/openslx-create_issue | 2 -- core/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl | 2 -- core/modules/vbox-src/data/opt/openslx/scripts/systemd-vbox_env | 2 -- core/modules/vmware-common/data/opt/openslx/scripts/systemd-vmware_env | 2 -- .../data/opt/openslx/bin/vmware-get-supported-version | 2 -- .../data/opt/openslx/scripts/systemd-download_slx_addons | 2 -- 15 files changed, 2 insertions(+), 29 deletions(-) diff --git a/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx b/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx index 8130eb13..cf4576a7 100755 --- a/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx +++ b/core/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx @@ -18,8 +18,6 @@ # # ----------------------------------------------------------------------------- -export PATH=$PATH:/opt/openslx/sbin:/opt/openslx/bin - . /opt/openslx/config primary="br0" diff --git a/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-dnbd3_proxy b/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-dnbd3_proxy index 9b645796..e094aa44 100755 --- a/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-dnbd3_proxy +++ b/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-dnbd3_proxy @@ -1,7 +1,5 @@ #!/bin/ash -export PATH="$PATH:/opt/openslx/sbin:/opt/openslx/bin" - ERRLOG="/run/dnbd3-proxy.err" if [ -s "$ERRLOG" ]; then diff --git a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats index d059657e..dd334cc7 100755 --- a/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats +++ b/core/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats @@ -8,8 +8,6 @@ export LANG=C export LC_ALL=C -export PATH=$PATH:/opt/openslx/sbin:/opt/openslx/bin - touch "/tmp/hw-delete-list" || exit 10 chmod 0600 "/tmp/hw-delete-list" || exit 11 echo -n "" > "/tmp/hw-delete-list" || exit 12 diff --git a/core/modules/hardware-stats/data/opt/openslx/system-check/hooks.d/50-hardware-report b/core/modules/hardware-stats/data/opt/openslx/system-check/hooks.d/50-hardware-report index 6d137f40..a2dbbd56 100755 --- a/core/modules/hardware-stats/data/opt/openslx/system-check/hooks.d/50-hardware-report +++ b/core/modules/hardware-stats/data/opt/openslx/system-check/hooks.d/50-hardware-report @@ -1,7 +1,5 @@ #!/bin/ash -export PATH=$PATH:/opt/openslx/sbin:/opt/openslx/bin - . /opt/openslx/config disable_remote_logging() { diff --git a/core/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action b/core/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action index 38be4f79..c30ac7fb 100755 --- a/core/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action +++ b/core/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action @@ -1,6 +1,7 @@ #!/bin/ash -export PATH="$PATH:/opt/openslx/bin:/opt/openslx/sbin" +# Called via mgmt SSH so PATH might be wrong! +export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/sbin:/opt/openslx/bin" if ! touch "/run"; then echo "Only root can call this" >&2 diff --git a/core/modules/iptables-helper/data/opt/openslx/iptables/iptables-reloader-worker b/core/modules/iptables-helper/data/opt/openslx/iptables/iptables-reloader-worker index 4bcf41f4..0c8277a2 100755 --- a/core/modules/iptables-helper/data/opt/openslx/iptables/iptables-reloader-worker +++ b/core/modules/iptables-helper/data/opt/openslx/iptables/iptables-reloader-worker @@ -6,8 +6,6 @@ # # This scriptis triggered by inotifyd, see openslx-iptables_reloader.service -export PATH="$PATH:/opt/openslx/sbin:/opt/openslx/bin" - ALL_RULES="/run/iptables-reloader.cache" LOCK="/run/iptables-reloader.lock" WAIT="/run/iptables-reloader.wait" diff --git a/core/modules/kiosk-slxbrowser/data/opt/openslx/scripts/kiosk-launch.d/00-slxbrowser b/core/modules/kiosk-slxbrowser/data/opt/openslx/scripts/kiosk-launch.d/00-slxbrowser index fc8d0eae..94c69247 100644 --- a/core/modules/kiosk-slxbrowser/data/opt/openslx/scripts/kiosk-launch.d/00-slxbrowser +++ b/core/modules/kiosk-slxbrowser/data/opt/openslx/scripts/kiosk-launch.d/00-slxbrowser @@ -1,8 +1,6 @@ #!/bin/bash # ^ sourced! -export PATH=$PATH:/opt/openslx/sbin:/opt/openslx/bin - command -v slxbrowser || return 0 OPTS=() diff --git a/core/modules/run-virt/data/opt/openslx/scripts/systemd-mount_vm_store b/core/modules/run-virt/data/opt/openslx/scripts/systemd-mount_vm_store index a9ce62b6..335c0f51 100755 --- a/core/modules/run-virt/data/opt/openslx/scripts/systemd-mount_vm_store +++ b/core/modules/run-virt/data/opt/openslx/scripts/systemd-mount_vm_store @@ -2,8 +2,6 @@ . /opt/openslx/config || exit 1 -export PATH="$PATH:/opt/openslx/sbin:/opt/openslx/bin" - [ -z "$SLX_VM_NFS" ] && exit 0 # create target directory diff --git a/core/modules/run-virt/data/opt/openslx/scripts/systemd-run_virt_env b/core/modules/run-virt/data/opt/openslx/scripts/systemd-run_virt_env index efc85ad3..ddcb81c5 100755 --- a/core/modules/run-virt/data/opt/openslx/scripts/systemd-run_virt_env +++ b/core/modules/run-virt/data/opt/openslx/scripts/systemd-run_virt_env @@ -23,8 +23,6 @@ ### Define default dirs / get configs ################################################################################ -export PATH=$PATH:/opt/openslx/bin:/opt/openslx/sbin - # source config file with vars (e.g. ipaddr, macaddr, HOSTNAME) . /opt/openslx/config diff --git a/core/modules/slx-issue/data/opt/openslx/scripts/openslx-create_issue b/core/modules/slx-issue/data/opt/openslx/scripts/openslx-create_issue index befe268b..922830d2 100755 --- a/core/modules/slx-issue/data/opt/openslx/scripts/openslx-create_issue +++ b/core/modules/slx-issue/data/opt/openslx/scripts/openslx-create_issue @@ -17,8 +17,6 @@ # First script for initial ramfs for OpenSLX linux stateless clients ############################################################################# -export PATH="$PATH:/opt/openslx/bin:/opt/openslx/sbin" - # Set greeting and add information about the booted system mkdir -p /run/openslx diff --git a/core/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl b/core/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl index 2ad5aa13..979fde62 100755 --- a/core/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl +++ b/core/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl @@ -1,7 +1,5 @@ #!/bin/ash -export PATH="$PATH:/opt/openslx/sbin:/opt/openslx/bin" - # Check Reallocated_Sector_Ct and Spin_Retry_Count of local disk(s) . /opt/openslx/config diff --git a/core/modules/vbox-src/data/opt/openslx/scripts/systemd-vbox_env b/core/modules/vbox-src/data/opt/openslx/scripts/systemd-vbox_env index 49d5b6c7..8f99ceb6 100755 --- a/core/modules/vbox-src/data/opt/openslx/scripts/systemd-vbox_env +++ b/core/modules/vbox-src/data/opt/openslx/scripts/systemd-vbox_env @@ -16,8 +16,6 @@ # - This is the preparation script for the configuration of VirtualBox. ################################################################################ -export PATH="$PATH":/opt/openslx/bin:/opt/openslx/sbin - ## sanity checks VBOX_BASE_DIR="/usr/lib/virtualbox" VBOX_KMOD_DIR="/lib/modules/vbox" diff --git a/core/modules/vmware-common/data/opt/openslx/scripts/systemd-vmware_env b/core/modules/vmware-common/data/opt/openslx/scripts/systemd-vmware_env index 76d8696b..f5ca0b99 100755 --- a/core/modules/vmware-common/data/opt/openslx/scripts/systemd-vmware_env +++ b/core/modules/vmware-common/data/opt/openslx/scripts/systemd-vmware_env @@ -17,8 +17,6 @@ # VMware modules and services ################################################################################ -export PATH="$PATH:/opt/openslx/sbin:/opt/openslx/bin" - VMWARE_CONF_DIR=/opt/openslx/vmchooser/vmware VMCHOOSER_CONF_DIR=/opt/openslx/vmchooser/config diff --git a/core/modules/vmware-version-check/data/opt/openslx/bin/vmware-get-supported-version b/core/modules/vmware-version-check/data/opt/openslx/bin/vmware-get-supported-version index 0165191d..24382bca 100755 --- a/core/modules/vmware-version-check/data/opt/openslx/bin/vmware-get-supported-version +++ b/core/modules/vmware-version-check/data/opt/openslx/bin/vmware-get-supported-version @@ -3,8 +3,6 @@ # * Intel: check for "VMX Unrestricted Guest" CPU flag # * AMD: check if CPU family is Bulldozer or newer -export PATH=$PATH:/opt/openslx/sbin:/opt/openslx/bin - VIRTTYPE=$(grep -m1 '^flags\s*:' /proc/cpuinfo | grep -wo -e svm -e vmx) if [ -z "$VIRTTYPE" ]; then diff --git a/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-download_slx_addons b/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-download_slx_addons index 735c72c0..0fed8342 100755 --- a/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-download_slx_addons +++ b/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-download_slx_addons @@ -14,8 +14,6 @@ # ###################################################################################### -export PATH=$PATH:/opt/openslx/sbin:/opt/openslx/bin - # read global OpenSLX config . /opt/openslx/config || { echo "Could not source config!"; exit 23; } -- cgit v1.2.3-55-g7522