From ca49e89aa92d97a44cabbe972e90652d221af637 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 26 Sep 2017 18:03:33 +0200 Subject: [PATCH] Update according to new SATS daemon management (multi service) --- clone/clone | 5 +++++ clone/clone.conf | 2 +- clone/utility/sats-feature@.service | 13 +++++++++++++ clone/utility/sats-loop | 2 +- clone/utility/sats-loop.service | 8 ++++---- 5 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 clone/utility/sats-feature@.service diff --git a/clone/clone b/clone/clone index adbc301..a042f32 100755 --- a/clone/clone +++ b/clone/clone @@ -368,6 +368,11 @@ step7(){ echo " - /lib/systemd/system"; sudo cp ./utility/firewall@.service /mnt/lib/systemd/system/firewall@.service; + # (12) Create sats-feature@ service # + echo " (.) Create sats-feature@ service"; + echo " - /lib/systemd/system"; + sudo cp ./utility/sats-feature@.service /mnt/lib/systemd/system/sats-feature@.service; + # (3) Install services #--------------------------------------------------------# diff --git a/clone/clone.conf b/clone/clone.conf index 7c549ff..96b5d4d 100755 --- a/clone/clone.conf +++ b/clone/clone.conf @@ -13,7 +13,7 @@ export SERVER_HOSTNAME="xdrm.io"; export SERVER_USERNAME="satsd"; # DEFAULT SATS SETTINGS -export MACHINE_ID="126"; +export MACHINE_ID="127"; export MACHINE_BRANCH="1.0"; export MACHINE_STATE="000"; export API_URL="https://logauth.xdrm.io/api/machineDefault"; diff --git a/clone/utility/sats-feature@.service b/clone/utility/sats-feature@.service new file mode 100644 index 0000000..5425fee --- /dev/null +++ b/clone/utility/sats-feature@.service @@ -0,0 +1,13 @@ +[Unit] +Description=[::SATS::] Feature %i +Requires=sats-sync.service +After=sats-sync.service + +[Service] +Type=simple +User=sats +Group=sats +ExecStart=/bin/bash /home/sats/satsd/source/feature/%i/main + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/clone/utility/sats-loop b/clone/utility/sats-loop index 37f61bf..5f6738c 100644 --- a/clone/utility/sats-loop +++ b/clone/utility/sats-loop @@ -6,4 +6,4 @@ if [ ! -e /target/sync ]; then fi; # [1] Propagate script to DAEMON -/bin/bash /home/sats/satsd/source/daemon 2>> /home/sats/satsd/log/daemon.log >> /home/sats/satsd/log/daemon.log; \ No newline at end of file +/bin/bash /home/sats/satsd/source/daemon | sudo -u sats tee -a /home/sats/satsd/log/daemon.log; \ No newline at end of file diff --git a/clone/utility/sats-loop.service b/clone/utility/sats-loop.service index abf935c..df97ae1 100644 --- a/clone/utility/sats-loop.service +++ b/clone/utility/sats-loop.service @@ -4,11 +4,11 @@ Requires=sats-sync.service After=sats-sync.service [Service] -Type=simple -User=sats -Group=sats +Type=oneshot +RemainAfterExit=yes +User=pi +Group=pi ExecStart=/bin/sh /service/sats-loop -Restart=always [Install] WantedBy=multi-user.target \ No newline at end of file