test and vagrant fixes
This commit is contained in:
parent
ae8e287dd9
commit
8d8a37d18e
4 changed files with 18 additions and 13 deletions
11
test/lib.sh
11
test/lib.sh
|
|
@ -43,16 +43,19 @@ fi
|
||||||
|
|
||||||
# Sanity nginx running on systemd platforms
|
# Sanity nginx running on systemd platforms
|
||||||
if systemctl > /dev/null 2>&1 ; then
|
if systemctl > /dev/null 2>&1 ; then
|
||||||
|
# even if systemd exists, nginx may be started in other ways
|
||||||
nginxactive=$(systemctl show nginx |grep ActiveState=active)
|
nginxactive=$(systemctl show nginx |grep ActiveState=active)
|
||||||
if [ "${WITH_RESTCONF}" = "fcgi" ]; then
|
if [ "${WITH_RESTCONF}" = "fcgi" ]; then
|
||||||
if [ -z "$nginxactive" ]; then
|
if [ -z "$nginxactive" -a ! -f /var/run/nginx.pid ]; then
|
||||||
echo -e "\e[31m\nwith-restconf=fcgi set but nginx not running, start with systemctl start nginx"
|
echo -e "\e[31m\nwith-restconf=fcgi set but nginx not running, start with:"
|
||||||
|
echo "systemctl start nginx"
|
||||||
echo -e "\e[0m"
|
echo -e "\e[0m"
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ -n "$nginxactive" ]; then
|
if [ -n "$nginxactive" -o -f /var/run/nginx.pid ]; then
|
||||||
echo -e "\e[31m\nwith-restconf=fcgi not set but nginx running, stop with systemctl stop nginx"
|
echo -e "\e[31m\nwith-restconf=fcgi not set but nginx running, stop with:"
|
||||||
|
echo "systemctl stop nginx"
|
||||||
echo -e "\e[0m"
|
echo -e "\e[0m"
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -68,15 +68,11 @@ if [ $BE -ne 0 ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
new "start backend -s init -f $cfg"
|
new "start backend -s init -f $cfg"
|
||||||
# start new backend
|
start_backend -s init -f $cfg
|
||||||
sudo $clixon_backend -s init -f $cfg -D $DBG
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
err
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
new "waiting"
|
new "waiting"
|
||||||
wait_backend
|
wait_backend
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $RC -ne 0 ]; then
|
if [ $RC -ne 0 ]; then
|
||||||
new "kill old restconf daemon"
|
new "kill old restconf daemon"
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@ http {
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
$scpcmd $dir/nginx.conf vagrant@127.0.0.1:
|
$scpcmd $dir/nginx.conf vagrant@127.0.0.1:
|
||||||
|
# This is problematic since it does not use systemctl (lib.sh check does)
|
||||||
cat<<'EOF' > $dir/startnginx.sh
|
cat<<'EOF' > $dir/startnginx.sh
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -x
|
set -x
|
||||||
|
|
@ -83,7 +84,9 @@ cat<<'EOF' > $dir/startnginx.sh
|
||||||
sudo sh -c ' echo 'nginx_enable="YES"' >> /etc/rc.conf'
|
sudo sh -c ' echo 'nginx_enable="YES"' >> /etc/rc.conf'
|
||||||
fi
|
fi
|
||||||
sudo /usr/local/etc/rc.d/nginx restart
|
sudo /usr/local/etc/rc.d/nginx restart
|
||||||
else
|
elif systemctl > /dev/null 2>&1 ; then
|
||||||
|
sudo systemctl start nginx
|
||||||
|
else
|
||||||
sudo pkill nginx
|
sudo pkill nginx
|
||||||
nginxbin=$(sudo which nginx)
|
nginxbin=$(sudo which nginx)
|
||||||
sudo $nginxbin -c $prefix/etc/nginx/nginx.conf
|
sudo $nginxbin -c $prefix/etc/nginx/nginx.conf
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ box=$1 # As defined in https://vagrantcloud.com/search
|
||||||
|
|
||||||
#with_restconf=fcgi
|
#with_restconf=fcgi
|
||||||
: ${with_restconf:=evhtp}
|
: ${with_restconf:=evhtp}
|
||||||
|
echo "with-restconf:${with_restconf}"
|
||||||
|
|
||||||
VCPUS=1
|
VCPUS=1
|
||||||
MEM=1024
|
MEM=1024
|
||||||
|
|
@ -135,6 +136,8 @@ case $release in
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
centos)
|
centos)
|
||||||
|
# enable ipv6
|
||||||
|
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0
|
||||||
# add restconf user: $wwwuser
|
# add restconf user: $wwwuser
|
||||||
if [ ! $($sshcmd id -u $wwwuser) ]; then
|
if [ ! $($sshcmd id -u $wwwuser) ]; then
|
||||||
$sshcmd sudo useradd -M $wwwuser
|
$sshcmd sudo useradd -M $wwwuser
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue