Managing service #2

This commit is contained in:
xdrm-brackets 2017-01-24 19:10:44 +01:00
parent d1b08e4e0c
commit 622c97a106
4 changed files with 21 additions and 7 deletions

BIN
clone/.clone.swp Normal file

Binary file not shown.

View File

@ -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";

View File

@ -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;

View File

@ -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