From 2cf98f7140b953e77a79a73777d98b9004c93e8a Mon Sep 17 00:00:00 2001 From: Tom Scanlan Date: Fri, 3 Mar 2017 10:45:43 -0500 Subject: [PATCH 1/3] add systemd units --- README.md | 7 +++++++ scripts/liotad.service | 11 +++++++++++ scripts/liotad.socket | 5 +++++ setup.py | 5 ++++- 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 scripts/liotad.service create mode 100644 scripts/liotad.socket diff --git a/README.md b/README.md index 6a1f3c68..bd47c0d4 100644 --- a/README.md +++ b/README.md @@ -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 + $ 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 '.' diff --git a/scripts/liotad.service b/scripts/liotad.service new file mode 100644 index 00000000..dcc587a9 --- /dev/null +++ b/scripts/liotad.service @@ -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 \ No newline at end of file diff --git a/scripts/liotad.socket b/scripts/liotad.socket new file mode 100644 index 00000000..643aa1fa --- /dev/null +++ b/scripts/liotad.socket @@ -0,0 +1,5 @@ +[Socket] +ListenFIFO=/var/tmp/liota/package_messenger.fifo + +[Install] +WantedBy=sockets.target \ No newline at end of file diff --git a/setup.py b/setup.py index 816159c8..ab15424c 100644 --- a/setup.py +++ b/setup.py @@ -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', ['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', From 450eecfd556587cd548d1cd1a952510bc5ec96c2 Mon Sep 17 00:00:00 2001 From: Tom Scanlan Date: Tue, 4 Apr 2017 10:01:14 -0400 Subject: [PATCH 2/3] add endlines, and deps to manifest --- MANIFEST.in | 2 ++ scripts/liotad.service | 3 ++- scripts/liotad.socket | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index b64c0d95..9bb28944 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,6 +3,8 @@ include requirements.txt include BSD_LICENSE.txt include BSD_NOTICE.txt include scripts/autostartliota +include scripts/liotad.service +include scripts/liotad.socket include config/liota.conf include config/logging.json include examples/simulated_edge_system_graphite.py diff --git a/scripts/liotad.service b/scripts/liotad.service index dcc587a9..210654d5 100644 --- a/scripts/liotad.service +++ b/scripts/liotad.service @@ -8,4 +8,5 @@ Description=Little Internet of Things Agent Daemon ExecStart=/etc/liota/packages/liotad.py [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target + diff --git a/scripts/liotad.socket b/scripts/liotad.socket index 643aa1fa..b1a2e8b4 100644 --- a/scripts/liotad.socket +++ b/scripts/liotad.socket @@ -2,4 +2,5 @@ ListenFIFO=/var/tmp/liota/package_messenger.fifo [Install] -WantedBy=sockets.target \ No newline at end of file +WantedBy=sockets.target + From 4d4743b34076a0ae1279f8d0938ea93522258056 Mon Sep 17 00:00:00 2001 From: Tom Scanlan Date: Tue, 20 Jun 2017 09:32:45 -0400 Subject: [PATCH 3/3] only need to enable liota.service --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index bd47c0d4..6f2ea48e 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,6 @@ To enable/disable the autostart service perform the following steps: ### On systemd based systems: ```bash - $ systemctl enable liota.socket $ systemctl enable liota.service ```