9and3r / mopidy-touchscreen

Extension for displaying track info and controlling Mopidy from a touch screen using PyGame/SDL
Apache License 2.0
45 stars 24 forks source link

Running mopidy as a service without root privileges #15

Closed jgeisler0303 closed 8 years ago

jgeisler0303 commented 8 years ago

Hi, I would like to share how I got mopidy to run as a service without root privileges. First the prerequisites:

Further, I assume you have your touch screen running and bound to /dev/fb1 and your touch input linked to /dev/input/touchscreen. The first is achieved by adding a line like dtoverlay="your device" to /boot/config.txt where "your device"is chosen from this list and possibly augmented with appropriate parameter settings. For the latter your might have to add another dtoverlay-line to your /boot/config.txt, depending on your touch input device. For my device this is not necessary as the touch driver is included in the display driver. Finally you must link your touch input to /dev/input/touchscreen and calibrate it as described here. You may omit the creation of the files for setting the environment variables and run sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrateinstead.

You may also send boot log to the touch screen by adding this to the end of the one and only line in /boot/cmdline.txt: fbcon=map:10.

What follows now is the actual solution to letting run mopidy as a service without root privileges. I had to try many different approaches and I hope I recall everything that finally led to success correctly. If you encounter a problem in recreating this, give me a shout, maybe I missed something important.

  StandardInput=tty-fail
  StandardOutput=tty
  TTYPath=/dev/tty1

Have fun and many thanks to the developers of this great little application.

ghost commented 8 years ago

Thanks for the detailed tutorial. It will be very helpful. I tried a lot of different configurations and I was never able to run it without sudo.

I will add a link in the readme to this tutorial.

araczkowski commented 8 years ago

same thing in my case, I stuck on this point and as a workaround I used rc.local but finally it works - thanks!