The road to Docker in the arm64v8 environment of Raspberry Pi 4 was steep ... It wasn't easy to convert the Dockerfiles created for x86_64 to arm64v8 in the past. I broke my heart because I couldn't build (I could barely run). What are you guys doing? (Reference: https://github.com/docker/distribution/issues/3008)
We prioritized the operation of the service once and built the environment without Docker.
It was quite troublesome to find out how to create a systemd Unit file after a long time. I'll leave it as a memo for myself.
Postscript) 2020/11/14 The config.json was written incorrectly, so I fixed it. 2020/11/14 Added the setting to automatically delete from the one one month ago in crontab.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster
$ sudo su -
# apt update
# apt install rtmpdump swftools libxml2-utils
# go get github.com/mtkhs/radicast
# mkdir -p /opt/service/radicast
# cd /opt/service/radicast
# vim config.json
# mkdir output
# vim /etc/systemd/system/radicast.service
# systemctl enable radicast
# systemctl start radicast
# crontab -e
config.json
{
"BAYFM78": [],
"FMJ": [],
"FMT": [],
"HOUSOU-DAIGAKU": [],
"INT": [],
"JOAB": [],
"JOAK": [],
"JOAK-FM": [],
"JORF": [],
"LFR": [
"0 1 * * FRI"
],
"NACK5": [],
"QRR": [],
"RN1": [],
"RN2": [],
"TBS": [
"0 0 * * WED",
"0 1 * * WED",
"0 0 * * FRI",
"30 3 * * SUN"
],
"YFM": []
}
radicast.service
[Unit]
Description=Radicast service
After=networking.service
Requires=networking.service
[Service]
Type=simple
WorkingDirectory=/opt/service/radicast
ExecStart=/root/go/bin/radicast
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
[Install]
WantedBy=multi-user.target
crontab
0 5 * * * find /opt/service/radicast/output/ -mtime +31 -delete
After this, I'll use nginx to make it accessible via podcast from the outside.
Recommended Posts