FAQ  •  Register  •  Login

Linux Daemon scripts

<<

zip

User avatar

Serviio developer / Site Admin

Posts: 16499

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sun Mar 08, 2015 12:43 pm

Re: Linux Daemon scripts

thanks, why not update the wiki one?
<<

mellowcandle

Serviio newbie

Posts: 2

Joined: Fri May 01, 2015 1:55 pm

Post Fri May 01, 2015 2:02 pm

Re: Linux Daemon scripts

I got mine working perfectly on Linux mint. should work on all Debian like machines.

I shared the code here.
https://nativeguru.wordpress.com/2015/05/01/linux-serviio-start-up-script/
<<

ryczypior

Serviio newbie

Posts: 1

Joined: Sat May 14, 2016 5:21 pm

Post Sat May 14, 2016 5:33 pm

Re: Linux Daemon scripts

Yes, I know this is old topic, but for newest ubuntu 16.04 none of above works for me.

I've created a simple service script for systemd:

1. Create file /lib/systemd/system/serviio.service (as root - sudo):
  Code:
$ sudo touch /lib/systemd/system/serviio.service


2. Put these lines of code into created file:
  Code:
[Unit]
Description=Serviio daemon

[Service]
Type=simple
Environment=statedir=/opt/serviio #path to serviio environment
ExecStart=/opt/serviio/bin/serviio.sh #path to serviio.sh on your FS

[Install]
WantedBy=multi-user.targetroot


3. Enable service for autostart:
  Code:
sudo systemctl enable serviio.service


From now, you should be able to do for start serviio service:
  Code:
sudo service serviio start

and for for stop serviio service:
  Code:
sudo service serviio stop


Also status and restart should work.

If your OS uses systemd, it should works for you :)
<<

worric

Serviio newbie

Posts: 1

Joined: Fri Jul 22, 2016 5:01 pm

Post Fri Jul 22, 2016 5:23 pm

Re: Linux Daemon scripts

ryczypior wrote:Yes, I know this is old topic, but for newest ubuntu 16.04 none of above works for me.

I've created a simple service script for systemd:

1. Create file /lib/systemd/system/serviio.service (as root - sudo):
  Code:
$ sudo touch /lib/systemd/system/serviio.service


2. Put these lines of code into created file:
  Code:
[Unit]
Description=Serviio daemon

[Service]
Type=simple
Environment=statedir=/opt/serviio #path to serviio environment
ExecStart=/opt/serviio/bin/serviio.sh #path to serviio.sh on your FS

[Install]
WantedBy=multi-user.targetroot


3. Enable service for autostart:
  Code:
sudo systemctl enable serviio.service


From now, you should be able to do for start serviio service:
  Code:
sudo service serviio start

and for for stop serviio service:
  Code:
sudo service serviio stop


Also status and restart should work.

If your OS uses systemd, it should works for you :)


I just created this account to comment on this post. First of all, that you very much for providing this code, it really helped me understand how services are managed in systemd-based distributions. However, I can say that for the "enable"-command to work properly on my new Ubuntu Server 16.04.1 install, I had to remove the "root" at the very end of the last line in the serviio.service file. I found out by navigating to /etc/systemd/system and discovering that there was no multi-user.targetroot.wants directory. There was a directory named multi-user.target.wants, however, and after removing "root" in the service file, the sudo systemctl enable serviio.service worked flawlessly, and serviio does indeed start correctly at boot.

So just to clarify, the following code works on my system:
  Code:
[Unit]
Description=Serviio daemon

[Service]
Type=simple
Environment=statedir=/opt/serviio #path to serviio environment
ExecStart=/opt/serviio/bin/serviio.sh #path to serviio.sh on your FS

[Install]
WantedBy=multi-user.target
Previous

Return to Third-party tools integration

Who is online

Users browsing this forum: No registered users and 1 guest

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