FAQ  •  Register  •  Login

Ubuntu 12.04 Serviio daemon script stop error

<<

sijaffer

Serviio newbie

Posts: 3

Joined: Sun Sep 30, 2012 7:33 pm

Post Sun Sep 30, 2012 11:19 pm

Ubuntu 12.04 Serviio daemon script stop error

Hi guys,

I have installed Serviio on Ubuntu 12.04 64bit and need a proper daemon script. i get errors on the one I have used from the forum that relates to the linux daemon scripts. Here is what happens when I run sudo services serviio stop

* Stopping Serviio media server daemon Serviio Media Server /etc/init.d/serviio: 42: [: x1 889: unexpected operator
/etc/init.d/serviio: 42: [: x1: unexpected operator
/etc/init.d/serviio: 42: [: x889: unexpected operator
/etc/init.d/serviio: 77: /etc/init.d/serviio: let: not found
/etc/init.d/serviio: 42: [: x1 889: unexpected operator
[fail]

after this my eth0 card gets disabled and the serviio goes in a loop trying to find a network connection showing the messages below in the serviio.log:

2012-09-29 22:24:32,534 INFO [MediaServer] Serviio server instance is already running
2012-09-29 22:24:34,326 WARN [DiscoveryAdvertisementNotifier] Could not advertise the device on any available NIC, will try again
2012-09-29 22:24:39,326 WARN [DiscoveryAdvertisementNotifier] Could not advertise the device on any available NIC, will try again

is there a proper daemon script for Ubuntu 12.04 that can start/stop etc the service on boot after the external USB devices in mounted/loaded (all my media is on the external device?

Also I am not an advanced linux/ubuntu user and need to get some step by step instruction on creating a functional user account for the serviio services to run instead of root.

your help will be greatly appreciated!!

Regards
Sameer Jaffer
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17212

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Oct 01, 2012 4:14 pm

Re: Ubuntu 12.04 Serviio daemon script stop error

<<

Spadge

Serviio lover

Posts: 58

Joined: Sun Sep 23, 2012 5:22 pm

Post Mon Oct 01, 2012 6:57 pm

Re: Ubuntu 12.04 Serviio daemon script stop error



That script is fine if you want to run Serviio as root.

If you don't, try adding setuid and setgid into the mix between the 'start on' and 'script' stanzas.

If you want Serviio to start on a disk mount, then stop again on disk umount, just ask one of us to look into writing you a script. Or you could try the ubuntu forums for the flavour you use.

I am sure there's a few people here who would enjoy the challenge.

For instance, you could try something like this:

  Code:
# Serviio - media server
#
# Serviio is a free media server. It allows you to stream your media files
# (music, video or images) to renderer devices (e.g. a TV set, Bluray player,
# games console or mobile phone) on your connected home network.

start on        block-device-added

script
   if [ `blkid $DEV` -eq "YOUR-USBDRIVES-UUID" ]; then
      exec /usr/local/bin/serviio/bin/serviio.sh
   fi
end script


blkid has to be run as root, so no changing uid/gid in the above example. Also, there is no 'stop on' as I haven't looked in to how to do that.
<<

Spadge

Serviio lover

Posts: 58

Joined: Sun Sep 23, 2012 5:22 pm

Post Mon Oct 01, 2012 7:23 pm

Re: Ubuntu 12.04 Serviio daemon script stop error

Or if you wanted to be cleverer, and you had the USB drive auto-mount to a specific place (in fstab) each time you plug it in, you could possibly do something like:

  Code:
# Serviio - media server
#
# Serviio is a free media server. It allows you to stream your media files
# (music, video or images) to renderer devices (e.g. a TV set, Bluray player,
# games console or mobile phone) on your connected home network.

start on        mounted MOUNTPOINT=/path/to.your.usb/
stop on         unmounted MOUNTPOINT=/path/to.your.usb/

# If you don't want to run Serviio as root
# uncomment the following lines and replace <WHATEVER> with user and group
#setuid <user>
#setgid <group>

script
      exec /usr/local/bin/serviio/bin/serviio.sh
end script


However, I have no idea if that'll even work.
<<

sijaffer

Serviio newbie

Posts: 3

Joined: Sun Sep 30, 2012 7:33 pm

Post Fri Oct 05, 2012 9:41 am

Re: Ubuntu 12.04 Serviio daemon script stop error

Thanks guys, I will try these instructions, also are there any step by step instruction on creating a functional user account for the serviio services to run instead of root. A user tha does not show up on the login screen and I can only use for serviio service?
<<

Spadge

Serviio lover

Posts: 58

Joined: Sun Sep 23, 2012 5:22 pm

Post Sat Oct 06, 2012 11:48 am

Re: Ubuntu 12.04 Serviio daemon script stop error

I don't know about a walkthrough, but you basically just set up an account and run Serviio as that account.

An easy way to do this is to use the command "adduser --system --group --no-create-home serviio" in your ubuntu terminal. This will create the user and group "serviio" without a /home/directory and no shell or login rights, which you can then use to run your Serviio daemon.

Just make sure that the account you are using to run Serviio has all the right permissions in all the right places.

Return to Serviio Support & Help

Who is online

Users browsing this forum: No registered users and 35 guests

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