python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / nixos / modules / services / web-servers / jboss / builder.sh
blob0e5af324c13fe9cb6e05a01645cfeb64c119df04
1 set -e
3 source $stdenv/setup
5 mkdir -p $out/bin
7 cat > $out/bin/control <<EOF
8 mkdir -p $logDir
9 chown -R $user $logDir
10 export PATH=$PATH:$su/bin
12 start()
14 su $user -s /bin/sh -c "$jboss/bin/run.sh \
15 -Djboss.server.base.dir=$serverDir \
16 -Djboss.server.base.url=file://$serverDir \
17 -Djboss.server.temp.dir=$tempDir \
18 -Djboss.server.log.dir=$logDir \
19 -Djboss.server.lib.url=$libUrl \
20 -c default"
23 stop()
25 su $user -s /bin/sh -c "$jboss/bin/shutdown.sh -S"
28 if test "\$1" = start
29 then
30 trap stop 15
32 start
33 elif test "\$1" = stop
34 then
35 stop
36 elif test "\$1" = init
37 then
38 echo "Are you sure you want to create a new server instance (old server instance will be lost!)?"
39 read answer
41 if ! test \$answer = "yes"
42 then
43 exit 1
46 rm -rf $serverDir
47 mkdir -p $serverDir
48 cd $serverDir
49 cp -av $jboss/server/default .
50 sed -i -e "s|deploy/|$deployDir|" default/conf/jboss-service.xml
52 if ! test "$useJK" = ""
53 then
54 sed -i -e 's|<attribute name="UseJK">false</attribute>|<attribute name="UseJK">true</attribute>|' default/deploy/jboss-web.deployer/META-INF/jboss-service.xml
55 sed -i -e 's|<Engine name="jboss.web" defaultHost="localhost">|<Engine name="jboss.web" defaultHost="localhost" jvmRoute="node1">|' default/deploy/jboss-web.deployer/server.xml
58 # Make files accessible for the server user
60 chown -R $user $serverDir
61 for i in \`find $serverDir -type d\`
63 chmod 755 \$i
64 done
65 for i in \`find $serverDir -type f\`
67 chmod 644 \$i
68 done
70 EOF
72 chmod +x $out/bin/*