OliveTin for Channels: An Interface for Misc Channels DVR Scripts & Tricks

Could you post stdout and stderr for both please?

For fix thumbs:

Background script initiated, with 30m between runs for cjynas:8089
Using healthcheck.io pings to https://hc-ping.com/33f47a5b-d148-4819-b391-044712cc6140 to confirm functionality
Background fix_thumbnails process running for cjynas:8089
foreground.sh is exiting for fix_thumbnails with exit code 0
+ dvr=cjynas:8089
++ echo cjynas:8089
++ awk -F: '{print $1}'
+ channelsHost=cjynas
++ echo cjynas:8089
++ awk -F: '{print $2}'
+ channelsPort=8089
+ backgroundScript=fix_thumbnails
+ firstChar=f
+ runInterval=30m
+ healthchecksIO=https://hc-ping.com/33f47a5b-d148-4819-b391-044712cc6140
+ [[ https://hc-ping.com/33f47a5b-d148-4819-b391-044712cc6140 == \h\t\t\p\s\:\/\/\h\c\-\p\i\n\g\.\c\o\m\/\y\o\u\r\_\c\u\s\t\o\m\_\u\u\i\d ]]
++ ps -ef
++ grep '[f]ix_thumbnails.* cjynas:8089'
++ awk '{print $2}'
+ runningScriptPID=
+ [[ -n '' ]]
+ backgroundArguments='cjynas:8089 30m https://hc-ping.com/33f47a5b-d148-4819-b391-044712cc6140'
+ greenIcon='"icons/channels.png"'
+ purpleIcon='"https://community-assets.getchannels.com/original/2X/5/55232547f7e8f243069080b6aec0c71872f0f537.png"'
+ logFile=/config/cjynas-8089_fix_thumbnails_latest.log
+ trap finish EXIT
+ main
+ scriptRun
+ case "$runInterval" in
+ [[ -n '' ]]
+ echo 'Background script initiated, with 30m between runs for cjynas:8089'
+ grep -q '(.*) #fix_thumbnails' /config/config.yaml
+ nohup /config/fix_thumbnails.sh cjynas:8089 30m https://hc-ping.com/33f47a5b-d148-4819-b391-044712cc6140
+ [[ 1 == \1 ]]
++ date +%d%b%y_%H:%M
+ sed -i '/#fix_thumbnails title/s/#/(18Nov23_08:20) #/' /config/config.yaml
+ sed -i '/#fix_thumbnails icon/s|img src = .* width|img src = "icons/channels.png" width|' /config/config.yaml
+ sed -i '/#fix_thumbnails interval default/s/default: .* #/default: 30m #/' /config/config.yaml
+ [[ -n https://hc-ping.com/33f47a5b-d148-4819-b391-044712cc6140 ]]
+ echo 'Using healthcheck.io pings to https://hc-ping.com/33f47a5b-d148-4819-b391-044712cc6140 to confirm functionality'
+ sed -i '/#fix_thumbnails healthchecks default/s|default: .* #|default: https://hc-ping.com/33f47a5b-d148-4819-b391-044712cc6140 #|' /config/config.yaml
+ echo 'cjynas:8089 fix_thumbnails 30m https://hc-ping.com/33f47a5b-d148-4819-b391-044712cc6140'
+ runningScripts
+ servers=($CHANNELS_DVR $CHANNELS_DVR_ALTERNATES)
+ for server in "${servers[@]}"
++ awk -F: '{print $1}'
++ echo cjynas:8089
+ serverHost=cjynas
++ echo cjynas:8089
++ awk -F: '{print $2}'
+ serverPort=8089
++ ps -ef
++ grep '[f]ix_thumbnails.* cjynas:8089'
++ awk '{print $2}'
+ activeProcess=829
+ [[ -n 829 ]]
+ echo 'Background fix_thumbnails process running for cjynas:8089'
+ exit 0
+ finish
+ echo -e 'foreground.sh is exiting for fix_thumbnails with exit code 0'
+ cp /config/config.yaml /config/temp.yaml
+ cp /config/temp.yaml /config/config.yaml
+ sleep 1
+ '[' -f /config/cjynas-8089_fix_thumbnails_latest.log ']'
+ cat /config/cjynas-8089_fix_thumbnails_latest.log

For Twit:

Background script initiated, with 2h between runs for cjynas:8089
Using healthcheck.io pings to https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b to confirm functionality
Downloading latest iCal data for cjynas:8089...
Background ical_2_xmltv process running for cjynas:8089
foreground.sh is exiting for ical_2_xmltv with exit code 0
++ echo cjynas:8089
++ awk -F: '{print $1}'
+ channelsHost=cjynas
++ echo cjynas:8089
++ awk -F: '{print $2}'
+ channelsPort=8089
+ backgroundScript=ical_2_xmltv
+ firstChar=i
+ runInterval=2h
+ healthchecksIO=https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b
+ [[ https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b == \h\t\t\p\s\:\/\/\h\c\-\p\i\n\g\.\c\o\m\/\y\o\u\r\_\c\u\s\t\o\m\_\u\u\i\d ]]
++ ps -ef
++ grep '[i]cal_2_xmltv.* cjynas:8089'
++ awk '{print $2}'
+ runningScriptPID=
+ [[ -n '' ]]
+ backgroundArguments='cjynas:8089 2h https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b'
+ greenIcon='"icons/channels.png"'
+ purpleIcon='"https://community-assets.getchannels.com/original/2X/5/55232547f7e8f243069080b6aec0c71872f0f537.png"'
+ logFile=/config/cjynas-8089_ical_2_xmltv_latest.log
+ trap finish EXIT
+ main
+ scriptRun
+ case "$runInterval" in
+ [[ -n '' ]]
+ echo 'Background script initiated, with 2h between runs for cjynas:8089'
+ grep -q '(.*) #ical_2_xmltv' /config/config.yaml
+ nohup /config/ical_2_xmltv.sh cjynas:8089 2h https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b
+ [[ 1 == \1 ]]
++ date +%d%b%y_%H:%M
+ sed -i '/#ical_2_xmltv title/s/#/(18Nov23_08:20) #/' /config/config.yaml
+ sed -i '/#ical_2_xmltv icon/s|img src = .* width|img src = "icons/channels.png" width|' /config/config.yaml
+ sed -i '/#ical_2_xmltv interval default/s/default: .* #/default: 2h #/' /config/config.yaml
+ [[ -n https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b ]]
+ echo 'Using healthcheck.io pings to https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b to confirm functionality'
+ sed -i '/#ical_2_xmltv healthchecks default/s|default: .* #|default: https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b #|' /config/config.yaml
+ echo 'cjynas:8089 ical_2_xmltv 2h https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b'
+ runningScripts
+ servers=($CHANNELS_DVR $CHANNELS_DVR_ALTERNATES)
+ for server in "${servers[@]}"
++ echo cjynas:8089
++ awk -F: '{print $1}'
+ serverHost=cjynas
++ awk -F: '{print $2}'
++ echo cjynas:8089
+ serverPort=8089
++ ps -ef
++ grep '[i]cal_2_xmltv.* cjynas:8089'
++ awk '{print $2}'
+ activeProcess=776
+ [[ -n 776 ]]
+ echo 'Background ical_2_xmltv process running for cjynas:8089'
+ exit 0
+ finish
+ echo -e 'foreground.sh is exiting for ical_2_xmltv with exit code 0'
+ cp /config/config.yaml /config/temp.yaml
+ cp /config/temp.yaml /config/config.yaml
+ sleep 1
+ '[' -f /config/cjynas-8089_ical_2_xmltv_latest.log ']'
+ cat /config/cjynas-8089_ical_2_xmltv_latest.log

@cyoungers

Could you exec into the OliveTin container and ping cjynas please? Just want to be sure it resolves.

Yup, the ping to cjynas did not resolve. While I was having issues with the periodic tasks I tried the tailscale magic dns and set my server to cjynas. I should have not changed configuration while trying to fix the initial problem. I changed back to using the ip number directly and now the fix thumbs is working! Thanks for the help. I'll have to investigate why tailscale is not working for me in olivetin.

I'm using Tailscale with MagicDNS myself, and at minimum you'll want to change your domain name in the docker compose to your tailnet.

There are a couple of other possible tweaks, depending on how you're running Tailscale on the Docker host.

1 Like

I'm running tailscale on my Synology NAS installed from Package Center. I am setting the TAILNET env variable to tail6d9e.ts.net which I got from the tailscale DNS configuration page. Then I set CHANNELS_DVR = cjynas:8089 in env variables. For whatever reason that did not work. I'm happy with it working without the tailscale stuff so don't spend any time investigating this unless you see something obvious to try. Thanks again.

Nothing obvious, but just a couple of notes for when/if you want to look into this a bit further:

Make sure that your Docker host /etc/resolv.conf looks like this:

root@htpc6:~# cat /etc/resolv.conf
# resolv.conf(5) file generated by tailscale
# For more info, see https://tailscale.com/s/resolvconf-overwrite
# DO NOT EDIT THIS FILE BY HAND -- CHANGES WILL BE OVERWRITTEN

nameserver 100.100.100.100
search tailxxxxx.ts.net

This file can be overwritten in Linux several ways, including DHCP lease renewal. Best bet is for your Tailscaled Docker host to use a static IP.

In the case of OliveTIn, be sure your docker compose looks similar to this:

version: '3.9'
services:
  olivetin:
    image: bnhf/olivetin:${TAG} # Add the tag like latest or test to the environment variables below
    container_name: olivetin
    dns_search: ${TAILNET} # For Tailscale users using Magic DNS, add your Tailnet (tailxxxxx.ts.net) to use hostnames for remote nodes
    ports:
      - 1337:1337
    environment:
      - CHANNELS_DVR=${CHANNELS_DVR} # Add your Channels DVR server in the form hostname:port or ip:port
      - CHANNELS_DVR_ALTERNATES=${CHANNELS_DVR_ALTERNATES} # Space separated list of alternate Channels DVR servers to choose from in the form hostname:port or ip:port
      - CHANNELS_CLIENTS=${CHANNELS_CLIENTS} # Space separated list of Channels DVR clients you'd like notifications sent to in the form hostname or IP
      - UPDATE_YAMLS=${UPDATE_YAMLS} # Set this to true to update config.yaml
      - UPDATE_SCRIPTS=${UPDATE_SCRIPTS} # Set this to true to update all included scripts
      - TZ=${TZ} # Add your local timezone in standard linux format. E.G. US/Eastern, US/Central, US/Mountain, US/Pacific, etc
    volumes:
      - ${HOST_DIR}/olivetin:/config # Add the parent directory on your Docker you'd like to use
      - ${DVR_SHARE}:/mnt/${CHANNELS_DVR} # This can either be a Docker volume or a host directory that's connected via Samba or NFS to your Channels DVR network share.
    restart: unless-stopped
#volumes: # use this section if you've setup a docker volume named channels-dvr, with CIFS or NFS, to bind to /mnt/dvr inside the container
  #channels-dvr:
    #external: true

My NAS has a static ip. I'm using the exact same compose file. My resolve.conf looks different than yours.

bash-5.2# cat /etc/resolv.conf
search tail6d9e.ts.net
nameserver 127.0.0.11
options ndots:0

That looks like the resolv.conf from inside the container.

I'm asking about the resolv.conf on your Docker host -- which for you, is probably your Synology NAS OS (which I'm assuming is a relatively recent Linux derivative).

Here is from my NAS.

Chris@CJYNAS:~$ cat /etc/resolv.conf
nameserver	8.8.8.8
nameserver	8.8.4.4
domain	Home

Let's move this to a Tailscale thread if you want to keep working on it, and here's what we'd need focus on:

  • Whether or not MagicDNS would benefit you. I personally think Tailscale and MagicDNS are game changing -- which they are for me, but that's certainly not true for everyone.

  • Determine what parameters are being used to launch Tailscale, when installed from your package store. And in particular, why your resolv.conf wasn't modified -- which could be as simple as you weren't using MagicDNS at the time.

  • Publishing subnet routes and exit nodes can factor in to, based on your overall desired outcome.

Thanks. Tailscale MagicDNS is very useful for me now but it is not worth it for you or me to troubleshoot this issue any further with regards to using it in Olivetin. Tailscale has some excellent documentation about Synology that I have not dived into to investigate why my configuration does not work with Docker instances.

Thank you for this great tool. With the feature to find a Gracenote stationID, what do we put in the "station" input box? That station call letters? And after it is run, where do we find the output? I looked in the data folder, and I can't find it there. Thank you.

1 Like

Whatever you think will match what you're looking for, such as:

HBO
HBO Signature
USAP
KABC
WCBS

Output is found under the "Logs" button, then "stdout".

Ah, thanks. For the last part, I didn't realize each part of the breadcrumb would reveal different info. I was only clicking the "stderr" portion.

Not sure why I'm getting NUL (0x00) characters in the log files.
Maybe because I'm editing the log files?
192.168.1.4-8489_monitor_channels.log


I edit them to remove the checks where nothing changed and the next run fills the file with NUL characters.

Interesting. What editor are you using, and on what OS?

Using Notepad++ on Windows and accessing the log file on my Synology NAS through SMB.
I can also copy the log file in linux on my Synology to another shared SMB folder and see the same thing.

I only get the NUL characters when I modify the log file (remove some lines) and they get added on the next run.

I'll try using a text editor on my NAS and see if I see the same behavior. Doubt that it's Notepad++ causing the issue as I use it extensively to modify scripts and other files on my NAS.

The Synology Text Editor doesn't show all characters.
It omits the first blank line (initial LF character) and doesn't show NUL characters.
I edited this log file in the Synology Text Editor
Capture2

Here it is displayed in Notepad++

I'll look at this tomorrow in VS Code and see if I can duplicate. As I recall, I'm redirecting console output to create this file in the first place.