File: start-server-under-daemontools

package info (click to toggle)
pqconnect 1.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,012 kB
  • sloc: python: 7,256; sh: 632; makefile: 75
file content (32 lines) | stat: -rwxr-xr-x 721 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh

if [ -e /service/pqconnect-server ]
then
  : # presumably everything ok already
else
  
  scripts/start-daemontools

  useradd -M -d /etc/pqconnect -s /bin/false pqconnectlog 2>/dev/null
  
  mkdir -p services/server/log/main
  chmod 700 services

  (
    /bin/echo '#!/bin/sh'
    /bin/echo 'cd '`pwd`
    /bin/echo 'scripts/run-server-core'
    /bin/echo 'sleep 1'
  ) > services/server/run
  chmod 755 services/server/run
  
  (
    /bin/echo '#!/bin/sh'
    /bin/echo 'exec setuidgid pqconnectlog multilog t n10 s1000000 ./main'
  ) > services/server/log/run
  chmod 755 services/server/log/run
  chown pqconnectlog services/server/log/main
  
  ln -s `pwd`/services/server /service/pqconnect-server
  
fi