Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open swt ui while running biglybt console and telnet ui in systemd #356

Closed
moham96 opened this issue Feb 12, 2018 · 11 comments
Closed

open swt ui while running biglybt console and telnet ui in systemd #356

moham96 opened this issue Feb 12, 2018 · 11 comments

Comments

@moham96
Copy link

moham96 commented Feb 12, 2018

Hi,
I want to run biglybt inside a systemd service while still being able to run swt ui. I used the following service file

[Unit]
Description=BiglyBt daemon
After=network-online.target

[Service]
Environment=DISPLAY=0.0
Type=simple
User=pi
ExecStart=/usr/bin/java -cp /home/pi/biglybt_stock/BiglyBT.jar -Djava.library.path=/home/pi/biglybt_stock -Dbiglybt.install.path=/home/pi/biglybt_stock -Dazureus.script=/home/pi/biglybt_stock/biglybt -Dazureus.config.path=/home/pi/.biglybt_stock -Dazureus.overridelog=1 -Dazureus.overridelogdir=/home/pi/biglybtlogs/ -Ddebug.swtexec=1 com.biglybt.ui.Main --ui="console,telnet"
ExecStop=/usr/bin/java -cp /home/pi/biglybt_stock/BiglyBT.jar -Djava.library.path=/home/pi/biglybt_stock -Dbiglybt.install.path=/home/pi/biglybt_stock -Dazureus.script=/home/pi/biglybt_stock/biglybt -Dazureus.config.path=/home/pi/.biglybt_stock  com.biglybt.ui.Main --shutdown
SuccessExitStatus=143

[Install]
WantedBy=multi-user.target

and I can start and stop the service and connect through telnet, but when i execute ui swt inside a telnet session i get

Unable to init server: Could not connect: Connection refused

inside the systemd logs and the service exits

@parg
Copy link
Contributor

parg commented Feb 12, 2018

Perhaps you need to include the swt jar file in the classpath?

@moham96
Copy link
Author

moham96 commented Feb 12, 2018

@parg I Did include it but the problem persists, the problem only happens when I run the command inside systemd service, if I run the same command /usr/bin/java -cp /home/pi/biglybt_stock/BiglyBT.jar -Djava.library.path=/home/pi/biglybt_stock -Dbiglybt.install.path=/home/pi/biglybt_stock -Dazureus.script=/home/pi/biglybt_stock/biglybt -Dazureus.config.path=/home/pi/.biglybt_stock -Dazureus.overridelog=1 -Dazureus.overridelogdir=/home/pi/biglybtlogs/ -Ddebug.swtexec=1 com.biglybt.ui.Main --ui="console,telnet" from a terminal and then started swt using telnet then everything works

@parg
Copy link
Contributor

parg commented Feb 12, 2018

Hmm, I don't know anything about the context within which systemd might be running BBT :( The error message you see is somewhat peculiar, no idea what 'server' it is trying to init or connect to.

@moham96
Copy link
Author

moham96 commented Feb 12, 2018

@parg I think this means the x server.Maybe @TuxPaper can be of a help here

@TuxPaper
Copy link
Member

TuxPaper commented Feb 12, 2018

Is this a wayland desktop? They (and maybe other desktop UIs) prevent running desktop ui apps from root and most other accounts.

https://fedoraproject.org/wiki/Common_F25_bugs#wayland-root-apps

We use the xhost +si:localuser:root (temporarily) in our installer on Wayland in order for the gui to appear, and it mostly works, so maybe something similar will help for you.

@moham96
Copy link
Author

moham96 commented Feb 12, 2018

@TuxPaper It's not running wayland, I tried it on raspbian stretch(lxde) and manjaro running x.org, also I'm not running the process as root anyway beacuse i used User=pi in the service file

@moham96
Copy link
Author

moham96 commented Feb 16, 2018

Well this embarrassing, there is a stupid error in the service file' I passed DISPLAY=0.0 as an environment variable which should be DISPLAY=:0.0 the works now

@parg
Copy link
Contributor

parg commented Feb 16, 2018

yay

@parg parg closed this as completed Feb 16, 2018
@moham96
Copy link
Author

moham96 commented Feb 16, 2018

@parg Now I have another error popping in the logs

