Hangs on shutdown after installing and running serviio

Bug #1456730 reported by Elfy
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

Ran serviio during the vivid cycle with no problem - either using systemd or upstart.

Installed wily.

Grabbed,extracted serviio from http://download.serviio.org/releases/serviio-1.5.2-linux.tar.gz

Installed openjdk-8-jre.

Set ~/serviio-1.5.2/bin/serviio.sh and ~/serviio-1.5.2/bin/serviio-console.sh to run at start.

Reboot using systemd,serviio starts.

Reboot hangs for 90s.

Kill java tasks associated with serviio - reboot takes place in time expected.

Boot with upstart - reboot takes place in time expected.

ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: systemd 219-9ubuntu1 [modified: usr/share/dbus-1/system-services/org.freedesktop.systemd1.service]
ProcVersionSignature: Ubuntu 3.19.0-17.17-generic 3.19.6
Uname: Linux 3.19.0-17-generic x86_64
ApportVersion: 2.17.2-0ubuntu1
Architecture: amd64
CurrentDesktop: XFCE
Date: Tue May 19 18:19:40 2015
InstallationDate: Installed on 2015-05-12 (6 days ago)
InstallationMedia: Xubuntu 15.10 "Wily Werewolf" - Alpha amd64 (20150512)
MachineType: NOVATECH LTD MBB-44608
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.19.0-17-generic root=UUID=6bcbfcc1-c493-4dbe-9421-ef270047a82a ro quiet splash
SourcePackage: systemd
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 06/19/2014
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: F5
dmi.board.asset.tag: To be filled by O.E.M.
dmi.board.name: H81M-DS2V
dmi.board.vendor: Gigabyte Technology Co., Ltd.
dmi.board.version: To be filled by O.E.M.
dmi.chassis.asset.tag: 7383241-001
dmi.chassis.type: 3
dmi.chassis.vendor: NOVATECH LTD
dmi.chassis.version: V1.0
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrF5:bd06/19/2014:svnNOVATECHLTD:pnMBB-44608:pvrV1.0:rvnGigabyteTechnologyCo.,Ltd.:rnH81M-DS2V:rvrTobefilledbyO.E.M.:cvnNOVATECHLTD:ct3:cvrV1.0:
dmi.product.name: MBB-44608
dmi.product.version: V1.0
dmi.sys.vendor: NOVATECH LTD

Revision history for this message
Elfy (elfy) wrote :
Revision history for this message
Juston Li (jhli) wrote :

How are you setting serviio.sh and serviio-console.sh to run at start?

I was able to get serviio to run on start by adding the scripts to Application Autostart in the Session and Startup application.

Revision history for this message
Elfy (elfy) wrote :

Not sure it matters how it's starting - that's not the problem ;)

As it is either from autostarting or manually - the hang on shutdown remains the same

Revision history for this message
Juston Li (jhli) wrote :

Ahh sorry, misunderstood. Thought it was hanging on the subsequent boot startup but it is on shutdown.

Okay so regardless of how serviio is starts, if it is running when a shutdown/reboot is issued it hangs up shutdown.
I'll give it a try when I'm at my desktop in several hours.

Revision history for this message
Elfy (elfy) wrote :

ack - just to reiterate - worked fine in 15.04 (and assuming it still does), issue appears only with 15.10

Revision history for this message
Juston Li (jhli) wrote :

It actually hangs for me on a fresh install of 15.04 along with 15.10
Attached journal log from 15.10.

The issue seems to be the inability to terminate the serviio.sh java process (PID1848)
Line 24190 is where the hang ends after the job to stop session-c1.scope times out:

Jun 04 17:35:32 m51ac-x systemd[1]: session-c1.scope stopping timed out. Killing.
Jun 04 17:35:32 m51ac-x systemd[1]: session-c1.scope changed stop-sigterm -> stop-sigkill

sigkill takes care of the process and shutdown can continue.
Note: serviio-console.sh is PID1918 and gets terminated much earlier on line 23124

It might be a bug with serviio but as you mentioned, the processes can be killed before shutdown,
no problem handling sigterm sent from terminal.

Revision history for this message
Juston Li (jhli) wrote :

I also tried stopping the session manually with systemctl and it
works fine. Attached the log.
It only shows the upstart per-session process dying thus stopping
the session, unlike the shutdown log above in which the stop task
for the session continues with serviio-console.sh and xfdesktop
exiting in failure before timing out and having to SIGKILL serviio.sh

Martin Pitt (pitti)
summary: - Hang after installing and running serviio
+ Hangs on shutdown after installing and running serviio
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in systemd (Ubuntu):
status: New → Confirmed
Changed in systemd (Ubuntu):
importance: Undecided → High
Revision history for this message
Martin Pitt (pitti) wrote :

Thanks Juston. I assume serviio shuts down cleanly while the network is still up?

It does seem to hang when it's already down, at shutdown. The order of events apparently is

Jun 04 17:34:02 m51ac-x systemd[1]: Received SIGCHLD from PID 1918 (java).
Jun 04 17:34:02 m51ac-x systemd[1]: Child 1918 (java) died (code=exited, status=1/FAILURE)
Jun 04 17:34:02 m51ac-x systemd[1]: Child 1918 belongs to session-c1.scope

Jun 04 17:34:02 m51ac-x systemd[1]: Stopping Network.
Jun 04 17:34:02 m51ac-x NetworkManager[721]: <info> (eth0): link disconnected
Jun 04 17:34:02 m51ac-x systemd[1]: Stopped Network Manager.

Jun 04 17:35:32 m51ac-x systemd[1]: Received SIGCHLD from PID 1848 (java).
Jun 04 17:35:32 m51ac-x systemd[1]: Child 1848 (java) died (code=killed, status=9/KILL)
Jun 04 17:35:32 m51ac-x systemd[1]: Child 1848 belongs to session-c1.scope
Jun 04 17:35:32 m51ac-x systemd[1]: session-c1.scope: cgroup is empty
Jun 04 17:35:32 m51ac-x systemd[1]: session-c1.scope changed stop-sigkill -> failed

i. e first the session gets terminated, NetworkManager stops (and with it the network), and eventually the hanging pid 1848 child gets killed as it doesn't terminate properly.

I don't have an off-hand idea how to fix that (serviio shouldn't hang forever, but we don't have control about that).

Changed in systemd (Ubuntu):
importance: High → Medium
Revision history for this message
Kev Bowring (flocculant) wrote :

I've found that the hang actually only occurs when serviio console is running.

Just having running serviio - reboot works as expected.

Revision history for this message
Kev Bowring (flocculant) wrote :

Reinstalled to /opt

Added /lib/systemd/system/serviio.service with

[Unit]
Description=Serviio Media Server
After=syslog.target local-fs.target network.target

[Service]
Type=simple
User=serviio
Group=serviio
ExecStart=/opt/serviio/bin/serviio.sh
ExecStop=/opt/serviio/bin/serviio.sh -stop
KillMode=none
Restart=on-abort

[Install]
WantedBy=multi-user.target

Enabled and started service.

Small script to start the console added to startup

#!/bin/sh
/opt/serviio/bin/serviio-console.sh
exit 0

No further issues with shutdowns or reboots

(http://wiki.serviio.org/doku.php?id=howto:linux:install:ubuntu15-04)

Dan Streetman (ddstreet)
Changed in systemd (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.