summarylogtreecommitdiffstats
path: root/ibcontroller@.service
blob: 9291ed04f0b02a86725d743aef7feed851496644 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[Unit]
Description=IBController
After=network.target

[Service]
Type=simple
TimeoutSec=0
User=root
Group=root

KillMode=control-group

ExecStartPre=/bin/sh -c "mkdir -p /var/run/xvfb"
ExecStartPre=/bin/sh -c "mkdir -p $(grep -e '^IbDir=' /etc/ibcontroller/%I.ini | tr -cd '\40-\176' | cut -d '=' -f 2)"
ExecStartPre=/bin/sh -c "echo -e '[IBGateway]\nApiOnly=true" > $(grep -e '^IbDir=' /etc/ibcontroller/%I.ini | tr -cd '\40-\176' | cut -d '=' -f 2)/tws.ini"
ExecStart=/usr/sbin/xvfb-run --auto-servernum -f /var/run/xvfb/%I /usr/share/ib-tws/jre/bin/java -cp /usr/share/ib-tws/jars/*:/usr/share/java/ibcontroller/ibcontroller.jar -Xmx512M ibcontroller.IBGatewayController /etc/ibcontroller/%I.ini

[Install]
WantedBy=multi-user.target