[myHD 0.5.1] RC2 version ... Add Ubuntu 1804 Bionic

New total application manager for HD_Station
User avatar
philippe
Site Admin
Posts: 150
Joined: Mon Apr 16, 2018 3:10 pm
Has thanked: 2 times
Been thanked: 15 times

Re: [myHD 0.5] RC2 version ... Add Ubuntu 1804 Bionic

Post by philippe » Thu Oct 11, 2018 12:09 pm

Hi,

I am a little stupid (sorry)
... myHD.sh trace can't works because the myHD.sh come from 0.4.1 and are not the myHD.sh inside my QPKG

Please can you do :
cd /share/CACHEDEV1_DATA/.qpkg/myHD
EDIT the file myHD.sh
search line starting by stop)

Code: Select all

stop)
        if [ -e /tmp/${NS_HOST}.pid ] ; then
                /usr/bin/${NS_HOST}_root "/sbin/shutdown -h now ; exit"
and ADD just after stop)
set -x
stop)
set -x
if [ -e /tmp/${NS_HOST}.pid ] ; then
/usr/bin/${NS_HOST}_root "/sbin/shutdown -h now ; exit"
[/code]

So NOW when myHD.sh is called for "stop" trace will be displayed ... in QPKG update OR in normal stop

Q1 : when you do myHD stop manually ... it don't stop ???
Philippe.
QNAP / Asustor package integrator
User avatar
philippe
Site Admin
Posts: 150
Joined: Mon Apr 16, 2018 3:10 pm
Has thanked: 2 times
Been thanked: 15 times

Re: [myHD 0.5] RC2 version ... Add Ubuntu 1804 Bionic

Post by philippe » Thu Oct 11, 2018 12:13 pm

Hi,
tarkett wrote:
Thu Oct 11, 2018 12:06 pm
Hi,
please see the edit of my last comment. I do this test and it change nothing.
FYI: The comments myHD stop[start,status] also doesn't work, after I run the update Script. I must first reboot the NAS.
Is there a process which I can kill, that the reboot is not necessary?
Best regards
tarkett
To stop myHD by force :
kill -9 $(pidof jchroot)

Philippe.
QNAP / Asustor package integrator
User avatar
philippe
Site Admin
Posts: 150
Joined: Mon Apr 16, 2018 3:10 pm
Has thanked: 2 times
Been thanked: 15 times

Re: [myHD 0.5] RC2 version ... Add Ubuntu 1804 Bionic

Post by philippe » Thu Oct 11, 2018 12:14 pm

Hi,

You can also trace the error by doing

/bin/sh -x /etc/init.d/myHD.sh stop

Philippe.
QNAP / Asustor package integrator
User avatar
philippe
Site Admin
Posts: 150
Joined: Mon Apr 16, 2018 3:10 pm
Has thanked: 2 times
Been thanked: 15 times

Re: [myHD 0.5] RC2 version ... Add Ubuntu 1804 Bionic

Post by philippe » Thu Oct 11, 2018 12:18 pm

Hi,

Also search if some previous myHD.sh are not already run ... and kill it

Philippe.
QNAP / Asustor package integrator
tarkett
Posts: 15
Joined: Tue May 29, 2018 7:19 pm
Has thanked: 2 times
Been thanked: 2 times

Re: [myHD 0.5] RC2 version ... Add Ubuntu 1804 Bionic

Post by tarkett » Thu Oct 11, 2018 12:59 pm

Hi,

okay, I do the following tests.

1. Reboot the NAS. I read your comment with the process to kill too late.

2. Now works the scripts myHD start[stop,status] without any problem.

3. The output from manually stop:

Code: Select all

