service file

This commit is contained in:
Wolfgang Hottgenroth 2018-06-28 22:25:00 +02:00
parent af10384cb7
commit 0729e559a3
Signed by: wn
GPG Key ID: B586EAFCDF2F65F4
2 changed files with 19 additions and 1 deletions

18
smartclient.service Normal file
View File

@ -0,0 +1,18 @@
[Unit]
Description=smartclient
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
GuessMainPID=yes
ExecStart=/usr/bin/npm run server
ExecStop=kill -SIGINT $mainpid
Restart=on-failure
WorkingDirectory=/opt/services/smartclient
[Install]
Alias=smartclient
WantedBy=multi-user.target

View File

@ -9,7 +9,7 @@ export class MqttclientService {
private callbacks : Map<string, callbackFunc> = new Map()
constructor() {
this.mqttClient = Mqtt.connect('ws://127.0.0.1:9001')
this.mqttClient = Mqtt.connect('ws://172.16.2.16:9001')
this.mqttClient.on('connect', () => {
console.log('MQTT connected')
this.callbacks.forEach((value: callbackFunc, key: string) => {