Managing service #2
This commit is contained in:
parent
d1b08e4e0c
commit
622c97a106
Binary file not shown.
20
clone/clone
20
clone/clone
|
@ -213,7 +213,7 @@ step7(){
|
||||||
|
|
||||||
# (9) Define config alias with ssh-key #
|
# (9) Define config alias with ssh-key #
|
||||||
echo " (.) Define alias config";
|
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 chown 666:666 /mnt/home/sats/.ssh/config;
|
||||||
sudo chmod 444 /mnt/home/sats/.ssh/config;
|
sudo chmod 444 /mnt/home/sats/.ssh/config;
|
||||||
|
|
||||||
|
@ -280,15 +280,16 @@ step10(){
|
||||||
|
|
||||||
# (2) Set up SATS botting script #
|
# (2) Set up SATS botting script #
|
||||||
echo " (.) Set up SATS booting 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 #
|
# (3) Set up service unit #
|
||||||
echo " (.) Set up service unit (sats.service)";
|
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 #
|
# (4) Enable startup service unit #
|
||||||
echo " (.) Emulate \`systemctl enable sats.service\`";
|
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 #
|
# (5) Adjust permissions #
|
||||||
echo " (.) Adjust permissions";
|
echo " (.) Adjust permissions";
|
||||||
|
@ -303,6 +304,17 @@ step10(){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [11] BLablslkfjdlkdsjfks
|
||||||
|
#========================================================#
|
||||||
|
step11(){
|
||||||
|
|
||||||
|
sudo umount /mnt;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [0] Step choice
|
# [0] Step choice
|
||||||
#========================================================#
|
#========================================================#
|
||||||
echo "\nSTEPS";
|
echo "\nSTEPS";
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
if [ -e /home/sats/satsd/first_install ]; then
|
if [ -e /home/sats/satsd/first_install ]; then
|
||||||
|
|
||||||
# install source code
|
# 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 \
|
&& rm /home/sats/satsd/first_install \
|
||||||
|| exit;
|
|| exit;
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,11 @@ Description=SATS (Secure Authentication and Tracking SYSTEM) Daemon
|
||||||
After=multi-user.target
|
After=multi-user.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=idle
|
Type=Simple
|
||||||
ExecStart=-/bin/sh /home/sats/satsd/boot service 2>> /home/sats/satsd/log/boot.log >> /home/sats/satsd/log/boot.log
|
|
||||||
User=sats
|
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]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
Loading…
Reference in New Issue