[admin@nas01 ~]# /bin/sh -x /etc/init.d/myHD.sh stop
+ NS_HOST=myHD
++ /sbin/getcfg myHD install_path -d /share/CACHEDEV1_DATA/.qpkg/myHD -f /etc/config/qpkg.conf
+ QPKG_PATH=/share/CE_CACHEDEV1_DATA/.qpkg/myHD
++ /sbin/getcfg myHD QPKG_UBUNTU_VERSION -d 1604 -f /etc/config/qpkg.conf
+ UVER=1604
+++ /usr/bin/dirname /share/CE_CACHEDEV1_DATA/.qpkg/myHD
++ /usr/bin/dirname /share/CE_CACHEDEV1_DATA/.qpkg
+ QPKG_FOLDER=/share/CE_CACHEDEV1_DATA
+ CHROOT_PATH=/share/CE_CACHEDEV1_DATA/.myHD/1604
++ /sbin/getcfg HD_Station install_path -f /etc/config/qpkg.conf
+ HDS_PATH=/share/CE_CACHEDEV1_DATA/.qpkg/HD_Station
++ /sbin/getcfg HD_Station install_path -f /etc/config/qpkg.conf
+ HDS_CMD=/share/CE_CACHEDEV1_DATA/.qpkg/HD_Station/opt/nas_bin/hdslauncher
+ MYHD_BIN=/share/CE_CACHEDEV1_DATA/.qpkg/myHD/bin
+ BLUE='\033[0;36m'
+ NC='\033[0m'
+ RED='\033[0;31m'
+ '[' '!' -e /root/.myHD_lock ']'
+ case "$1" in
+ set -x
+ '[' -e /tmp/myHD.pid ']'
+ /usr/bin/myHD_root '/sbin/shutdown -h now ; exit'

Session terminated, terminating shell... ...terminated.
+ NB=30
+ '[' 30 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=29
+ '[' 29 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=28
+ '[' 28 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=27
+ '[' 27 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=26
+ '[' 26 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=25
+ '[' 25 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=24
+ '[' 24 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=23
+ '[' 23 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=22
+ '[' 22 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=21
+ '[' 21 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=20
+ '[' 20 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=19
+ '[' 19 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=18
+ '[' 18 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=17
+ '[' 17 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=16
+ '[' 16 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=15
+ '[' 15 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=14
+ '[' 14 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=13
+ '[' 13 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=12
+ '[' 12 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=11
+ '[' 11 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=10
+ '[' 10 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=9
+ '[' 9 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=8
+ '[' 8 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=5589
+ '[' -z 5589 ']'
+ sleep 4
+ echo 'Please wait ... shutdown is running'
Please wait ... shutdown is running
+ NB=7
+ '[' 7 -gt 0 ']'
++ pidof wait_for_clean.sh
+ PID=
+ '[' -z '' ']'
+ sleep 2
+ break
+ '[' 7 -eq 0 ']'
+ /sbin/log_tool -t 0 -a 'myHD was stopped ... '
+ echo 'myHD was stopped ... '
myHD was stopped ...
+ restore_swaps
+ echo 'restore swaps /dev/xxx put off by systemd at myHD stop'
restore swaps /dev/xxx put off by systemd at myHD stop
+ NB=3
+ IFS=
+ read -r line
+ grep -q /dev/md321 /proc/swaps
+ '[' 1 -ne 0 ']'
+ echo 'Restore /dev/md321 swaps'
Restore /dev/md321 swaps
+ swapon -p 3 /dev/md321
+ NB=2
+ '[' 2 -lt 0 ']'
+ IFS=
+ read -r line
+ grep -q /dev/md256 /proc/swaps
+ '[' 1 -ne 0 ']'
+ echo 'Restore /dev/md256 swaps'
Restore /dev/md256 swaps
+ swapon -p 2 /dev/md256
+ NB=1
+ '[' 1 -lt 0 ']'
+ IFS=
+ read -r line
+ grep -q /dev/md322 /proc/swaps
+ '[' 1 -ne 0 ']'
+ echo 'Restore /dev/md322 swaps'
Restore /dev/md322 swaps
+ swapon -p 1 /dev/md322
+ NB=0
+ '[' 0 -lt 0 ']'
+ IFS=
+ read -r line
+ grep -q /share/CE_CACHEDEV1_DATA/.swap/qnap_swap /proc/swaps
+ '[' 0 -ne 0 ']'
+ IFS=
+ read -r line
[admin@nas01 ~]#
4. Now I run the install process again (with all traces). And it stops on the same position. I don't understand it.

Code: Select all

