From 622c97a1065b5aad239b18f34367ea4f9d8ed480 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 24 Jan 2017 19:10:44 +0100 Subject: [PATCH] Managing service #2 --- clone/.clone.swp | Bin 0 -> 20480 bytes clone/clone | 20 ++++++++++++++++---- clone/utility/booting_script | 2 +- clone/utility/service_unit | 6 ++++-- 4 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 clone/.clone.swp diff --git a/clone/.clone.swp b/clone/.clone.swp new file mode 100644 index 0000000000000000000000000000000000000000..e539ed3c22d14a869ced97eb4b15fb2860b5fe92 GIT binary patch literal 20480 zcmeI3Yiu0Xb%4iKoK&f0r%iqoeL$B>LL_Z3m!v3C50lZ0vQ&t%KuS~`txOGfX2~&k zXVx>bqG(x8ff#60AW55NQ?zM}x=orkZJo4e;>1n*qmf&?vEAg4i=ys3PFtjDi@s2! z?RW0n*`0k*l1&2zie2F2Vs`G_$GPX8d(OGT<TP=SNy9EF5*CH6AIfc=3qb8S#QbC0McR z@oGNW@JoeKCGg$k?=|b~-Rw!ACxPoopdOd=dv{p7$HzvcWPh$tz4iOgT<4+Q?VbdB z66i^wCxM;>dJ^bKpeKQz1bPzq|0IF9w#|As1G?D^>b>Th@Lzw@?>Ct14fFkz<~zN= z&0L=~-`mWM^uGDI_tld?PXav&^d!)eKu-ca3G^h;lR!@bJqh$A(33z<0{;gRupP^i z1Hqak0670o9)~%23w+~yEbEWqNq7XVz#2RN%Wwgf z;C?s{MK}is;TCx1O_ueC@CWdDSb_og_8TqhWw;9WK@R%hcDN1R2ycLGa5LNl7W~gG zmi6E8GJF;uhl@~$vv51y2CtB;`7ihv_$T--{3Cn^UW8A;M<9X_9)v|0gSWxcBy+C9 z&w>lb;bwRY9eF>z4@6%Ac(tGHZfP}8IVGPNr3!9bD%9*KT6b~>ENgpMRcfRVS8Ii6 z)pmmQ1J?GE9k=|XA2oj-R#DvvRP4H{Q1xS7Tk@dV{8pZZ3yyoS;MXgaMg#TOt9bE- zX?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t)}QEyNFJHG8sAXaQ1ZZaF*?8HI#(6DJPk`&Agko zvL*|r?Lf^dj3l=^tV!!rsVm-AtW%wX+J=6o!ed3IRU1==J~jrHeNQ)e{aNyf?K!08 Y%h7r6w#4mid9$RB>nN9LsHL9&1^5ojnE(I) literal 0 HcmV?d00001 diff --git a/clone/clone b/clone/clone index fbda072..0e02f36 100755 --- a/clone/clone +++ b/clone/clone @@ -213,7 +213,7 @@ step7(){ # (9) Define config alias with ssh-key # echo " (.) Define alias config"; - echo "Host\tsmmp-server\n\tHostname\t$SERVER_HOSTNAME\n\tUser\t$SERVER_USERNAME\n\tIdentityFile\t~/.ssh/id_ecdsa\n" | sudo tee /mnt/home/sats/.ssh/config > /dev/null; + echo "Host\tsmmp-server\n\tHostname\t${SERVER_HOSTNAME}\n\tUser\t${SERVER_USERNAME}\n\tIdentityFile\t~/.ssh/id_ecdsa\n" | sudo tee /mnt/home/sats/.ssh/config > /dev/null; sudo chown 666:666 /mnt/home/sats/.ssh/config; sudo chmod 444 /mnt/home/sats/.ssh/config; @@ -280,15 +280,16 @@ step10(){ # (2) Set up SATS botting script # echo " (.) Set up SATS booting script"; - cat ./utility/booting_script | sudo tee /mnt/home/sats/satsd/boot; + cat ./utility/booting_script | sudo tee /mnt/home/sats/satsd/boot > /dev/null; # (3) Set up service unit # echo " (.) Set up service unit (sats.service)"; - cat ./utility/service_unit | sudo tee /mnt/lib/systemd/system/sats.service; + cat ./utility/service_unit | sudo tee /mnt/lib/systemd/system/sats.service > /dev/null; # (4) Enable startup service unit # echo " (.) Emulate \`systemctl enable sats.service\`"; - sudo ln -fs /lib/systemd/system/sats.service /mnt/etc/systemd/system/sats.service; + sudo mkdir -p /mnt/etc/systemd/system/multi-user.target.wants; + sudo ln -fs /lib/systemd/system/sats.service /mnt/etc/systemd/system/multi-user.target.wants/sats.service; # (5) Adjust permissions # echo " (.) Adjust permissions"; @@ -303,6 +304,17 @@ step10(){ } + +# [11] BLablslkfjdlkdsjfks +#========================================================# +step11(){ + + sudo umount /mnt; + +} + + + # [0] Step choice #========================================================# echo "\nSTEPS"; diff --git a/clone/utility/booting_script b/clone/utility/booting_script index 41b20d5..bbf174e 100644 --- a/clone/utility/booting_script +++ b/clone/utility/booting_script @@ -4,7 +4,7 @@ if [ -e /home/sats/satsd/first_install ]; then # install source code - git clone ssh://smmp-server/satsd /mnt/home/sats/satsd/source \ + git clone ssh://smmp-server/satsd /home/sats/satsd/source \ && rm /home/sats/satsd/first_install \ || exit; diff --git a/clone/utility/service_unit b/clone/utility/service_unit index 7e9344f..19042e5 100644 --- a/clone/utility/service_unit +++ b/clone/utility/service_unit @@ -3,9 +3,11 @@ Description=SATS (Secure Authentication and Tracking SYSTEM) Daemon After=multi-user.target [Service] -Type=idle -ExecStart=-/bin/sh /home/sats/satsd/boot service 2>> /home/sats/satsd/log/boot.log >> /home/sats/satsd/log/boot.log +Type=Simple User=sats +ExecStart=/bin/sh /home/sats/satsd/boot service 2>> /home/sats/satsd/log/boot.log >> /home/sats/satsd/log/boot.log +Restart=on-abort + [Install] WantedBy=multi-user.target