This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
howto:linux:install:gentoo [2012/08/11 23:05] danomac Adding more content |
howto:linux:install:gentoo [2012/08/12 00:31] danomac [Setting Up Initscripts] fixes |
||
---|---|---|---|
Line 143: | Line 143: | ||
===== Start Serviio as a Service ===== | ===== Start Serviio as a Service ===== | ||
- | These instructions will provide a way to sun Serviio as a service under a non-root user. | + | These instructions will provide a way to sun Serviio as a service under a non-root user. A user needs to be created for this purpose, then scripts added to be able to start and stop the service. |
- | First, | + | ==== Creating a New User ==== |
+ | |||
+ | To create a new user, use: | ||
< | < | ||
Line 157: | Line 159: | ||
</ | </ | ||
- | The console like to write logs to the log directory, so we need to make that directory writeable: | + | ==== Setting Up Initscripts ==== |
+ | |||
+ | Here are some initscripts that can be used to start and stop Serviio. Two are needed, one is / | ||
+ | |||
+ | <file bash serviio_conf> | ||
+ | # / | ||
+ | |||
+ | # Location of serviio.sh | ||
+ | SERVIIO_CMD=/ | ||
+ | |||
+ | # The user Serviio should run under | ||
+ | SERVIIO_USER=serviio | ||
+ | </ | ||
+ | |||
+ | <file bash serviio_init> | ||
+ | # | ||
+ | # Copyright 1999-2012 Gentoo Foundation | ||
+ | # Distributed under the terms of the GNU General Public License v2 | ||
+ | # $Header: $ | ||
+ | |||
+ | depend() { | ||
+ | | ||
+ | } | ||
+ | |||
+ | start() { | ||
+ | ebegin " | ||
+ | start-stop-daemon --start --exec ${SERVIIO_CMD} --make-pidfile \ | ||
+ | --user ${SERVIIO_USER} --background \ | ||
+ | --pidfile / | ||
+ | eend $? | ||
+ | } | ||
+ | |||
+ | stop() { | ||
+ | ebegin " | ||
+ | ${SERVIIO_CMD} -stop | ||
+ | start-stop-daemon --stop \ | ||
+ | --user ${SERVIIO_USER} --pidfile / | ||
+ | eend $? | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Once downloaded, move them to their appropriate locations: | ||
< | < | ||
- | # chmod -R 777 /opt/serviio/log | + | # mv serviio_conf |
+ | # mv serviio_init | ||
+ | # chmod +x / | ||
</ | </ | ||
+ | You can then start and stop Serviio with: | ||
+ | < | ||
+ | # / | ||
+ | * Starting Serviio Media Server ... [ ok ] | ||
+ | # / | ||
+ | * Stopping Serviio Media Server ... [ ok ] | ||
+ | </ | ||
- | ===== Troubleshooting ===== | + | To get Serviio to start automatically on startup: |
- | + | ||
- | This is a work in progress. Check back later. | + | |
+ | < | ||
+ | # rc-update add serviio default | ||
+ | </ | ||
~~NOTOC~~ | ~~NOTOC~~ |