temporary install

This commit is contained in:
Aliberk Sandıkçı 2023-07-27 12:22:51 +03:00
parent 24324dcadb
commit 53a3d9a778
Signed by: asandikci
GPG Key ID: 25C67A03B5666BC1
3 changed files with 25 additions and 2 deletions

View File

@ -10,6 +10,7 @@ This repo will be include two separate daemons. One of them is written with C la
<br> <br>
### C-Daemon ### C-Daemon
look c-daemon/tmp-install.sh for installing as daemon! (temporary)
Dependencies `git, go, gcc` Dependencies `git, go, gcc`
@ -34,7 +35,6 @@ cd c-daemon/bin/
``` ```
<br> <br>
--- ---

View File

@ -48,7 +48,7 @@ int _daemon(int nochdir, int noclose){
dup(0); dup(0);
} }
while (1) { while (1) {
int status = system("./info"); int status = system("/usr/lib/cdaemontmp/info");
// TODO SECURITY ISSUE // TODO SECURITY ISSUE
// LINK https://stackoverflow.com/questions/5237482/how-do-i-execute-an-external-program-within-c-code-in-linux-with-arguments# // LINK https://stackoverflow.com/questions/5237482/how-do-i-execute-an-external-program-within-c-code-in-linux-with-arguments#

23
c-daemon/tmp-install.sh Normal file
View File

@ -0,0 +1,23 @@
#!/bin/bash
# Temporary Install file for testing until binary installation packages are ready
### C-daemon
# Cleaning
sudo rm /usr/bin/cdaemontmp
sudo rm -rf /usr/lib/cdaemontmp/
# Building
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
sudo ln -sv "$(pwd)"/c-daemon/bin/info /info
```
# Installing
# move to
cd c-daemon
sudo mv bin/test /usr/bin/cdaemontmp
sudo mv bin/info /usr/lib/cdaemontmp/info