add unit file and update install script

This commit is contained in:
Aliberk Sandıkçı 2023-07-27 12:48:11 +03:00
parent fcd25825ac
commit 5a16a9e503
Signed by: asandikci
GPG key ID: 25C67A03B5666BC1
2 changed files with 21 additions and 3 deletions

View file

@ -0,0 +1,12 @@
[Unit]
Description=cdaemon temporary service
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/cdaemontmp
PIDFile=/var/run/cdaemontmp.pid
Restart=always
[Install]
WantedBy=multi-user.target

12
c-daemon/tmp-install.sh Normal file → Executable file
View file

@ -4,19 +4,25 @@
### C-daemon
# Cleaning
# Pre-Cleaning
sudo rm /usr/bin/cdaemontmp
sudo rm -rf /usr/lib/cdaemontmp/
# Building
temp_dir="$(mktemp -d)"
cd $temp_dir
echo $temp_dir
git clone https://git.aliberksandikci.com.tr/liderahenk/go-daemon
cd go-daemon/
go build -o c-daemon/bin/ c-daemon/go-files/info.go
gcc -o c-daemon/bin/test c-daemon/daemon/test.c c-daemon/daemon/daemon.c
# Installing
# move to
cd c-daemon
sudo mv ./bin/test /usr/bin/cdaemontmp
sudo mkdir -p /usr/lib/cdaemontmp/
sudo mv ./bin/info /usr/lib/cdaemontmp/info
sudo mv ./bin/info /usr/lib/cdaemontmp/info
sudo mv ./cdaemontmp.service /etc/systemd/system/
# Post-Cleaning
# sudo rm -rf temp_dir