Our Server RPMs have a dependency on "which" if they're build with wsrep support:
cmake/cpack_rpm.cmake:170:
IF(WITH_WSREP)
SETA(CPACK_RPM_server_PACKAGE_REQUIRES
"galera" "rsync" "lsof" "grep" "gawk" "iproute"
"coreutils" "findutils" "tar" "which")
ENDIF()
This breaks installations on SLES11, because SLES11 does not have any package that provides the "which" capability. (The which(1) tool itself is included in some other package.) It's also worth noting that many Docker containers and other very lightweight environments may not include which(1), either.
This is because which(1) is used in a large number of galera shell scripts (as well as other shell scripts):
server $ grep -r -c which scripts/
scripts/.wsrep_sst_mariabackup.sh.swp:2
scripts/CMakeLists.txt:0
scripts/comp_sql.c:1
scripts/convert-debug-for-diff.sh:0
scripts/dheadgen.pl:0
scripts/fill_help_tables.sql:90
scripts/galera_new_cluster.sh:0
scripts/galera_recovery.sh:0
scripts/make_win_bin_dist:0
scripts/maria_add_gis_sp.sql.in:0
scripts/mariadb-service-convert:0
scripts/msql2mysql.sh:0
scripts/mysql_config.pl.in:3
scripts/mysql_config.sh:3
scripts/mysql_convert_table_format.sh:0
scripts/mysql_find_rows.sh:0
scripts/mysql_fix_extensions.sh:0
scripts/mysql_install_db.pl.in:6
scripts/mysql_install_db.sh:6
scripts/mysql_performance_tables.sql:0
scripts/mysql_secure_installation.pl.in:0
scripts/mysql_secure_installation.sh:2
scripts/mysql_setpermission.sh:11
scripts/mysql_system_tables.sql:2
scripts/mysql_system_tables_data.sql:1
scripts/mysql_system_tables_fix.sql:0
scripts/mysql_test_data_timezone.sql:0
scripts/mysql_to_mariadb.sql:0
scripts/mysqlaccess.conf:0
scripts/mysqlaccess.sh:31
scripts/mysqld_multi.sh:10
scripts/mysqld_safe.sh:12
scripts/mysqldumpslow.sh:0
scripts/mysqlhotcopy.sh:7
scripts/mytop.sh:17
scripts/wsrep_sst_common.sh:4
scripts/wsrep_sst_mariabackup.sh:8
scripts/wsrep_sst_mysqldump.sh:0
scripts/wsrep_sst_rsync.sh:3
scripts/wsrep_sst_xtrabackup-v2.sh:8
scripts/wsrep_sst_xtrabackup.sh:5
For example:
scripts/wsrep_sst_xtrabackup.sh: if [[ ! -x `which nc` ]];then
scripts/wsrep_sst_xtrabackup.sh: if [[ ! -x `which socat` ]];then
scripts/wsrep_sst_xtrabackup.sh:if [[ ! -x `which innobackupex` ]];then
scripts/wsrep_sst_xtrabackup.sh: if [[ ! -x `which qpress` ]];then
This is a very poor way to perform this kind of check. It unnecessarily requires an external tool, which makes it fragile and error-prone. The POSIX way to perform this same check would be to do, for example,
if ! command -v nc >/dev/null;then
.
This change should be made across all shell scripts shipped by MariaDB Server, and the dependency on which(1) should be removed.
is caused by
MDEV-10954
MariaDB Galera: wsrep_sst_common: line 120: which: command not found
Closed
Elena Stepanova
made changes -
2017-09-28 20:22
Field
Original Value
New Value
Component/s
Packaging
[ 10700
]
Component/s
wsrep
[ 11500
]
Fix Version/s
10.1
[ 16100
]
Fix Version/s
10.2
[ 14601
]
Assignee
Andrii Nikitin
[ anikitin
]
Sergei Golubchik
made changes -
2017-09-29 06:07
Priority
Major
[ 3
]
Blocker
[ 1
]
Sergei Golubchik
made changes -
2017-10-04 13:25
Assignee
Andrii Nikitin
[ anikitin
]
Sergey Vojtovich
[ svoj
]
Sergei Golubchik
made changes -
2017-10-04 13:55
Assignee
Sergey Vojtovich
[ svoj
]
Sergei Golubchik
[ serg
]
Sergei Golubchik
made changes -
2017-10-04 17:52
Status
Open
[ 1
]
In Progress
[ 3
]
Sergei Golubchik
made changes -
2017-10-04 19:08
Status
In Progress
[ 3
]
Stalled
[ 10000
]
Daniel Bartholomew
made changes -
2017-10-06 14:19
Link
This issue blocks TODO-978
[ TODO-978
]
Sergei Golubchik
made changes -
2017-10-10 15:21
Fix Version/s
10.1.29
[ 22636
]
Fix Version/s
10.2.10
[ 22615
]
Fix Version/s
10.2
[ 14601
]
Fix Version/s
10.1
[ 16100
]
Resolution
Fixed
[ 1
]
Status
Stalled
[ 10000
]
Closed
[ 6
]
Sergei Golubchik
made changes -
2017-10-10 15:21
Component/s
Platform openSUSE
[ 10901
]
Sergei Golubchik
made changes -
2021-12-06 21:45
Workflow
MariaDB v3
[ 82844
]
MariaDB v4
[ 152912
]
{"report":{"fcp":1303.7000000476837,"ttfb":472.3000000715256,"pageVisibility":"visible","entityId":63405,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"4a7d0d36-4d47-4115-9fef-bfb24c826bb0","navigationType":0,"readyForUser":1466.8000000715256,"redirectCount":0,"resourceLoadedEnd":1468.4000000953674,"resourceLoadedStart":478,"resourceTiming":[{"duration":353.40000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":478,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":478,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":831.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":353.2999999523163,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":478.3000000715256,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":478.3000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":831.6000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":363,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":478.5,"connectEnd":478.5,"connectStart":478.5,"domainLookupEnd":478.5,"domainLookupStart":478.5,"fetchStart":478.5,"redirectEnd":0,"redirectStart":0,"requestStart":478.5,"responseEnd":841.5,"responseStart":841.4000000953674,"secureConnectionStart":478.5},{"duration":417.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":478.60000002384186,"connectEnd":478.60000002384186,"connectStart":478.60000002384186,"domainLookupEnd":478.60000002384186,"domainLookupStart":478.60000002384186,"fetchStart":478.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":478.60000002384186,"responseEnd":895.8000000715256,"responseStart":895.8000000715256,"secureConnectionStart":478.60000002384186},{"duration":421.1999999284744,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":478.90000009536743,"connectEnd":478.90000009536743,"connectStart":478.90000009536743,"domainLookupEnd":478.90000009536743,"domainLookupStart":478.90000009536743,"fetchStart":478.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":478.90000009536743,"responseEnd":900.1000000238419,"responseStart":900.1000000238419,"secureConnectionStart":478.90000009536743},{"duration":421.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":479.10000002384186,"connectEnd":479.10000002384186,"connectStart":479.10000002384186,"domainLookupEnd":479.10000002384186,"domainLookupStart":479.10000002384186,"fetchStart":479.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":479.10000002384186,"responseEnd":900.8000000715256,"responseStart":900.8000000715256,"secureConnectionStart":479.10000002384186},{"duration":422.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":479.2000000476837,"connectEnd":479.2000000476837,"connectStart":479.2000000476837,"domainLookupEnd":479.2000000476837,"domainLookupStart":479.2000000476837,"fetchStart":479.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":479.2000000476837,"responseEnd":901.5,"responseStart":901.4000000953674,"secureConnectionStart":479.2000000476837},{"duration":509.6999999284744,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":479.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":479.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":989.1000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":422.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":479.60000002384186,"connectEnd":479.60000002384186,"connectStart":479.60000002384186,"domainLookupEnd":479.60000002384186,"domainLookupStart":479.60000002384186,"fetchStart":479.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":479.60000002384186,"responseEnd":902.1000000238419,"responseStart":902.1000000238419,"secureConnectionStart":479.60000002384186},{"duration":509.10000002384186,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":480.10000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":480.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":989.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":422.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":480.40000009536743,"connectEnd":480.40000009536743,"connectStart":480.40000009536743,"domainLookupEnd":480.40000009536743,"domainLookupStart":480.40000009536743,"fetchStart":480.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":480.40000009536743,"responseEnd":903,"responseStart":903,"secureConnectionStart":480.40000009536743},{"duration":787.3000000715256,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":486,"connectEnd":486,"connectStart":486,"domainLookupEnd":486,"domainLookupStart":486,"fetchStart":486,"redirectEnd":0,"redirectStart":0,"requestStart":486,"responseEnd":1273.3000000715256,"responseStart":1273.3000000715256,"secureConnectionStart":486},{"duration":836.4000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":488.5,"connectEnd":488.5,"connectStart":488.5,"domainLookupEnd":488.5,"domainLookupStart":488.5,"fetchStart":488.5,"redirectEnd":0,"redirectStart":0,"requestStart":488.5,"responseEnd":1324.9000000953674,"responseStart":1324.9000000953674,"secureConnectionStart":488.5},{"duration":272.60000002384186,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1001.1000000238419,"connectEnd":1001.1000000238419,"connectStart":1001.1000000238419,"domainLookupEnd":1001.1000000238419,"domainLookupStart":1001.1000000238419,"fetchStart":1001.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":1001.1000000238419,"responseEnd":1273.7000000476837,"responseStart":1273.7000000476837,"secureConnectionStart":1001.1000000238419},{"duration":215.10000002384186,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1295.3000000715256,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1295.3000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1510.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":150.80000007152557,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":1317.6000000238419,"connectEnd":1317.6000000238419,"connectStart":1317.6000000238419,"domainLookupEnd":1317.6000000238419,"domainLookupStart":1317.6000000238419,"fetchStart":1317.6000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":1317.6000000238419,"responseEnd":1468.4000000953674,"responseStart":1468.4000000953674,"secureConnectionStart":1317.6000000238419}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":261,"responseStart":472,"responseEnd":488,"domLoading":476,"domInteractive":1546,"domContentLoadedEventStart":1546,"domContentLoadedEventEnd":1605,"domComplete":1992,"loadEventStart":1992,"loadEventEnd":1992,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1516},{"name":"bigPipe.sidebar-id.end","time":1516.8000000715256},{"name":"bigPipe.activity-panel-pipe-id.start","time":1517},{"name":"bigPipe.activity-panel-pipe-id.end","time":1520.6000000238419},{"name":"activityTabFullyLoaded","time":1623.6000000238419}],"measures":[],"correlationId":"9365c0c237de9","effectiveType":"4g","downlink":9.6,"rtt":0,"serverDuration":138,"dbReadsTimeInMs":24,"dbConnsTimeInMs":33,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}