我的 Linux(SLES-8)服务器目前有 glibc-2.2.5-235,但我有一个程序无法在此版本上运行,需要 glibc-2.3.3。是否可以在同一个服务器上安装多个 glibc?...
我的 linux(SLES-8)服务器目前有 glibc-2.2.5-235,但我有一个程序无法在此版本上运行,需要 glibc-2.3.3。
是否可以在同一台主机上安装多个 glibc?
这是我在旧 glibc 上运行程序时遇到的错误:
./myapp: /lib/i686/libc.so.6: version `GLIBC_2.3' not found (required by ./myapp)
./myapp: /lib/i686/libpthread.so.0: version `GLIBC_2.3.2' not found (required by ./myapp)
./myapp: /lib/i686/libc.so.6: version `GLIBC_2.3' not found (required by ./libxerces-c.so.27)
./myapp: /lib/ld-linux.so.2: version `GLIBC_2.3' not found (required by ./libstdc++.so.6)
./myapp: /lib/i686/libc.so.6: version `GLIBC_2.3' not found (required by ./libstdc++.so.6)
因此我创建了一个名为 newglibc 的新目录并将以下文件复制到其中:
libpthread.so.0
libm.so.6
libc.so.6
ld-2.3.3.so
ld-linux.so.2 -> ld-2.3.3.so
和
export LD_LIBRARY_PATH=newglibc:$LD_LIBRARY_PATH
但是我收到一个错误:
./myapp: /lib/ld-linux.so.2: version `GLIBC_PRIVATE' not found (required by ./newglibc/libpthread.so.0)
./myapp: /lib/ld-linux.so.2: version `GLIBC_2.3' not found (required by libstdc++.so.6)
./myapp: /lib/ld-linux.so.2: version `GLIBC_PRIVATE' not found (required by ./newglibc/libm.so.6)
./myapp: /lib/ld-linux.so.2: version `GLIBC_2.3' not found (required by ./newglibc/libc.so.6)
./myapp: /lib/ld-linux.so.2: version `GLIBC_PRIVATE' not found (required by ./newglibc/libc.so.6)
因此看起来他们仍然链接到我放置 /lib
他们的地方,而不是从我放置他们的地方继续。
我有以下 .cnf[policy_match]countryName = matchstateOrProvinceName = matchorganizationName = matchorganizationalUnitName =optionalcommonName = supplyemailAddress...
我有以下.cnf
[ policy_match ]
countryName = match
stateOrProvinceName = match
organizationName = match
organizationalUnitName = optional
commonName = supplied
emailAddress =
[ policy_anything ]
countryName = optional
stateOrProvinceName = optional
localityName = optional
organizationName = optional
organizationalUnitName = optional
commonName = supplied
emailAddress =
[client]
countryName =
stateOrProvinceName =
localityName =
organizationName =
emailAddress =
commonName =
这是 csv 标题:
userPrincipalName,displayName,surname,mail,givenName
我只需要使用包含 UPN 和 displayName 的 .csv 文件来更新 [client] 部分下的 emailAddress 和 commonName 值。
我还需要从 csv 中循环取值并通过更新一个来让我有机会运行另一个脚本来生成证书。
我对 bash 脚本完全不熟悉,只是在构建项目时开始学习。
例子:
foreach $upn in $csv {
update [client].emailAddress = $upn
run_cert_creation_script_here
}
我想:
sed -i "s/emailAddress.*/emailAddress=$upn/" "$CONFIG_FILE"
但这将更新 cnf 中所有匹配的字段。
更新:
我可以写这个:
#!/bin/bash
# Define the CSV and CNF file paths
CSV_FILE="exportUsers_2024-8-8.csv"
CNF_FILE="clientX.cnf"
# Read the CSV file line by line
while IFS=',' read -r userPrincipalName displayName _ _
do
echo "UPN: $userPrincipalName"
echo "Name: $displayName"
sudo sed -i "52 s/emailAddress.*/emailAddress = $userPrincipalName/" "$CNF_FILE"
sudo sed -i "53 s/commonName.*/commonName = ""\"$displayName\"/" "$CNF_FILE"
done < "$CSV_FILE"