|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
Using wine from exec() in a plugin
I need help from a linux guru on how to launch a program in wine from within a plugin using exec(). I can launch wine (and the windows program) but it only runs if I set the owner of wine's home directory to root.
I've installed wine (on Ubuntu) as user tom. I'm running sage as root (as far as I know I must do that) using the command "sudo ./startsage". I am using the following Java code to setup the environment and launch comskip: Code:
Runtime.getRuntime().exec(command, env); Quote:
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#2
|
|||
|
|||
Could you check if /root/.wine exists else run winecfg?
You can also run a command as a user as such: su -c 'command with paramters' user But I would think you couldn't guarantee which user to run the command as. B
__________________
Running SageTV on unRAID via Docker Tuning handled by HDHR3-6CC-3X2 using OpenDCT |
#3
|
||||
|
||||
Lot's of issues to figure out with this. For now I'm just copping out and having the user select the .wine directory in the configuration. It's only an issue with linux (maybe Mac too, but no way for me to test) and I figure anybody who is using linux must know what they are doing so setting this parameter won'e be a big deal.
I think forcing root to OWN the directory (assuming wine is installed as a user) IS a big deal because once root owns .wine nothing can be run under wine as the user anymore. Ugly. Unfortunately I know just enough about linux to be dangerous.
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#4
|
|||
|
|||
You could run this during install on linux:
Code:
if ! [[ -d ~/.wine ]]; then winecfg; fi
__________________
Running SageTV on unRAID via Docker Tuning handled by HDHR3-6CC-3X2 using OpenDCT |
#5
|
||||
|
||||
I've got close to 0 bash experience. I'm assuming this checks to see if the .wine directory exists in the root's home, and if it does not it runs winecfg?
winecfg uses a GUI and I have no idea how to run that during the plugin install process.
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#6
|
|||
|
|||
In my testing I didn't need a .wine directory it was created on the first go. Also, running the command above will check to see if the user's home directory has the .wine directory. It won't matter who the user is. If you assume root, you would be wrong in my usage of sagetv.
What happens when you just run the comskip command without specifying the wine cfg directory? B
__________________
Running SageTV on unRAID via Docker Tuning handled by HDHR3-6CC-3X2 using OpenDCT |
#7
|
||||
|
||||
In my testing there needed to be an environment variable WINEPREFIX set to point to where the .wine directory was located. I think it also needs WINEPATH so I set that as well. If the environment variable was not set wine would not run.
I'm a complete novice with wine and open to advice and constructive criticism. I never even installed wine until I started testing this plugin. (Although I have drunk a lot of wine over the years, but that is another story.) The kludgy solution I have in mind is to tell users to make a dedicated user, run winecfg as that user, chown the .wine directory to root and then point the plugin at that directory. It's ugly but it will work for now. I'm shooting to release a beta this weekend so I may have to settle for that kludge until I can figure out something better. Advice welcome.
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#8
|
||||
|
||||
Thanks to bcjenkins I think I have a possible solution. My plan is to use sudo to run wine as a user. It sounds easy enough which makes me believe I have missed something really obvious.
Thoughts?
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Plugin: MizookLCD (Alternate SageTV LCDSmartie Plugin) | cslatt | SageTV Customizations | 48 | 06-11-2012 10:44 AM |
MediaPlayer Plugin/STV Import: Winamp Media Player Plugin | deria | SageTV Customizations | 447 | 12-11-2010 07:38 PM |
String[] and exec() in Java | tmiranda | SageTV Studio | 8 | 07-31-2010 10:33 AM |
Linux Comskip without Wine? | btf1962 | SageTV Customizations | 3 | 04-27-2010 08:16 PM |