Feb 16 19:01:08 raspberrypi java[8812]: [alert] Alert:3:Plugin bootstrap: initialisation error for /plugins/azupdater/plugin.properties
Feb 16 19:01:08 raspberrypi java[8812]: DEBUG::Fri Feb 16 19:01:08 AST 2018::com.biglybt.update.UpdaterUtils::writePluginProperties::146:
Feb 16 19:01:08 raspberrypi java[8812]: java.io.FileNotFoundException: /plugins/azupdater/plugin.properties (No such file or directory)
Feb 16 19:01:08 raspberrypi java[8812]: at java.base/java.io.FileOutputStream.open0(Native Method)
Feb 16 19:01:08 raspberrypi java[8812]: at java.base/java.io.FileOutputStream.open(FileOutputStream.java:276)
Feb 16 19:01:08 raspberrypi java[8812]: at java.base/java.io.FileOutputStream.(FileOutputStream.java:220)
Feb 16 19:01:08 raspberrypi java[8812]: at java.base/java.io.FileOutputStream.(FileOutputStream.java:170)
Feb 16 19:01:08 raspberrypi java[8812]: at java.base/java.io.FileWriter.(FileWriter.java:90)
Feb 16 19:01:08 raspberrypi java[8812]: at com.biglybt.update.UpdaterUtils.writePluginProperties(UpdaterUtils.java:123)
Feb 16 19:01:08 raspberrypi java[8812]: at com.biglybt.update.UpdaterUtils.checkBootstrapPlugins(UpdaterUtils.java:84)
Feb 16 19:01:08 raspberrypi java[8812]: at com.biglybt.pifimpl.local.PluginInitializer.(PluginInitializer.java:484)
Feb 16 19:01:08 raspberrypi java[8812]: at com.biglybt.pifimpl.local.PluginInitializer.getSingleton(PluginInitializer.java:257)
Feb 16 19:01:08 raspberrypi java[8812]: at com.biglybt.core.impl.CoreImpl.(CoreImpl.java:345)
Feb 16 19:01:08 raspberrypi java[8812]: at com.biglybt.core.impl.CoreImpl.create(CoreImpl.java:167)
Feb 16 19:01:08 raspberrypi java[8812]: at com.biglybt.core.CoreFactory.create(CoreFactory.java:43)
Feb 16 19:01:08 raspberrypi java[8812]: at com.biglybt.ui.Main.main(Main.java:189)
Feb 16 19:01:08 raspberrypi java[8812]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Feb 16 19:01:08 raspberrypi java[8812]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
Feb 16 19:01:08 raspberrypi java[8812]: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Feb 16 19:01:08 raspberrypi java[8812]: at java.base/java.lang.reflect.Method.invoke(Method.java:564)
Feb 16 19:01:08 raspberrypi java[8812]: at com.biglybt.launcher.MainExecutor$1.run(MainExecutor.java:37)
Feb 16 19:01:08 raspberrypi java[8812]: at java.base/java.lang.Thread.run(Thread.java:844)
Feb 16 19:01:12 raspberrypi java[8812]: [Fatal Error] :1:1: Premature end of file.
Feb 16 19:01:12 raspberrypi java[8812]: [plug] [SpeedScheduler] Premature end of file.
Feb 16 19:01:12 raspberrypi java[8812]: DEBUG::Fri Feb 16 19:01:12 AST 2018::speedscheduler.Log::guiDisplay::142:
Feb 16 19:01:12 raspberrypi java[8812]: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Premature end of file.
Feb 16 19:01:12 raspberrypi java[8812]: at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1239)
Feb 16 19:01:12 raspberrypi java[8812]: at speedscheduler.io.XmlScheduleIO.loadSchedules(XmlScheduleIO.java:214)
Feb 16 19:01:12 raspberrypi java[8812]: at speedscheduler.SchedulePersistencyManager.(SchedulePersistencyManager.java:56)
Feb 16 19:01:12 raspberrypi java[8812]: at speedscheduler.SchedulePersistencyManager.(SchedulePersistencyManager.java:21)
Feb 16 19:01:12 raspberrypi java[8812]: at speedscheduler.SpeedSchedulerThread.(SpeedSchedulerThread.java:97)
Feb 16 19:01:12 raspberrypi java[8812]: at speedscheduler.SpeedSchedulerPlugin.initialize(SpeedSchedulerPlugin.java:123)
Feb 16 19:01:12 raspberrypi java[8812]: at com.biglybt.pifimpl.local.PluginInitializer$8.run(PluginInitializer.java:1620)
Feb 16 19:01:12 raspberrypi java[8812]: at com.biglybt.pifimpl.local.utils.UtilitiesImpl.callWithPluginThreadContext(UtilitiesImpl.java:1004)
Feb 16 19:01:12 raspberrypi java[8812]: at com.biglybt.pifimpl.local.PluginInitializer.initialisePlugin(PluginInitializer.java:1609)
Feb 16 19:01:12 raspberrypi java[8812]: at com.biglybt.pifimpl.local.PluginInitializer.access$2(PluginInitializer.java:1577)
Feb 16 19:01:12 raspberrypi java[8812]: at com.biglybt.pifimpl.local.PluginInitializer$2.run(PluginInitializer.java:1360)
Feb 16 19:01:12 raspberrypi java[8812]: at com.biglybt.pifimpl.local.PluginInitializer.initialisePlugins(PluginInitializer.java:1539)
Feb 16 19:01:12 raspberrypi java[8812]: at com.biglybt.core.impl.CoreImpl.start(CoreImpl.java:1141)
Feb 16 19:01:12 raspberrypi java[8812]: at com.biglybt.ui.Main.main(Main.java:246)
Feb 16 19:01:12 raspberrypi java[8812]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Feb 16 19:01:12 raspberrypi java[8812]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
Feb 16 19:01:12 raspberrypi java[8812]: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Feb 16 19:01:12 raspberrypi java[8812]: at java.base/java.lang.reflect.Method.invoke(Method.java:564)
Feb 16 19:01:12 raspberrypi java[8812]: at com.biglybt.launcher.MainExecutor$1.run(MainExecutor.java:37)
Feb 16 19:01:12 raspberrypi java[8812]: at java.base/java.lang.Thread.run(Thread.java:844)
Feb 16 19:01:15 raspberrypi java[8812]: DEBUG::Fri Feb 16 19:01:15 AST 2018::com.biglybt.core.proxy.impl.AEPluginProxyHandler::installTor::631:
Feb 16 19:01:15 raspberrypi java[8812]: UIFunctions unavailable - can't install plugin
Feb 16 19:01:15 raspberrypi java[8812]: AEPluginProxyHandler::checkPluginInstallation::571, AEPluginProxyHandler::getPluginServerProxy::498, AEProxyFactory::getPluginServerProxy::172, WebPlugin$16::runSupport::1464, AsyncDispatcher$1::run::161, AEThread2$threadWrapper::run::295
Feb 16 19:01:15 raspberrypi java[8812]: Plugin bootstrap: initialisation error for /plugins/azupdater/plugin.properties
Feb 16 19:01:15 raspberrypi java[8812]: java.io.FileNotFoundException: /plugins/azupdater/plugin.properties (No such file or directory)
Feb 16 19:01:15 raspberrypi java[8812]: at java.base/java.io.FileOutputStream.open0(Native Method)
Feb 16 19:01:15 raspberrypi java[8812]: at java.base/java.io.FileOutputStream.open(FileOutputStream.java:276)
Feb 16 19:01:15 raspberrypi java[8812]: at java.base/java.io.FileOutputStream.(FileOutputStream.java:220)
Feb 16 19:01:15 raspberrypi java[8812]: at java.base/java.io.FileOutputStream.(FileOutputStream.java:170)
Feb 16 19:01:15 raspberrypi java[8812]: at java.base/java.io.FileWriter.(FileWriter.java:90)
Feb 16 19:01:15 raspberrypi java[8812]: at com.biglybt.update.UpdaterUtils.writePluginProperties(UpdaterUtils.java:123)
Feb 16 19:01:15 raspberrypi java[8812]: at com.biglybt.update.UpdaterUtils.checkBootstrapPlugins(UpdaterUtils.java:84)
Feb 16 19:01:15 raspberrypi java[8812]: at com.biglybt.pifimpl.local.PluginInitializer.(PluginInitializer.java:484)
Feb 16 19:01:15 raspberrypi java[8812]: at com.biglybt.pifimpl.local.PluginInitializer.getSingleton(PluginInitializer.java:257)
Feb 16 19:01:15 raspberrypi java[8812]: at com.biglybt.core.impl.CoreImpl.(CoreImpl.java:345)
Feb 16 19:01:15 raspberrypi java[8812]: at com.biglybt.core.impl.CoreImpl.create(CoreImpl.java:167)
Feb 16 19:01:15 raspberrypi java[8812]: at com.biglybt.core.CoreFactory.create(CoreFactory.java:43)
Feb 16 19:01:15 raspberrypi java[8812]: at com.biglybt.ui.Main.main(Main.java:189)
Feb 16 19:01:15 raspberrypi java[8812]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Feb 16 19:01:15 raspberrypi java[8812]: at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
Feb 16 19:01:15 raspberrypi java[8812]: at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Feb 16 19:01:15 raspberrypi java[8812]: at java.base/java.lang.reflect.Method.invoke(Method.java:564)
Feb 16 19:01:15 raspberrypi java[8812]: at com.biglybt.launcher.MainExecutor$1.run(MainExecutor.java:37)
Feb 16 19:01:15 raspberrypi java[8812]: at java.base/java.lang.Thread.run(Thread.java:844)

should i open a new issue for this error ?

@parg
Copy link
Contributor

parg commented Feb 16, 2018

seems to be attempting to write at / - perhaps you need an additional

-Duser.dir=/home/pi/biglybt_stock

@moham96
Copy link
Author

moham96 commented Feb 17, 2018

@parg ok that solved the issue but I get yet another error, it's probably not very important but I just want to make sure of it:

Stopping console input reader because of exception: stream closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants