SynoCommunity / spksrc

Cross compilation framework to create native packages for the Synology's NAS
https://synocommunity.com
Other
3.03k stars 1.23k forks source link

Synology DSM 7: New install of tvheadend not possible because of blocked port 9981 #4731

Closed thierolm closed 3 years ago

thierolm commented 3 years ago

Setup

Package Name: tvheadend Package Version: 4.3.20210612-29

NAS Model: DS218play NAS Architecture: DS218play - synology_rtd1296_ds218play DSM version: 7

Expected behavior

I want to do a clean new install of tvheadend

Actual behavior

I upgraded my Synology NAS DS218play to DSM Version 7. After this, tvheadend was updated but epg didn't work anymore. I decided to do an clean new install by deleting the tvheadend installation including all metadata and a new installation. After the deinstallation I did a reboot, but now I cannot install tvheadend any more. :-( During install of tvheadend, a message appears, stating that port 9981 is blocked by another application. But no other application is doing it.

Steps to reproduce

1. Delete old tvheadend package completely 2. Try to reinstall after rebooting the system

image

Package log

Package log

_Installer log: find logfile /var/log/packages/{package}.log, for DSM<6: /var/packages/{package}/target/var/{package}_installer.log and protocol in Package Center. You find service log and other log files in /var/packages/{package}/target/var. _

not available ...

Other logs

E.g. /var/log/messages or /var/log/synopkg.log

2021/07/11 13:58:37 download tvheadend https://packages.synocommunity.com/tvheadend/29/tvheadend.v29.f40000%5Brtd1296-armada37xx-aarch64%5D.spk?arch=rtd1296&build=41890 Begin download
2021/07/11 13:58:46 download tvheadend https://packages.synocommunity.com/tvheadend/29/tvheadend.v29.f40000%5Brtd1296-armada37xx-aarch64%5D.spk?arch=rtd1296&build=41890 End download
2021/07/11 14:08:48 download tvheadend https://packages.synocommunity.com/tvheadend/29/tvheadend.v29.f40000%5Brtd1296-armada37xx-aarch64%5D.spk?arch=rtd1296&build=41890 Begin download
2021/07/11 14:09:04 download tvheadend https://packages.synocommunity.com/tvheadend/29/tvheadend.v29.f40000%5Brtd1296-armada37xx-aarch64%5D.spk?arch=rtd1296&build=41890 End download

There is no port 9981 open:

thierolm@THIEROLF-NAS:/$ sudo netstat -tulpn | grep LISTEN
Password:
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      6276/nginx: master
tcp        0      0 192.168.178.16:50001    0.0.0.0:*               LISTEN      10868/dms
tcp        0      0 127.0.0.1:914           0.0.0.0:*               LISTEN      11495/httpd22
tcp        0      0 0.0.0.0:50002           0.0.0.0:*               LISTEN      11079/lighttpd
tcp        0      0 192.168.178.16:49170    0.0.0.0:*               LISTEN      11067/synoaudiod
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      6112/ftpd
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      3980/sshd: /usr/bin
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      8271/postgres
tcp        0      0 127.0.0.1:18617         0.0.0.0:*               LISTEN      12813/synovpcd
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      6276/nginx: master
tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      6232/smbd
tcp        0      0 0.0.0.0:6690            0.0.0.0:*               LISTEN      13737/syncd
tcp        0      0 192.168.178.16:49160    0.0.0.0:*               LISTEN      12813/synovpcd
tcp        0      0 0.0.0.0:5000            0.0.0.0:*               LISTEN      6276/nginx: master
tcp        0      0 0.0.0.0:5001            0.0.0.0:*               LISTEN      6276/nginx: master
tcp        0      0 0.0.0.0:554             0.0.0.0:*               LISTEN      12410/ssrtspserverd
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      6232/smbd
tcp        0      0 0.0.0.0:9901            0.0.0.0:*               LISTEN      6276/nginx: master
tcp        0      0 0.0.0.0:5357            0.0.0.0:*               LISTEN      6276/nginx: master
tcp6       0      0 :::80                   :::*                    LISTEN      6276/nginx: master
tcp6       0      0 :::21                   :::*                    LISTEN      6112/ftpd
tcp6       0      0 :::22                   :::*                    LISTEN      3980/sshd: /usr/bin
tcp6       0      0 :::443                  :::*                    LISTEN      6276/nginx: master
tcp6       0      0 :::3261                 :::*                    LISTEN      -
tcp6       0      0 :::445                  :::*                    LISTEN      6232/smbd
tcp6       0      0 :::3263                 :::*                    LISTEN      -
tcp6       0      0 :::3264                 :::*                    LISTEN      -
tcp6       0      0 :::6690                 :::*                    LISTEN      13737/syncd
tcp6       0      0 :::5000                 :::*                    LISTEN      6276/nginx: master
tcp6       0      0 :::5001                 :::*                    LISTEN      6276/nginx: master
tcp6       0      0 :::139                  :::*                    LISTEN      6232/smbd
tcp6       0      0 :::9901                 :::*                    LISTEN      6276/nginx: master
tcp6       0      0 :::5357                 :::*                    LISTEN      6276/nginx: master
thierolm commented 3 years ago

