mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-03 13:37:04 +00:00
We choosed #!/bin/sh for shebang when we started to implement installer scripts, not bash.
After we started to work on Ubuntu, we found that we mistakenly used bash syntax on AMI script, it caused error since /bin/sh is dash on Ubuntu.
So we changed shebang to /bin/bash for the script, from that time we have both sh scripts and bash scripts.
(2f39e2e269)
If we use bash syntax on sh scripts, it won't work on Ubuntu but works on Fedora/CentOS, could be very easy to confusing.
So switch all scripts to #!/bin/bash. It will much safer.
Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1460594643-30666-1-git-send-email-syuu@scylladb.com>
30 lines
870 B
Bash
Executable File
30 lines
870 B
Bash
Executable File
#!/bin/bash -e
|
|
|
|
if [ "$AMI" = "yes" ] && [ -f /etc/scylla/ami_disabled ]; then
|
|
rm /etc/scylla/ami_disabled
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$NETWORK_MODE" = "virtio" ]; then
|
|
ip tuntap del mode tap dev $TAP
|
|
ip tuntap add mode tap dev $TAP user $USER one_queue vnet_hdr
|
|
ip link set dev $TAP up
|
|
ip link set dev $TAP master $BRIDGE
|
|
chown $USER.$GROUP /dev/vhost-net
|
|
elif [ "$NETWORK_MODE" = "dpdk" ]; then
|
|
modprobe uio
|
|
modprobe uio_pci_generic
|
|
/usr/lib/scylla/dpdk_nic_bind.py --force --bind=uio_pci_generic $ETHPCIID
|
|
for n in /sys/devices/system/node/node?; do
|
|
echo $NR_HUGEPAGES > $n/hugepages/hugepages-2048kB/nr_hugepages
|
|
done
|
|
else # NETWORK_MODE = posix
|
|
if [ "$SET_NIC" = "yes" ]; then
|
|
/usr/lib/scylla/posix_net_conf.sh $IFNAME
|
|
fi
|
|
fi
|
|
. /etc/os-release
|
|
if [ "$ID" = "ubuntu" ]; then
|
|
hugeadm --create-mounts
|
|
fi
|