From ccaa3a6cf5864e5e759c1d8b417c29d1d8101141 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sat, 28 Jan 2017 12:21:45 +0100 Subject: [PATCH] Update as a oneshot service --- clone/clone | 7 ++++--- clone/utility/interfaces | 2 +- clone/utility/sats-update.service | 9 +++++++++ 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 clone/utility/sats-update.service diff --git a/clone/clone b/clone/clone index 3082af9..3776e89 100755 --- a/clone/clone +++ b/clone/clone @@ -253,9 +253,10 @@ step7(){ sudo chown 1000:1000 /mnt/home/pi/sats-boot; sudo chmod 770 /mnt/home/pi/sats-boot; - #echo " (.) Emulate \`systemctl enable sats-boot\`"; - #sudo ln -fs /lib/systemd/system/sats-boot.service /mnt/etc/systemd/system/multi-user.target.wants/sats-boot.service; - + # (3) Install sats-boot service # + echo " (.) Create sats-update service"; + echo " - /lib/systemd/system"; + sudo cp ./utility/sats-update.service /mnt/lib/systemd/system/sats-update.service; echo "<<< done"; diff --git a/clone/utility/interfaces b/clone/utility/interfaces index 269958b..01dc80d 100644 --- a/clone/utility/interfaces +++ b/clone/utility/interfaces @@ -17,4 +17,4 @@ iface eth0 inet manual allow-hotplug wlan0 iface wlan0 inet manual wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf - up /bin/sh /home/sats/satsd/sats-loop update; + up /bin/sh systemctl start sats-update.service diff --git a/clone/utility/sats-update.service b/clone/utility/sats-update.service new file mode 100644 index 0000000..7d0d386 --- /dev/null +++ b/clone/utility/sats-update.service @@ -0,0 +1,9 @@ +[Unit] +Description=SATS Update Process +Requires=network-online.target network.target sats-loop.service sats-boot.service + +[Service] +Type=oneshot +User=sats +Group=sats +ExecStart=/bin/sh /home/sats/satsd/sats-loop update