Adding kodi to the VPN user
|
Posts: 3
Threads: 1
Joined: Oct 2016
Reputation:
0
[Not Solved]
Oct 21, 2016, 06:31 PM
This is probably a very easy question to answer but I have only had my raspberry pi for a month and am still learning every day. I recently completed the split tunneling guide and am waiting for the deluge guide to come out but in the meantime I would like to have kodi run under the vpn user. How do i go about setting up "vpn" as the user for kodi? Also if there is some way to test that I did it correctly once I am done that would be nice as well.
Posts: 1,646
Threads: 2
Joined: Aug 2015
Reputation:
42
[Not Solved]
Oct 21, 2016, 09:39 PM
The Kodi user is probably specified in an init.d script, can you post the output of
The goal will be to do something like this http://kodi.wiki/view/HOW-TO:Autostart_Kodi_for_Linux
Posts: 3
Threads: 1
Joined: Oct 2016
Reputation:
0
[Not Solved]
Oct 22, 2016, 10:22 PM
-rwxr-xr-x 1 root root 4.5K Dec 29 2015 kodi
looks like Kodi is owned by the root user at the moment.
I have been working on setting up all the things I want on my pi (plex media server with kodi as the main media player, retropie within kodi (or the other way around) and then deluge running in the background so I can download stuff to my external hard drive. I currently usually boot into the desktop as I am still kind of new to linux and am used to my pc. I figure once i'm done I will have no need for the desktop and will just boot straight to kodi or retropie as long as I can access to the other without restarting.
As for now I just need to be able to run kodi as the vpn user without starting it automatically when i boot up my pi. Later once I have everything set up I will boot straight to kodi or retorpie.
Posts: 1,646
Threads: 2
Joined: Aug 2015
Reputation:
42
[Not Solved]
Oct 22, 2016, 10:31 PM
Can you paste the output of
Code:
cat /etc/init.d/kodi
Posts: 3
Threads: 1
Joined: Oct 2016
Reputation:
0
[Not Solved]
Oct 22, 2016, 10:44 PM
(This post was last modified: Oct 22, 2016, 11:00 PM by Mike.)
Code:
#! /bin/sh
### BEGIN INIT INFO
# Provides: kodi
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: XBMC media centre
# Description: Starts the XBMC media centre in standalone mode
### END INIT INFO
# Author: Michael Gorven <michael@gorven.za.net>
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="media centre"
NAME=kodi
STARTAS=/usr/bin/kodi-standalone
DAEMON=/bin/sh
DAEMON_ARGS=""
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
GEOMETRY=/var/run/kodi.fbset
# Defaults
ENABLED=0
USER=kodi
NICE=0
# Exit if the package is not installed
[ -x "$STARTAS" ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
# Backwards compatibility with previous package name
[ -r /etc/default/xbmc ] && . /etc/default/xbmc
# Exit if service is not enabled
[ "$ENABLED" = "1" ] || exit 0
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions
#
# Function that starts the daemon/service
#
do_start()
{
fbset --show | grep geometry | cut -d' ' -f 6- > $GEOMETRY
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --pidfile $PIDFILE --user $USER --exec $DAEMON --startas $STARTAS --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --nicelevel $NICE --chuid $USER --background --make-pidfile --exec $DAEMON --startas $STARTAS -- \
$DAEMON_ARGS \
|| return 2
# Add code here, if necessary, that waits for the process to be ready
# to handle requests from services started subsequently which depend
# on this one. As a last resort, sleep for some time.
sleep 10
start-stop-daemon --start --quiet --pidfile $PIDFILE --user $USER --exec $DAEMON --startas $STARTAS --test > /dev/null \
|| return 2
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --user $USER --exec $DAEMON --startas $STARTAS
# Kodi doesn't actually handle signals, so we have to send an RPC request to ask it to exit
if [ -x /usr/bin/wget ]; then
wget --post-data '{"jsonrpc": "2.0", "method": "Application.Quit", "params": [], "id": 0}' --header 'Content-Type: application/json' -O /dev/null --quiet http://localhost:8080/jsonrpc
fi
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
start-stop-daemon --stop --quiet --retry=0/30/KILL/5 --user $USER --name $NAME.bin
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE
# Try to fix the display
VT="$(fgconsole)"
if [ "$VT" ]; then
chvt 7
chvt "$VT"
fi
if [ -e $GEOMETRY ]; then
fbset --geometry $(cat $GEOMETRY)
fi
return "$RETVAL"
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
restart|force-reload)
#
# If the "reload" option is implemented then remove the
# 'force-reload' alias
#
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac
:
Posts: 1,646
Threads: 2
Joined: Aug 2015
Reputation:
42
[Not Solved]
Oct 22, 2016, 11:01 PM
Posts: 8
Threads: 1
Joined: Jan 2017
Reputation:
3
[Not Solved]
Feb 15, 2017, 06:17 AM
(This post was last modified: Nov 14, 2018, 07:19 AM by willieaames.)
I'm planning on buying a RPi3 soon (with the accessories). I've seen a lot of tutorials on Youtube and here on how to install Kodi on RPi2, but none at all on RPi3, so I'm just wondering if anyone has any stories or links to share about getting it setup.
P.S: I`v read many kodi vpn blogs such as https://www.kodivpn.co/ and https://www.bestvpn.co/best-vpn-for-kodi/
but still stuck in the loop.
Posts: 403
Threads: 26
Joined: Aug 2015
Reputation:
39
[Not Solved]
Feb 15, 2017, 09:22 AM
(Feb 15, 2017, 06:17 AM)willieaames Wrote: I'm planning on buying a RPi3 soon (with the accessories). I've seen a lot of tutorials on Youtube and here on how to install Kodi on RPi2, but none at all on RPi3, so I'm just wondering if anyone has any stories or links to share about getting it setup.
P.S: I`v read many kodi vpn blogs but still not a single piece on that.
The tutorials for the RPI2 works for RPI3 too..
Posts: 3
Threads: 0
Joined: Mar 2017
Reputation:
0
[Not Solved]
Mar 14, 2017, 08:17 AM
(This post was last modified: Mar 14, 2017, 08:25 AM by iamjenny.)
I bought a VPN yesterday. I have found a few tutorials on Google on how to setup VPN on Kodi that out of 3 only 1 works on my Kodi. Here it is PureVPN
Posts: 244
Threads: 1
Joined: Jul 2016
Reputation:
12
[Not Solved]
Mar 16, 2017, 01:09 PM
(Mar 14, 2017, 08:17 AM)iamjenny Wrote: I bought a VPN yesterday. I have found a few tutorials on Google on how to setup VPN on Kodi that out of 3 only 1 works on my Kodi. Here it is PureVPN
You can configure Kodi to be tunneled over VPN, you even have more ways of doing this.
1) you can use the built in VPN configuration of Kodi (personally never used it, but should work). This is especially useful if you are using a Kodi specific distribution, like Libreelec. Btw, I don't really trust this solution, not sure about the level of control we actually have over connection, ip leaks, etc.
2) use your router to route the IP address assigned to your Kodi box over the VPN client connection running on your router (Asus routers with Merlin Firmware are great for this). This should be considered much more safer and reliable. And Merlin works great with all the OpenVPN server and quite easy to configure. Limitations might be because of the router's resources, so expect somewhat lower speeds.
3) for such advanced setups the obvious and best solution is to configure the whole system yourself. It is quite easy to run Kodi as vpn user and then route everything from Kodi over VPN server, so Split Tunnel is working perfectly fine, all you can of course install default OpenVPN for system-wide tunneling, but then take care of the iptables rules to prevent ip leaks! I have a detailed post for this (until I manage to put together a guide), let me know if you need the link.
it is really easy to install Kodi on Ubuntu Server 16.04 and works so great.
|
|
|