Commit 6ef8d70f authored by Yadd's avatar Yadd
Browse files

Manage fastcgi server startup, not finished

parent a648380a
# Number of process (default: 7) # Number of process (default: 7)
#NPROC = 7 #NPROC = 7
# Portal CGI path
#PORTAL_PATH = /var/lib/lemonldap-ng/portal
# Unix socket to listen to # Unix socket to listen to
#SOCKET = /run/llng-fastcgi.sock SOCKET=/var/run/llng-fastcgi-server/llng-fastcgi.sock
# Pid file # Pid file
#PID = /run/llng-fastcgi.pid PID=/var/run/llng-fastcgi.pid
# User and GROUP # User and GROUP
USER = www-data USER=www-data
GROUP = www-data GROUP=www-data
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
### END INIT INFO ### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/llgn-fastcgi-server DAEMON=/usr/sbin/llng-fastcgi-server
NAME=llng-fastcgi-server NAME=llng-fastcgi-server
DESC=llng-fastcgi-server DESC=llng-fastcgi-server
...@@ -29,9 +29,11 @@ test -x $DAEMON || exit 0 ...@@ -29,9 +29,11 @@ test -x $DAEMON || exit 0
# Try to extract llng-fastcgi-server pidfile # Try to extract llng-fastcgi-server pidfile
if [ -z "$PID" ]; then if [ -z "$PID" ]; then
PID=/run/llng-fastcgi-server.pid PID=/var/run/llng-fastcgi-server.pid
fi fi
DAEMON_OPTS="-p ${PID} -u ${USER} -g ${GROUP} -s ${SOCKET}"
start_server() { start_server() {
# Start the daemon/service # Start the daemon/service
# #
......
#!/bin/sh
set -e
USER="www-data"
GROUP="www-data"
CHOWN="/bin/chown"
ID="/usr/bin/id"
if ! test -d /var/run/llng-fastcgi-server; then
rm -rf /var/run/llng-fastcgi-server
mkdir /var/run/llng-fastcgi-server
fi
$CHOWN $USER:$GROUP /var/run/llng-fastcgi-server
[Unit] [Unit]
Description=FastCGI server for Lemonldap::NG websso system Description=FastCGI server for Lemonldap::NG websso system
After=network.target
[Service] [Service]
Type=forking Type=forking
PIDFile=/run/llng-fasctcgi.pid PIDFile=/run/llng-fasctcgi.pid
ExecStart=/usr/sbin/llng-fastcgi-server ExecStart=/usr/sbin/llng-fastcgi-server -u www-data -g www-data -s /var/run/llng-fastcgi-server/llng-fastcgi.sock -p /var/run/llng-fastcgi.pid
ExecStop=-/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/llng-fasctcgi.sock ExecStop=-/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/llng-fasctcgi.sock
TimeoutStop=2 TimeoutStop=2
KillMode=mixed KillMode=mixed
......
/etc/lemonldap-ng/manager-apache2.conf /etc/apache2/sites-available/manager-apache2.conf /etc/lemonldap-ng/manager-apache2.conf /etc/apache2/sites-available/manager-apache2.conf
/etc/lemonldap-ng/manager-nginx.conf /etc/nginx/sites-available/manager-nginx.conf /etc/lemonldap-ng/manager-nginx.conf /etc/nginx/sites-available/manager-nginx.conf
/usr/share/lemonldao-ng/manager/static /var/lib/lemonldap-ng/manager/static
...@@ -9,7 +9,7 @@ describe('Lemonldap::NG', function() { ...@@ -9,7 +9,7 @@ describe('Lemonldap::NG', function() {
it('should redirect to portal', function() { it('should redirect to portal', function() {
browser.ignoreSynchronization = true; browser.ignoreSynchronization = true;
browser.driver.get('http://test1.example.com:' + process.env.TESTWEBSERVERPORT + '/'); browser.driver.get('http://test1.example.com:' + process.env.TESTWEBSERVERPORT + '/');
expect(browser.getCurrentUrl()).toEqual('http://auth.example.com:' + process.env.TESTWEBSERVERPORT + '/?url=aHR0cDovL3Rlc3QxLmV4YW1wbGUuY29tOjE5ODc2Lw=='); expect(browser.getCurrentUrl()).toMatch(new RegExp('^http://auth.example.com(:' + process.env.TESTWEBSERVERPORT + ')?/\?url=aHR0cDovL3Rlc3QxLmV4YW1wbGUuY29tOjE5ODc2Lw=='));
}); });
it('should accept authentication as dwho/dwho', function() { it('should accept authentication as dwho/dwho', function() {
browser.driver.findElement(by.xpath("//input[@name='user']")).sendKeys('dwho'); browser.driver.findElement(by.xpath("//input[@name='user']")).sendKeys('dwho');
...@@ -17,7 +17,7 @@ describe('Lemonldap::NG', function() { ...@@ -17,7 +17,7 @@ describe('Lemonldap::NG', function() {
browser.driver.findElement(by.xpath("//button[@type='submit']")).click(); browser.driver.findElement(by.xpath("//button[@type='submit']")).click();
}); });
it('should redirect to test1.example.com', function() { it('should redirect to test1.example.com', function() {
expect(browser.getCurrentUrl()).toContain('http://test1.example.com:' + process.env.TESTWEBSERVERPORT + '/'); expect(browser.getCurrentUrl()).toMatch(new RegExp('^http://test1.example.com(:' + process.env.TESTWEBSERVERPORT + ')?'));
}); });
}); });
}); });
\ No newline at end of file
...@@ -44,7 +44,7 @@ my %builder = ( ...@@ -44,7 +44,7 @@ my %builder = (
return $_apps{$script}->(@_) if ( $_apps{$script} ); return $_apps{$script}->(@_) if ( $_apps{$script} );
$_apps{$script} = $_apps{$script} =
CGI::Emulate::PSGI->handler( CGI::Compile->compile($script) ); CGI::Emulate::PSGI->handler( CGI::Compile->compile($script) );
return $_app{$script}->(@_); return $_apps{$script}->(@_);
}; };
}, },
); );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment