Page 1 of 1

Can't start/stop using sudo service commands

Posted: Wednesday 04 November 2020 17:03
by denisdmenace
Hello to the forum,
Just joined today!
I'm migrating from openHAB (too much tedious Java syntax to config and do simple stuff and generally fragmented). Prefer the more GUI friendly look of Domoticz. Relative newbie with configs, syntaxes, command line stuff, githubs etc over last few months. However, have managed to set up VirtualBox on my MacMini, install Ubuntu, drill into files here and there and set static IP, download and compile Domoticz source code with all the associated preparatory complexity, including zwave, and get it running... :) .. no mean feat for a GUI driven Mac head.. :shock:
Anyway my SYSTEM is: MacMini, MacOS 10.14.6, 2.5 GHz processor, 16 GB RAM, VirtualBox 6.1 and Ubuntu VM ver 20.04.1 LTS installed. Domoticz ver 2020.2 (build 12574) running in Ubuntu. I'm using an Aeotec Wave USB stick gen5. I have all my hardware/devices already included on the stick by the way since I'm coming from openHAB.
I can start Domoticz by typing in the terminal "cd domoticz" and then "sudo ./domoticz"
It launches fine with many lines of status code on the screen. I have only done a few settings until I'm sure all will be stable and ok. No hardware included yet.
However, I can't seem to stop it by "sudo service domoticz stop" nor by "sudo service Domoticz.sh stop". I'm very confused by this. Also, "sudo service status" says it's stopped even though it's still running! What is the difference between the 'manual' start going into the domoticz folder then typing "./domoticz" instead of using these 'service' call? I have only vague ideas about services and daemons so I'lll need your patience.
Apologies for the seemingly trivial question but I'm getting bogged down at the last hurdle and couldn't find an answer in the forums. I'm looking forward to getting properly started and embrace Domoticz.
Hopefully someone can help me and please go easy on the tekkie speak since I'm still a relative newbie. Many thanks in advance :)

Re: Can't start/stop using sudo service commands

Posted: Wednesday 04 November 2020 18:54
by EddyG
When you manually start Domoticz in a terminal session, it will close as soon as you close the session.
A service will still be running.
Start and stop Domoticz with

Code: Select all

sudo systemctl start domoticz.service
sudo systemctl stop domoticz.service
OR

Code: Select all

sudo /etc/init.d/domoticz.sh start
sudo /etc/init.d/domoticz.sh stop

Re: Can't start/stop using sudo service commands

Posted: Sunday 08 November 2020 18:10
by denisdmenace
Hello Eddy, thanks for your reply. Yes the second solution line worked! I didn't realise that the .sh script was squirrelled away like that.. :roll: thanks again.