FAQ  •  Register  •  Login

[SOLVED] Systemd/systemctl service file for serviio

<<

shashchatter

Serviio newbie

Posts: 12

Joined: Sat Jan 14, 2012 8:04 pm

Post Sat Jan 14, 2012 8:39 pm

[SOLVED] Systemd/systemctl service file for serviio

Hi,

If this helps somebody else, here's a simple file that allows serviio start/stop on systemd-compatible systems.

I am using Fedora 16. My serviio distribution is installed under "/opt/serviio/serviio-0.6.16". I have create a user "serviio" and a group "serviio", and all the files under /opt/serviio are owned by this user and group.

To use this:
- put the content below in "/lib/systemd/system/serviio.service"
#-- Start of serviio.service file --
# Systemd unit file for serviio
#

[Unit]
Description=Serviio DLNA/uPNP server
After=syslog.target network.target

[Service]
Type=forking
ExecStart=/sbin/runuser -l serviio -c "/opt/serviio/serviio-0.6.1/bin/serviio.sh &"
ExecStop=/sbin/runuser -l serviio -c "/opt/serviio/serviio-0.6.1/bin/serviio.sh -stop &"

[Install]
WantedBy=multi-user.target
#-- End of serviio.service file --
- enable the serviio service: "systemctl enable serviio.service". it will automatically start after reboots.
- To manually stop the service: "systemctl stop serviio.service"
- To manually start the service: "systemctl start serviio.service"
- To check status: "systemctl status serviio.service"


Hope this helps!
Shash
<<

Cerberus

User avatar

DLNA master

Posts: 4114

Joined: Sun Jan 02, 2011 5:20 pm

Location: Reading, UK

Post Sun Jan 15, 2012 7:43 am

Re: [SOLVED] Systemd/systemctl service file for serviio

serviio -start and serviio -stop ;)
Phil Bennett
Beta Tester Group
Wiki | FAQ

Samsung LE40C750 LCD | Samsung BD-C5900 | Sony PS3 | Windows 7 |
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

SamSpade

Serviio newbie

Posts: 2

Joined: Sun Nov 11, 2012 1:31 am

Post Sun Nov 11, 2012 2:10 am

Re: [SOLVED] Systemd/systemctl service file for serviio

Here's the complete installation process and alternative serviio.service file for Arch Linux 3.6.6 onwards (with systemd). This applies to CLI-only or headless Arch Linux installations. Using the Serviio Console GUI will require more packages, of course.

Download Serviio 1.0.1 and instal in /usr/local (or other preferred directory):
  Code:
curl -O http://download.serviio.org/releases/serviio-1.0.1-linux.tar.gz
tar -C /usr/local -xvzf serviio-1.0.1-linux.tar.gz


Create 'serviio' username as a service account:
  Code:
useradd -r -U -d /usr/local/serviio-1.0.1  serviio


Let serviio own all files in its directories:
  Code:
chown -R serviio:serviio /usr/local/serviio-1.0.1


Install java and ffmpeg:
  Code:
pacman -S jre7-openjdk-headless ffmpeg
# The thumbnail routines also need the libraries in the following packages if they're not installed yet:
pacman -S fontconfig libcups


Create systemd service in /etc/systemd/service (not in multi-user.target.wants):
  Code:
#  /etc/systemd/system/serviio.service
[Unit]
Description=Serviio 1.0.1 Media Server
After=network.target

[Service]
User=serviio
ExecStart=/usr/local/serviio-1.0.1/bin/serviio.sh
ExecStop=/usr/local/serviio-1.0.1/bin/serviio.sh -stop
KillMode=none

[Install]
WantedBy=multi-user.target

This is what makes systemd so elegant, despite its birth pains ... no need for 'su -', tracking PID files and other complex startup scripts!

Enable the service for boot:
  Code:
systemctl enable serviio.service


As usual for systemd, to manually start and stop:
  Code:
systemctl start serviio.service
systemctl stop serviio.service
systemctl status serviio.service
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sun Nov 11, 2012 11:38 pm

Re: [SOLVED] Systemd/systemctl service file for serviio

Would be great if you could replicate it on the Wiki :-)
<<

sirkit

Streaming enthusiast

Posts: 31

Joined: Tue Apr 15, 2014 8:26 pm

Post Tue Apr 15, 2014 11:34 pm

Re: [SOLVED] Systemd/systemctl service file can not see vide

Thanks for the posts I managed to install serviio 1.4.1.2 on ARCH LINUX (CLI only) but I can not see my videos when I view my TV I install serviio to # /usr/local/serviio-1.4.1.2/

and my video file are located in /data500/
I did run a symlink by typing ln -s /data500/

then restarted serviio by typing systemctl restart serviio.service

but when I looked ar the tv still could not see any gilms in the video folder please could someone point me in the right direction, I am new to arch and have only used serviio on windows PC
<<

Ben Burke

Serviio newbie

Posts: 2

Joined: Sun Sep 27, 2015 4:57 am

Post Thu Oct 22, 2015 11:15 pm

Re: [SOLVED] Systemd/systemctl service file for serviio

Thanks you guys - I upgraded my Ubu recently and had to learn some systemd stuff. Great explanation.

Now to setup the web console, because I loose firing off X-sessions with nested logins 8-)


Ben
<<

ttguy

Serviio lover

Posts: 63

Joined: Sun May 27, 2012 10:52 am

Post Sun Aug 19, 2018 6:14 am

Re: [SOLVED] Systemd/systemctl service file for serviio

So there are two solutions in this thread. I just want to vote for the second one by SamSpade. That is what worked for me. This was on my Kubuntu 16.04 install. Just rebooted that machine after following the directions and Serviio was running without intervention. (I have my machine to log in with out a password - I dunno if that is relevant. But SamSpade has made me a happy camper.)
--
linux/Humax HDR-3000T

Return to Serviio Support & Help

Who is online

Users browsing this forum: Google [Bot] and 62 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.