Page 4 of 4

Re: Linux Daemon scripts

PostPosted: Sun Mar 08, 2015 12:43 pm
by zip
thanks, why not update the wiki one?

Re: Linux Daemon scripts

PostPosted: Fri May 01, 2015 2:02 pm
by mellowcandle
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/

Re: Linux Daemon scripts

PostPosted: Sat May 14, 2016 5:33 pm
by ryczypior
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 :)

Re: Linux Daemon scripts

PostPosted: Fri Jul 22, 2016 5:23 pm
by worric
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

Re: Linux Daemon scripts

PostPosted: Sat Jun 16, 2018 2:22 pm
by tibiscum
Ubuntu 18.04 LTS Server

Many thanks for zip (*special*), jtl, jopiexjoker [Page 1 code] and so many others.

I've put the code listed by jopiexjoker on my new Ubuntu 18.04 LTS Server (with JRE 1.8.0_171) and works very fine.
I've registred serviio as service by folowing cmd:

$ sudo /lib/systemd/systemd-sysv-install enable serviio

Thaks a lot all of you!