Upgrade failed for Synology - port 9981 already in use
Added by Greg Miller over 3 years ago
I just tried to update ffmpeg and tvheadend (4.3.20210612-29) on my Synology NAS. After the update the CPU stayed at 99% and I couldn't access the tvheadend page. I restarted the NAS but the problem persisted. I uninstalled both, restarted, then attempted to install but it failed with an error that port 9981 was either in use by another app or reserved by the system. Restarted and retried with same result. So first I would like to know how to clear the port, and second I hope th0ma7 ^ will be able to fix whatever caused this. For now no tvheadend...
Thanks for any help.
Edit: I don't see any suspicious application but I don't really know what to look for.
Greg@DiskStation:/$ pstree
init─┬─avahi-daemon
├─crond
├─2*[dbus-daemon]
├─dms───6*[{dms}]
├─findhostd
├─getty
├─hotplugd
├─httpd─┬─httpd
│ └─2*[httpd───2*[{httpd}]]
├─lighttpd
├─minissdpd
├─nginx───nginx
├─nmbd
├─ntpd───{ntpd}
├─postgres───4*[postgres]
├─python2.7─┬─2*[python2.7]
│ └─{python2.7}
├─s2s_daemon
├─scemd───7*[{scemd}]
├─sh───syno_ip_conflic
├─smbd─┬─cleanupd
│ └─smbd-notifyd
├─snmpd
├─sshd───sshd───sshd───sh───pstree
├─synobackupd
├─synocgid
├─synoconfd───{gdbus}
├─synocrond
├─synoelasticd───10*[{synoelasticd}]
├─synoindexd─┬─synoindexplugin
│ ├─synoindexscand
│ ├─synoindexworker
│ └─synomediaparser
├─synologaccd
├─synologand───3*[{synologand}]
├─synologrotated
├─synomkflvd
├─synomkthumbd
├─synonetd───2*[{synonetd}]
├─synopyntlmd
├─synoscgi_______─┬─SYNO.Finder.Fil
│ └─5*[synoscgi_______]
├─synosnmpcd
├─synostoraged───2*[synostoraged]
├─syslog-ng───6*[{syslog-ng}]
├─syslog-ng───8*[{syslog-ng}]
├─thumbd─┬─10*[thumbd]
│ └─2*[{thumbd}]
├─udevd
├─usb-copyd───4*[{usb-copyd}]
└─2*[vmtouch]
Greg@DiskStation:/$
Replies (5)
RE: Upgrade failed for Synology - port 9981 already in use - Added by saen acro over 3 years ago
Suspicious application can be seen with
netstat -lpnt
RE: Upgrade failed for Synology - port 9981 already in use - Added by Greg Miller over 3 years ago
Thanks - that makes sense. I'm still not seeing anything suspicious.
Greg@DiskStation:/$ sudo netstat -lpnt
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
Password:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:5000 0.0.0.0:* LISTEN 8269/nginx: master
tcp 0 0 0.0.0.0:5001 0.0.0.0:* LISTEN 8269/nginx: master
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 8289/smbd
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 8269/nginx: master
tcp 0 0 172.16.172.200:50001 0.0.0.0:* LISTEN 9621/dms
tcp 0 0 0.0.0.0:50002 0.0.0.0:* LISTEN 9898/lighttpd
tcp 0 0 0.0.0.0:57654 0.0.0.0:* LISTEN 12074/python2.7
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 6196/sshd
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 7924/postgres
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 8269/nginx: master
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 8289/smbd
tcp6 0 0 :::8008 :::* LISTEN 12074/python2.7
tcp6 0 0 :::5000 :::* LISTEN 8269/nginx: master
tcp6 0 0 :::5001 :::* LISTEN 8269/nginx: master
tcp6 0 0 :::139 :::* LISTEN 8289/smbd
tcp6 0 0 :::5005 :::* LISTEN 10207/httpd
tcp6 0 0 :::80 :::* LISTEN 8269/nginx: master
tcp6 0 0 :::22 :::* LISTEN 6196/sshd
tcp6 0 0 :::443 :::* LISTEN 8269/nginx: master
tcp6 0 0 :::445 :::* LISTEN 8289/smbd
Greg@DiskStation:/$
RE: Upgrade failed for Synology - port 9981 already in use - Added by saen acro over 3 years ago
Greg Miller wrote:
Thanks - that makes sense. I'm still not seeing anything suspicious.
Greg@DiskStation:/$ sudo netstat -lpnt We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. Password: Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:5000 0.0.0.0:* LISTEN 8269/nginx: master tcp 0 0 0.0.0.0:5001 0.0.0.0:* LISTEN 8269/nginx: master tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 8289/smbd tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 8269/nginx: master tcp 0 0 172.16.172.200:50001 0.0.0.0:* LISTEN 9621/dms tcp 0 0 0.0.0.0:50002 0.0.0.0:* LISTEN 9898/lighttpd tcp 0 0 0.0.0.0:57654 0.0.0.0:* LISTEN 12074/python2.7 tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 6196/sshd tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 7924/postgres tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 8269/nginx: master tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 8289/smbd tcp6 0 0 :::8008 :::* LISTEN 12074/python2.7 tcp6 0 0 :::5000 :::* LISTEN 8269/nginx: master tcp6 0 0 :::5001 :::* LISTEN 8269/nginx: master tcp6 0 0 :::139 :::* LISTEN 8289/smbd tcp6 0 0 :::5005 :::* LISTEN 10207/httpd tcp6 0 0 :::80 :::* LISTEN 8269/nginx: master tcp6 0 0 :::22 :::* LISTEN 6196/sshd tcp6 0 0 :::443 :::* LISTEN 8269/nginx: master tcp6 0 0 :::445 :::* LISTEN 8289/smbd Greg@DiskStation:/$
There is possible conflict elswhere.
See other modules or config files.
RE: Upgrade failed for Synology - port 9981 already in use - Added by Marcel L over 3 years ago
I had the same problem.
My fix:
aktivate: Telnet + SSH in your Diskstation.
open windows cmd and write:
ssh your-admin-account@your-synology-ip -p your-ssh-port
get root:
sudo -i
then i have write:
cd /usr/local/etc
then i have write:
dir
there is a file named: services.d
i have checked what is in these file:
cd services.d
dir
i had the line: tvheadend.sc
Then i have remove it:
rm tvheadend.sc
And the installation was success.
I hope this helps.
RE: Upgrade failed for Synology - port 9981 already in use - Added by Greg Miller over 3 years ago
Yes, that did it. Thanks. The earlier output was through SSH so no problem doing it, other than I substituted "ls" for "dir". In fact I haven't found how to get into terminal from the DSM GUI so that is the only way I know.
It appears that the file tvheadend.sc was not removed by the uninstall script, or at least that is my best guess. I hope th0ma7 picks up on this.
Thanks again.