Showing posts with label NAS. Show all posts
Showing posts with label NAS. Show all posts

Thursday, February 16, 2023

Compiling source code (by CMake) of application in FFP

Compile source code of application via CMake instead of autotools in FFP-0.7 enviroment of NAS, you can commend below steps :



1. Download source code of application
# wget http://../source-code-application.tar.gz

2. Uncompress (-x) source code
# tar -xvf source-code-application.tar.gz

3. Compile by "CMake" in the prefix directory of uncompressed source-code-application
# cd source-code-application
# cmake -DCMAKE_INSTALL_PREFIX=/ffp . | tee file.log &

* remake : after CMake V3.x, changed to "--install . --prefix" from "-DCMAKE_INSTALL_PREFIX="
* remark : time taking so put it in background "&" & show in both screen & log file "tee" 

4. Install by "make" in the directory of uncompressed source-code-application given the insatll folder in temp4new
# make 
# make install DESTDIR=/i-data/75b2c01f/build/temp4new | tee file.log & 

* remark : time taking so put it in background "&" & show in both screen & log file "tee" 

5. Compress (-c) Application
# cd /mnt/HD_a2/build/temp4new
tar -cvf source-code-application-oarm-0.txz ffp

* remark: a. remove -J not to cpmpress package

6. Install (-i) / Upgrade (-u) Applictaion
# funpkg -u source-code-application-oarm-0.txz

Monday, December 12, 2022

Rsyslog Configuration in Pi Log Server to Log Remote NAS Clients / Devices

Quick configurate the setting of logging remote devices' log via rsyslog in Pi Linux by below steps : 


1. Remove # for UDP reception instead of TCP 

module(load="imudp")
input(type="imudp" port="514")
* some NAS devices just supported UDP to send remote log data via udp

2. Define template for remote loggin

template (
    name="RemoteLogs"
    type="string"
    string="/var/log/remote/%HOSTNAME%/keylog.log"
)

* usable Rsyslog message properties : HOSTNAME, PROGRAMNAME (service/user...)
* put the defition of rule in the end of configuration setting instead

3. Set Rule for filter and sort required log data 

if $HOSTNAME != "ray-raspberry" and ($PROGRAMNAME == "root" or $PROGRAMNAME == "nobody") 
then 
*.* -?RemoteLogs

* eg. filter out local host "ray-raspbery" and filter in program user / service log of "root" (logger) or nobody" (transmission)

4. Stop the process once the file wrote 

& ~

5. Test the Conf. scription in bash commend 

~ $ rsyslogd -N1 -f /etc/rsyslog.conf

ps. the right message if the conf. is correct and valid

rsyslogd: version 8.1901.0, config validation run (level 1), master config /etc/rsyslog.conf

rsyslogd: End of config validation run. Bye.


6. Restart Rsyslog to apply for the change in bash commend

~ $ sudo systemctl restart rsyslog


Remark : 



   

Monday, April 8, 2019

Compiling source code (by Autotools) of application in FFP


If you want to compile source code of application by autotools in FFP-0.7 enviroment of NAS, you can commend below steps :

1. Download source code of application
# wget http://../source-code-application.tar.xz

2. Uncompress (-x) source code
# tar -xvf source-code-application.tar.gz

3. Auto Configurate
# cd source-code-application
# autoreconf -i
# ./configure --prefix=/ffp

4. Compile Application
 given the install folder in temp4new

# make
# mkdir /mnt/HD_a2/build/temp4new
# DESTDIR=//mnt/HD_a2/build/temp4new make install

6. Compress (-c) Application
# cd /mnt/HD_a2/build/temp4new
tar -cvf source-code-application-oarm-0.txz ffp

* remark: a. remove -J to uncpmpress package for performance 

7. Install (-i) / Upgrade (-u) Applictaion
# funpkg -u source-code-application-oarm-0.txz