해피 투게더

omv5 에서 EBS 녹음 그리고 omv5 로 이전 후기 본문

장난감

omv5 에서 EBS 녹음 그리고 omv5 로 이전 후기

보아요 2020. 9. 8. 08:29

nano /etc/rc.local

cd /root/mcm-daemon
./mcm-daemon

if [ -e /usr/sbin/mcu_ctl ]; then
    /usr/sbin/mcu_ctl sys_ready 2>&1 >/dev/null
fi
if [ -e /sys/class/leds/wdmcex2u\:blue\:hdd1/trigger ]; then
    echo gpio > /sys/class/leds/wdmcex2u\:blue\:hdd1/trigger
    echo 48 >  /sys/class/leds/wdmcex2u\:blue\:hdd1/gpio
fi
if [ -e /sys/class/leds/wdmcex2u\:blue\:hdd2/trigger ]; then
    echo gpio > /sys/class/leds/wdmcex2u\:blue\:hdd2/trigger
    echo 58 > /sys/class/leds/wdmcex2u\:blue\:hdd2/gpio
fi
if [ -e /sys/class/leds/wdmcex2u\:red\:hdd1/trigger ]; then
    echo disk-activity > /sys/class/leds/wdmcex2u\:red\:hdd1/trigger
fi
if [ -e /sys/class/leds/wdmcex2u\:red\:hdd2/trigger ]; then
    echo panic > /sys/class/leds/wdmcex2u\:red\:hdd2/trigger
fi
exit 0

 

omv5 extras 설치

wget -O - https://github.com/OpenMediaVault-Plugin-Developers/packages/raw/master/install | bash

 

 

omv5 에서 chrony 에러 Fatal error : Failed to load seccomp rules

nano /etc/default/chrony

 

DAEMON_OPTS="-F -0"

 

으로 수정후 systemctl start chrony.service

 

스왑파일 생성

 

dd if=/dev/zero of=/swapfile bs=1024 count=500000

 

chmod 600 /swapfile

mkswap /swapfile

swapon /swapfile

 

스왑 추가

nano /etc/fstab

/swapfile swap swap defaults 0 0

 

apt-get install rtmpdump ffmpeg

 

crontab -e  설정

0 5 * * 1-6 /root/ebs_record.sh Pocket-CH 10 /srv/dev-disk-by-id-ata-WDC_WD20EFRX-68EUZN0_WD-WCC4M5SPE546-part2/hd2/EBS/1Pocket-CH
30 5 * * 4-6 /root/ebs_record.sh Basic-CH 20 /srv/dev-disk-by-id-ata-WDC_WD20EFRX-68EUZN0_WD-WCC4M5SPE546-part2/hd2/EBS/2Basic-CH
20 6 * * 1-6 /root/ebs_record.sh Easywriting 20 /srv/dev-disk-by-id-ata-WDC_WD20EFRX-68EUZN0_WD-WCC4M5SPE546-part2/hd2/EBS/3Easywriting
0 7 * * 1-6 /root/ebs_record.sh SpeakEng 20 /srv/dev-disk-by-id-ata-WDC_WD20EFRX-68EUZN0_WD-WCC4M5SPE546-part2/hd2/EBS/4SpeakEng
40 7 * * 1-6 /root/ebs_record.sh PowerEng 20 /srv/dev-disk-by-id-ata-WDC_WD20EFRX-68EUZN0_WD-WCC4M5SPE546-part2/hd2/EBS/5PowerEng

 

ebs_record.sh 스크립트

#!/bin/bash

RADIO_ADDR="rtmp://ebsandroid.ebs.co.kr:1935/fmradiofamilypc/familypc1m"

RADIO_NAME="ebs_radio"


PROGRAM_NAME=$1

RECORD_MINS=$(($2 * 60))

DEST_DIR=$3


REC_DATE=`date +%Y%m%d-%H%M`

TEMP_FLV=/srv/dev-disk-by-id-ata-WDC_WD20EFRX-68EUZN0_WD-WCC4M5SPE546-part2/hd2/EBS/`date +%Y%m%d-%H%M`


M4A_FILE_NAME=$PROGRAM_NAME"_"$REC_DATE.m4a


rtmpdump -r $RADIO_ADDR -B $RECORD_MINS -o $TEMP_FLV

ffmpeg -i $TEMP_FLV -vn -acodec copy $M4A_FILE_NAME > /dev/null 2>&1


rm $TEMP_FLV


mkdir -p $DEST_DIR

mv $M4A_FILE_NAME $DEST_DIR

 

아래처럼 1분간 테스트 해보니 잘되는 듯.

 

 /root/ebs_record.sh test 1 /srv/dev-disk-by-id-ata-WDC_WD20EFRX-68EUZN0_WD-WCC4M5SPE546-part2/hd2/EBS

 

 

혹시 dns 찾을수 없다면

nano /etc/systemd/resolved.conf

[Resolve]

DNS=1.1.1.1

 

저장하고 systemctl restart systemd-resolved

 

networkd.conf 가 변경되면 systemctl restart systemd-networkd

 

포테이너에서 3가지 stack 설치

 

pihole

traefik

transmission, nginx(webdav,php), torrssen2

 

그리고 EBS 녹음까지를 마지막으로 omv4 에서 omv5 로 이전완료

 

sharedfolders 설정 변경, macvlan 설치를 위한 네트웍 설정으로 삽질 많이 했지만 덕분에 도커, 포테이너 익숙해짐

systemd 관련도 좀 더 살펴봐야 할 듯.