Duplicate to #4722

thierolm commented 3 years ago

After deleting tvheadend.sc in folder /usr/local/etc/services.d I was able to install tvheadend again. :-)

Seems like the tvheadend deinstall script is NOT considering all relevant config files ...

thierolm@THIEROLF-NAS:/usr/local/etc$ ll
total 80
drwxr-xr-x 20 root root 4096 Jul  9 12:37 .
drwxr-xr-x 11 root root 4096 Jul 11 16:18 ..
drwxr-xr-x  6 root root 4096 Jul  9 12:38 apache22
drwxr-xr-x  3 root root 4096 Jul  9 12:37 apache24
drwxr-xr-x  4 root root 4096 Jul  9 12:34 apparmor.d
drwxr-xr-x  5 root root 4096 Jul  9 12:33 certificate
drwxr-xr-x  2 root root 4096 Jul 10 18:57 csp
drwxr-xr-x  2 root root 4096 Jul 10 18:56 logrotate.d
drwxr-xr-x  6 root root 4096 Jul  9 12:27 nginx
drwxr-xr-x  5 root root 4096 Jul  9 12:43 php70
drwxr-xr-x  4 root root 4096 Sep 15  2019 php72
drwxr-xr-x  4 root root 4096 Sep 14  2019 php73
drwxr-xr-x  2 root root 4096 Aug 23  2019 rc.d
drwxr-xr-x  3 root root 4096 Jul 10 18:56 services.d
drwxr-x---  2 root root 4096 Jul 10 18:57 synocron.d
drwxr-xr-x  5 root root 4096 Jul 10 18:57 synocron_nonroot.d
drwxr-xr-x  2 root root 4096 Jul  9 12:27 synoschedule.d
drwx------  2 root root 4096 Aug 23  2019 synotifyd
drwxr-xr-x  2 root root 4096 Jul 10 18:55 synotokenmgr
drwxr-xr-x  3 root root 4096 Aug 23  2019 syslog-ng
thierolm@THIEROLF-NAS:/usr/local/etc$ cd services.d/
thierolm@THIEROLF-NAS:/usr/local/etc/services.d$ ll
total 60
drwxr-xr-x  3 root                root                4096 Jul 10 18:56 .
drwxr-xr-x 20 root                root                4096 Jul  9 12:37 ..
-rw-r--r--  1 AudioStation        AudioStation         395 Apr 15 10:19 AudioStation.sc
-rw-r--r--  1 DhcpServer          DhcpServer           287 Apr 23 11:14 DhcpServer.sc
-rw-r--r--  1 root                root                 703 Jul  9 12:40 DownloadStation.sc
-rw-r--r--  1 root                root                  77 Jul  9 13:29 MariaDB10.sc
-rw-r--r--  1 root                root                 394 Aug 23  2019 MediaServer.sc
-rw-r--r--  1 root                root                 592 May 24 14:26 ScsiTarget.sc
-rw-r--r--  1 root                root                 480 Jul  9 12:27 SMBService.sc
-rwxr-xr-x  1 SurveillanceStation SurveillanceStation  250 Jun 21 08:00 SurveillanceStation.sc
-rw-r--r--  1 root                root                 114 Aug 23  2019 SynologyDrive.sc
drwxr-xr-x  2 root                root                4096 Jul  9 13:29 tmp
-rw-r--r--  1 root                root                 110 Oct 18  2020 tvheadend.sc
-rw-r--r--  1 root                root                 262 Aug 23  2019 VideoStation.sc
-rw-r--r--  1 root                root                 182 Jul 10 18:56 WebStation.sc
thierolm@THIEROLF-NAS:/usr/local/etc/services.d$ servicetool --conf-port-conflict-check --tcp 9981
IsConflict: true        Port: 9981      Protocol: tcp   ServiceName: tvheadend
thierolm@THIEROLF-NAS:/usr/local/etc/services.d$ sudo rm -f ./tvheadend.sc
thierolm@THIEROLF-NAS:/usr/local/etc/services.d$ servicetool --conf-port-conflict-check --tcp 9981
IsConflict: false       Port: 9981      Protocol: tcp   ServiceName: (null)