[admin@nas01 myHD_delivery]# ./myHD_0.5.qpkg_with_trace
Install QNAP package on TS-NAS ...
myHD.tgz
8820+1 records in
8820+1 records out
3598781 bytes (3.4MB) copied, 0.030435 seconds, 112.8MB/s
qinstall.sh
qpkg.cfg
+ rm -f /share/Public/.myHD_trace_qinstall
+ find_base
++ /sbin/getcfg SHARE_DEF defPublic -d Public -f /etc/config/def_share.info
+ PUBLIC_SHARE=Public
+ QPKG_BASE=
++ /sbin/getcfg Public path -f /etc/config/smb.conf
+ publicdir=/share/CE_CACHEDEV1_DATA/Public
+ '[' '!' -z /share/CE_CACHEDEV1_DATA/Public ']'
+ '[' -d /share/CE_CACHEDEV1_DATA/Public ']'
++ /bin/echo /share/CE_CACHEDEV1_DATA/Public
++ /bin/cut -d / -f 2
+ publicdirp1=share
++ /bin/echo /share/CE_CACHEDEV1_DATA/Public
++ /bin/cut -d / -f 3
+ publicdirp2=CE_CACHEDEV1_DATA
++ /bin/echo /share/CE_CACHEDEV1_DATA/Public
++ /bin/cut -d / -f 4
+ publicdirp3=Public
+ '[' '!' -z share ']'
+ '[' '!' -z CE_CACHEDEV1_DATA ']'
+ '[' '!' -z Public ']'
+ '[' -d /share/CE_CACHEDEV1_DATA/Public ']'
+ QPKG_BASE=/share/CE_CACHEDEV1_DATA
+ '[' -z /share/CE_CACHEDEV1_DATA ']'
+ '[' -z /share/CE_CACHEDEV1_DATA ']'
+ QPKG_INSTALL_PATH=/share/CE_CACHEDEV1_DATA/.qpkg
+ QPKG_DIR=/share/CE_CACHEDEV1_DATA/.qpkg/myHD
+ test_hdstation
++ /sbin/getcfg HD_Station Install_Path -d xxx -f /etc/config/qpkg.conf
+ HDS_PATH=/share/CE_CACHEDEV1_DATA/.qpkg/HD_Station
+ '[' /share/CE_CACHEDEV1_DATA/.qpkg/HD_Station = xxx ']'
+ echo 'Start log'
+ UPDATE_FLAG=0
+ '[' -f ./myHD.tgz ']'
+ /sbin/log_tool -t 0 -a ' myHD New or Update installation'
+ rm -f /root/.myHD_lock
+ '[' '!' -e /share/CE_CACHEDEV1_DATA/.qpkg/myHD ']'
+ UPDATE_FLAG=1
+ /etc/init.d/myHD.sh stop
5. And now I cannot use the commands myHD stop[start,status] anymore. It happens nothing (no output).

6. Also the command "kill -9 $(pidof jchroot)" found no process/pid to kill.

First if I reboot the NAS again, I can work with myHD again (see point 2).

Best regards
tarkett
My environment:
* NAS Qnap TVS-682 with 4.3.5.0722 + myHD Version 0.5.1 (Ubuntu 1804) with mykodi18
* Samsung TV connected via HDMI to NAS + Samsung Soundbar is connected via Bluetooth to the TV
User avatar
philippe
Site Admin
Posts: 150
Joined: Mon Apr 16, 2018 3:10 pm
Has thanked: 2 times
Been thanked: 15 times

Re: [myHD 0.5] RC2 version ... Add Ubuntu 1804 Bionic

Post by philippe » Thu Oct 11, 2018 1:44 pm

Hi,

It's really strange ... can you continue to help me ... or I can suggest a work around
BEFORE did you introduce in the existing myHD.sh the set -x as explain in 3 posts before this one ... (change one line in existing myHD.sh)

