diff --git a/pyduino.service b/pyduino.service deleted file mode 100644 index 130db44..0000000 --- a/pyduino.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Pyduino Daemon -After=network.target - -[Service] -WorkingDirectory=/home/pi/pyduino-parallel -ExecStart=/usr/bin/python3 /home/pi/pyduino-parallel/init_slave.py - -[Install] -WantedBy=multi-user.target \ No newline at end of file diff --git a/pyduino/slave.py b/pyduino/slave.py index a225dbf..d78d2ff 100644 --- a/pyduino/slave.py +++ b/pyduino/slave.py @@ -12,7 +12,7 @@ import socket from typing import Any, Optional, Dict -logging.basicConfig(filename='slave.log', filemode='w', level=logging.DEBUG) +logging.basicConfig(filename='/var/log/pyduino/slave.log', filemode='w', level=logging.DEBUG) STEP = 1/8.0 HEADER_DELAY = 5 diff --git a/reactors/playbook.yml b/reactors/playbook.yml index e0903c2..3ed75dd 100644 --- a/reactors/playbook.yml +++ b/reactors/playbook.yml @@ -80,6 +80,12 @@ - name: Deploying and Testing block: + - name: Create Log Folder + file: + path: /var/log/pyduino + state: directory + mode: 0777 + - name: Daemon Reload shell: systemctl daemon-reload diff --git a/reactors/pyduino.service b/reactors/pyduino.service index 4289dbb..d5c61a4 100644 --- a/reactors/pyduino.service +++ b/reactors/pyduino.service @@ -1,7 +1,7 @@ [Unit] Description=Daemon for pyduino server. -After=network-online.target -Wants=network-online.target +After=network.target +Wants=network.target [Service] Restart=on-failure