Skip to content
This repository has been archived by the owner on Mar 15, 2021. It is now read-only.

add systemd units #94

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ To enable/disable the autostart service perform the following steps:
$ chkconfig --del autostartliota
```

### On systemd based systems:

```bash
$ systemctl enable liota.socket
Copy link
Contributor

@KohliDev KohliDev Apr 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be liotad.service & liotad.socket?

Also, I cloned your branch and will try out this commands on Fedora VM. What is the prime job of these commands? Also, I think if liota daemon gets started then we won`t require liotad.socket to be started explicitly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tompscanlan

It'll be very helpful if you can provide some information about this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct. Fixing that.

$ systemctl enable liota.service
```

## Liota.conf
liota.conf provides path to find out various configuration & log files. When initializing, liota does a multi-step search for the configuration file:
* Looks in the current working directory '.'
Expand Down
11 changes: 11 additions & 0 deletions scripts/liotad.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#
# systemd unit configuration
#
[Unit]
Description=Little Internet of Things Agent Daemon

[Service]
ExecStart=/etc/liota/packages/liotad.py

[Install]
WantedBy=multi-user.target
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I`m not sure but I think better to add a new line in both the files liotad.service & liotad.socket

http://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline

5 changes: 5 additions & 0 deletions scripts/liotad.socket
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Socket]
ListenFIFO=/var/tmp/liota/package_messenger.fifo

[Install]
WantedBy=sockets.target
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,11 @@
'packages/examples/iotcc_thermistor_simulated.py']),
(os.path.abspath(os.sep) + '/../etc/liota/packages/edge_systems/dell5k',
['packages/edge_systems/dell5k/edge_system.py']),
(os.path.abspath(os.sep) + '/../etc/liota/scripts',
(os.path.abspath(os.sep) + '/../etc/liota/scripts',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the new dependencies in Manifest.in file

['scripts/autostartliota']),
(os.path.abspath(os.sep) + '/../lib/systemd/system',
['scripts/liotad.socket',
'scripts/liotad.service']),
(os.path.abspath(os.sep) + '/../etc/liota/conf',
['config/liota.conf', 'config/logging.json']),
(os.path.abspath(os.sep) + '/../etc/liota',
Expand Down