vagrant fcgi etc

This commit is contained in:
Olof Hagsand 2020-06-16 07:29:11 +00:00
parent 718f494549
commit c61c489e8e
3 changed files with 36 additions and 12 deletions

View file

@ -13,6 +13,8 @@ in a "site.mk" file. You can add such a file, eg:
VAGRANTS += generic/centos8
```
Beware memory exhaustion if you run too many simultaneously.
Logs appear in : <dir>/<hostname>.log.
You can also run a single vagrant test as follows:
@ -22,8 +24,8 @@ You can also run a single vagrant test as follows:
The current status is as follows
* freebsd/FreeBSD-12.1-STABLE
* generic/centos8 - some remaining nginx issue
* generic/opensuse42 - fastcgi is not installed
* generic/opensuse42
* generic/centos8 - one state test fails
For other vagrant boxes, see [search vagrant boxes](https://vagrantcloud.com/search)

View file

@ -84,7 +84,7 @@ cat<<'EOF' > $dir/startnginx.sh
sudo /usr/local/etc/rc.d/nginx restart
else
sudo pkill nginx
nginxbin=$(which nginx)
nginxbin=$(sudo which nginx)
sudo $nginxbin -c $prefix/etc/nginx/nginx.conf
fi
EOF

View file

@ -60,6 +60,7 @@ echo "$sshcmd"
system=$($sshcmd uname)
buildfcgi=false
case $system in
FreeBSD)
# packages for building
@ -73,26 +74,41 @@ case $system in
$sshcmd sudo pkg install -y fcgi-devkit nginx
;;
Linux)
# nginx restconf user: $wwwuser
if [ ! $($sshcmd id -u $wwwuser) ]; then
$sshcmd sudo useradd -M $wwwuser
fi
case $release in
centos) # centos 8
# packages for building
$sshcmd sudo yum install -y git
# cligen
$sshcmd sudo yum install -y bison flex
# clixon
if [ ! $($sshcmd id -u $wwwuser) ]; then
$sshcmd sudo useradd -M $wwwuser
fi
# clixon
$sshcmd sudo yum install -y fcgi-devel nginx
# clixon utilities
$sshcmd sudo yum install -y libcurl-devel
;;
opensuse) # opensuse42
# packages for building
$sshcmd sudo zypper install -y git
# cligen
$sshcmd sudo zypper install -y bison flex
# clixon
$sshcmd sudo zypper install -y nginx
# XXX: no fastcgi package?
buildfcgi=true # build fcgi from source
# clixon utilities
$sshcmd sudo zypper install -y libcurl-devel
# packages for building fcgi
$sshcmd sudo zypper install -y autoconf automake libtool
;;
*)
*) # ubuntu/apt based
# cligen
$sshcmd sudo apt install -y bison flex
# clixon
$sshcmd sudo apt install -y libfcgi-dev nginx
# clixon utilities
$sshcmd sudo apt install -y libcurl4-openssl-dev
;;
esac
;;
@ -101,6 +117,12 @@ case $system in
;;
esac
# Some platforms dont have fcgi, build the source (should all?)
if $buildfcgi; then
$sshcmd "test -d fcgi2 || git clone https://github.com/FastCGI-Archives/fcgi2"
$sshcmd "(cd fcgi2; ./autogen.sh; ./configure; make; sudo make install)"
fi
# Hide all complex nginx config in sub-script
. ./nginx.sh $dir $idfile $port $wwwuser
@ -121,11 +143,11 @@ wwwuser=$2
if [ ! $(id -u clicon) ]; then
if [ $release = "freebsd" ]; then
sudo pw useradd clicon -d /nonexistent -s /usr/sbin/nologin;
sudo pw group mod clicon -m vagrant;
sudo pw group mod clicon -m vagrant; # start clixon tests as this users
sudo pw group mod clicon -m $wwwuser;
else
sudo useradd clicon;
sudo usermod -a -G clicon vagrant;
sudo useradd -M -U clicon;
sudo usermod -a -G clicon vagrant; # start clixon tests as this users
sudo usermod -a -G clicon $wwwuser;
fi
fi