Welcome to the forum, Guest

TOPIC: YACReaderLibraryServer freenas (freebsd 11.1) jail

YACReaderLibraryServer freenas (freebsd 11.1) jail 6 years 3 months ago #3550

carmat06

Offline

Fresh Boarder

Posts: 17

Karma: 0

Is there any hope in building the headless server in a freebsd jail? I gave it a quick try:
Project MESSAGE: Missing dependency: Qt5Core
Project MESSAGE: Missing dependency: Qt5Gui
Project MESSAGE: Missing dependency: poppler-qt5
Project MESSAGE: Missing dependency: Qt5Network
Project MESSAGE: Missing dependency: Qt5Sql
Project MESSAGE: Missing dependency: sqlite3
Project MESSAGE: Found unarr source-code
Project MESSAGE: Unarr will be build as a part of YACReader
Project MESSAGE: No build type specified. Defaulting to standalone server build (CONFIG+=server_standalone).
Project MESSAGE: If you wish to run YACReaderLibraryServer on a system with an existing install of YACReaderLibrary, please specify CONFIG+=server_bundled as an option when running qmake.

Despite installing the required packages into the jail, there are still build issue. Before I try installing all the build dependancies from ports, is this even possible?
The administrator has disabled public write access.

YACReaderLibraryServer freenas (freebsd 11.1) jail 6 years 3 months ago #3553

selmf

Offline

Developer

Posts: 631

Thank you received: 135

Karma: 18

It should be possible. Probably not with version 8.5, but if you do a checkout of the current 9.0.0 beta code ('develop' branch on Luis' bitbucket repo) that should work. Missing dependencies can be ignored, the mechanism relies on pkgconfig and not all installations of Qt5 provide pkgconfig files for installed packages/modules.

If you encounter any problems, let us know. FreeBSD support is something we would like to have, but we've never tried building YACReader on a BSD system, so this is something very interesting for us.
My answers are not necessarily official YACReader statements but mostly represent my own opinion in technical matters.
The administrator has disabled public write access.

YACReaderLibraryServer freenas (freebsd 11.1) jail 6 years 3 months ago #3555

carmat06

Offline

Fresh Boarder

Posts: 17

Karma: 0

I was able to successfully compile YACReaderLibraryServer on freenas 11.1. I had to install qt5, and all the other dependancies listed in the error above from ports, which took several hours. I may have been able to just compile selective ports installed with qt5, but decided to just do the whole thing and see if it worked. Once all the ports where installed I followed the directions on the YACReader home page for compiling from source on a pi and they worked fine, with the one exception of checking out the develop branch after cloning the repository. I can run the server from the command line (as user "yac") with su - yac -c "/usr/bin/YACReaderLibraryServer start" and as root with "/usr/bin/YACReaderLibraryServer start" but I'm having real trouble coming up with a rc.d service script that will run the server at boot as user "yac". If I start from YAC with either one of those command lines it works fine, reading the setting etc from /home/yac/local or /root/.local correctly . However if I try to run YAC with a rc.d service file it reports
Logging to /.local/share/YACReader/YACReaderLibrary/server_log.log
and can't find the settings and libraries at /.local because they are at /home/yac/.local or /root/.local. I would really love a command line switch to set the data directory for the server. Here is my rc.d service file for running the server as root:

Warning: Spoiler! [ Click to expand ]


This will run the server but it looks for the config files at /.local. I have gone through quite a bit of revisions, as I am a noob at writing these service files and have just been fumbling my way through. If anyone here has any ideas on improving
The administrator has disabled public write access.

YACReaderLibraryServer freenas (freebsd 11.1) jail 6 years 3 months ago #3556

selmf

Offline

Developer

Posts: 631

Thank you received: 135

Karma: 18

I think this might be because of a missing environment variable. We're using the QSettings class for the configuration, which by default reads XDG_CONFIG_HOME. The error message you posted suggests it isn't set when the rc script runs. You probably need to run something like "export XDG_CONFIG_HOME=/home/yac" to make it work.
My answers are not necessarily official YACReader statements but mostly represent my own opinion in technical matters.
The administrator has disabled public write access.

YACReaderLibraryServer freenas (freebsd 11.1) jail 6 years 3 months ago #3557

carmat06

Offline

Fresh Boarder

Posts: 17

Karma: 0

I finally got an rc service that works and runs as user "yac". In case anyone wants it here is what I came up with:

Edit: look below for a better version
Warning: Spoiler! [ Click to expand ]


I'll happily take suggestions, especially if anyone has a better way of stopping the service.

There is one error that seems can be ignored, but I'd like to point it out in case its something that can be easily addressed. If I start the service with any user other than root, there an error in the log:
root@yac_1:~ # Logging to /home/yac/.local/share/YACReader/YACReaderLibrary/server_log.log
INFO  2018-01-10T21:14:16.302 YACReaderLibraryServer attempting to start 
INFO  2018-01-10T21:14:16.302 ---------- System & configuration ---------- 
INFO  2018-01-10T21:14:16.302 SO : Unknown 
INFO  2018-01-10T21:14:16.302 7z : found 
INFO  2018-01-10T21:14:16.303 Libraries:  QMap(("collection", QPair(1,"/data/nas/Comics/Clean"))) 
INFO  2018-01-10T21:14:16.303 -------------------------------------------- 
INFO  2018-01-10T21:14:16.303 YACReaderLibrary starting 
ERROR 2018-01-10T21:14:16.303 Unable to create local server

If I run as root its:
INFO  2018-01-10T10:25:30.203 YACReaderLibraryServer attempting to start 
INFO  2018-01-10T10:25:30.203 ---------- System & configuration ---------- 
INFO  2018-01-10T10:25:30.203 SO : Unknown 
INFO  2018-01-10T10:25:30.203 7z : found 
INFO  2018-01-10T10:25:30.203 Libraries:  QMap(("collection", QPair(1,"/data/nas/Comics/Clean"))) 
INFO  2018-01-10T10:25:30.203 -------------------------------------------- 
INFO  2018-01-10T10:25:30.203 YACReaderLibrary starting

In either case the library loads in YACReader iOS and updates fine from the command line.

Edit: Here is a cleaned up rc.d file that should be more user friendly. figured out how to let the system handle stopping the service too.
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: YACLibraryServer
# REQUIRE: NETWORK
# KEYWORD: shutdown
#
#
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# yac_enable (bool):    Set to NO by default.
#                       Set it to YES to enable it.
# yac_user:             The user account yac runs as what
#                       you want it to be. It uses 'yac' user by
#                       default.
# yac_group:            The group account yac runs as what
#                       you want it to be. It uses 'yac' group by
#                       default.

. /etc/rc.subr

name="yac"
rcvar="${name}_enable"
load_rc_config $name

load_rc_config $name
: ${yac_enable:=no}
: ${yac_user:="yac"}
: ${yac_group:="yac"}

start_cmd="${name}_start"

procname="/usr/bin/YACReaderLibraryServer"

yac_start() {
        su - ${yac_user} -c "/usr/bin/YACReaderLibraryServer start &"
}

start_precmd="export XDG_CONFIG_HOME=/home/yac"
run_rc_command "$1"
Last Edit: 6 years 3 months ago by carmat06.
The administrator has disabled public write access.

YACReaderLibraryServer freenas (freebsd 11.1) jail 6 years 3 months ago #3558

selmf

Offline

Developer

Posts: 631

Thank you received: 135

Karma: 18

Congratulations!
My answers are not necessarily official YACReader statements but mostly represent my own opinion in technical matters.
The administrator has disabled public write access.

YACReaderLibraryServer freenas (freebsd 11.1) jail 6 years 3 months ago #3559

Luis Ángel

Offline

Administrator

Posts: 2616

Thank you received: 543

Karma: 22

I am going to pin these topic in case any other users are interested.

@carmat06 thanks for sharing your work and results on this!
Contribute to the project becoming a patron: www.patreon.com/yacreader
You can also donate via Pay-Pal: www.paypal.com/donate?business=5TAMNQCDD...e=Support+YACReader\
The administrator has disabled public write access.

YACReaderLibraryServer freenas (freebsd 11.1) jail 6 years 3 months ago #3563

selmf

Offline

Developer

Posts: 631

Thank you received: 135

Karma: 18

Something I forgot to mention. You just compiled [a part of] YACReader on a new OS. That kind of is a big deal for us :) We try to write the code portable, but there's a difference between theory and the real deal.
My answers are not necessarily official YACReader statements but mostly represent my own opinion in technical matters.
The administrator has disabled public write access.

YACReaderLibraryServer freenas (freebsd 11.1) jail 3 years 10 months ago #5250

Joe

Offline

Junior Boarder

Posts: 20

Thank you received: 1

Karma: 0

Hi there, I followed your path and tried to compile YACReader in a freenas 11.3 iocage (FreeBSD 11.3)

So, after compiling mostly all dependies via ports, I ended up with a lot of these errors in the make process :
In file included from /usr/local/include/qt5/QtWidgets/QApplication:1:
In file included from /usr/local/include/qt5/QtWidgets/qapplication.h:43:
In file included from /usr/local/include/qt5/QtWidgets/qtwidgetsglobal.h:43:
In file included from /usr/local/include/qt5/QtGui/qtguiglobal.h:43:
/usr/local/include/qt5/QtCore/qglobal.h:475:1: error: '__declspec' attributes are not enabled; use
      '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION const char *qVersion(void) Q_DECL_NOEXCEPT;

The error comes repeatetedly and after 20, it stops compiling.

If anyone of you had a hint, I would be grateful.

Regards,

Joe
The administrator has disabled public write access.

YACReaderLibraryServer freenas (freebsd 11.1) jail 3 years 10 months ago #5251

selmf

Offline

Developer

Posts: 631

Thank you received: 135

Karma: 18

Hi Joe,

__declspec is a Microsoft specific C++ extension (docs.microsoft.com/en-us/cpp/cpp/declspec?view=vs-2019) so seeing it "missing" on FreeBSD is a sign of something going very wrong. Can you run other Qt5 based programs?
My answers are not necessarily official YACReader statements but mostly represent my own opinion in technical matters.
The administrator has disabled public write access.
Powered by Kunena Forum