File: start-client-under-systemd

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 (16 lines) | stat: -rwxr-xr-x 425 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

sc=client
service=pqconnect-$sc
fn=/etc/systemd/system/$service.service
awk -v sc=$sc -v pwd=`pwd` '{
  if ($1 == "WorkingDirectory=/root/pqconnect")
    $0 = "WorkingDirectory="pwd
  if ($1 == "ExecStart=scripts/run-"sc"-core")
    $0 = "ExecStart="pwd"/scripts/run-"sc"-core"
  print
}' < scripts/$service.service > ${fn}.tmp
chmod 644 ${fn}.tmp
mv ${fn}.tmp $fn
systemctl daemon-reload
systemctl start $service