1 continue helping me (remember I can't reproduce the problem on my x53 pro nor on my TVS-x73 ... so)
... in this case I will prepare a new trace qpkg adding trace for myHD.sh include
... but please can you try to see if a myHD.sh is running when myHD refuse to answer and works (ps -eaf | grep myHD.sh)

2 work around
... removing the QPKG in fact don't remove the existing Ubuntu environment (it's why I have added a uninstall option in myHD itself)
... so remove the QPKG using App. Center
... install 0.5 as a fresh install ... normally they use the existing Ubuntu environment (so you don't lost anything)
... by security you can also do a save of the environment (after stopping myHD and removing QPKG and BEFORE installing the new version)
cd /share/CACHEDEV1_DATA /
tar czf myHD_env.tgz .myHD

I am sorry to annoying you ... but I can't reproduce the problem ... so difficult to understand ...
Philippe.
QNAP / Asustor package integrator
User avatar
philippe
Site Admin
Posts: 150
Joined: Mon Apr 16, 2018 3:10 pm
Has thanked: 2 times
Been thanked: 15 times

Re: [myHD 0.5] RC2 version ... Add Ubuntu 1804 Bionic

Post by philippe » Thu Oct 11, 2018 2:10 pm

Hi,
[EDIT] just updated trace-v1 ... with a patch to avoid race condition in myHD.sh ... perhaps it's not the problem perhaps it is ...
If you choice to continue helping me ...
The new qpkg (with trace for myHD.sh stop) is here : JUST NAME is changed to avoid confusion (it'a temporary only for this case)
use right click / then download the link ...
https://www.father-mande.ovh/Q/qpkg/myH ... h_trace-v1

Philippe.
These users thanked the author philippe for the post:
tarkett (Thu Oct 11, 2018 5:23 pm)
Rating: 50%
QNAP / Asustor package integrator
User avatar
philippe
Site Admin
Posts: 150
Joined: Mon Apr 16, 2018 3:10 pm
Has thanked: 2 times
Been thanked: 15 times

Re: [myHD 0.5.1] RC2 version ... Add Ubuntu 1804 Bionic

Post by philippe » Thu Oct 11, 2018 2:57 pm

Hi,

Update 0.5.1 for solving some bugs and add trace when you install manually myHD QPKG
[Version]
R.C. 2 : 0.5.1
... clean shell and solve potential bugs
... CHANGE installation shell to :
... ... solve a potential problem for system with high level CPU (race condition)
... ... ADD trace in manual installation mode (exec .qpkg in a console) on demand
... ... ... to get it just do : touch /share/Public/.myHD_trace_qinstall (this file will be deleted when you run the .qpkg file
... ... ADD trace in myHD command (use only in case of problem on a command)
... ... ... to get it just do : touch /share/Public/.myHD_trace_run (this is for one command ... file is deleted after the last myHD command ... )
... IN case of low internet connection use the pre-download shell to prepare installation and reduce install time : viewtopic.php?f=27&t=1564#p1761
Philippe.
QNAP / Asustor package integrator
tarkett
Posts: 15
Joined: Tue May 29, 2018 7:19 pm
Has thanked: 2 times
Been thanked: 2 times

Re: [myHD 0.5] RC2 version ... Add Ubuntu 1804 Bionic

Post by tarkett » Thu Oct 11, 2018 5:30 pm

philippe wrote:
Thu Oct 11, 2018 2:10 pm
Hi,
[EDIT] just updated trace-v1 ... with a patch to avoid race condition in myHD.sh ... perhaps it's not the problem perhaps it is ...
If you choice to continue helping me ...
The new qpkg (with trace for myHD.sh stop) is here : JUST NAME is changed to avoid confusion (it'a temporary only for this case)
use right click / then download the link ...
https://www.father-mande.ovh/Q/qpkg/myH ... h_trace-v1

Philippe.
CONGRATULATION :mrgreen: :mrgreen: :mrgreen:
This package will be installed without any problem and seems updated to Version 0.5 (shown in QTS).
And also the myHD commands works like a charm.

Now I will update to 0.5.1 and Ubuntu 1804 :)

Best regards
tarkett
These users thanked the author tarkett for the post:
philippe (Thu Oct 11, 2018 6:10 pm)
Rating: 50%
My environment:
* NAS Qnap TVS-682 with 4.3.5.0722 + myHD Version 0.5.1 (Ubuntu 1804) with mykodi18
* Samsung TV connected via HDMI to NAS + Samsung Soundbar is connected via Bluetooth to the TV
User avatar
philippe
Site Admin
Posts: 150
Joined: Mon Apr 16, 2018 3:10 pm
Has thanked: 2 times
Been thanked: 15 times

Re: [myHD 0.5.1] RC2 version ... Add Ubuntu 1804 Bionic

Post by philippe » Thu Oct 11, 2018 5:39 pm

Hi,
whew !!!! ... thanks for your help

The problem with "race condition" is when you don't manage all the element ... I can have a view on my QPKG but absolutely NOT on HD_Station / Q.T.S. part ... so ... we are oblige to multiply verification and the code grow even not necessary ...

To add 1804 You can update to 0.5.1. (to be up to date) ... but, after, the best is to use myHD switch_ubuntu_env 1804
... with this install 1804 then switch to 1804 but you can change at any time by doing same command with 1604 or 1804 ... in this case no extra install are done ...
myHD status ... write the running version

F.Y.I. in 1804 works as expected ... in the future 1604 will be stopped ... but 1804 is in ALPHA state at this time.

Again, lot of thanks for your help.

Philippe.
QNAP / Asustor package integrator
Post Reply