- Posts: 17
- Thank you received: 0
Help and support for Linux users.
YACReaderLibraryServer freenas (freebsd 11.1) jail
- carmat06
- Topic Author
- Offline
- New Member
-
Less
More
8 years 8 months ago #3550
by carmat06
YACReaderLibraryServer freenas (freebsd 11.1) jail was created by carmat06
Is there any hope in building the headless server in a freebsd jail? I gave it a quick try:
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?
Code:
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?
Please Log in or Create an account to join the conversation.
- selmf
- Offline
- Moderator
-
Less
More
- Posts: 639
- Thank you received: 136
8 years 8 months ago #3553
by selmf
My answers are not necessarily official YACReader statements but mostly represent my own opinion in technical matters.
Replied by selmf on topic YACReaderLibraryServer freenas (freebsd 11.1) jail
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.
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.
Please Log in or Create an account to join the conversation.
- carmat06
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 17
- Thank you received: 0
8 years 8 months ago #3555
by carmat06
Replied by carmat06 on topic YACReaderLibraryServer freenas (freebsd 11.1) jail
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
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:
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
Code:
Logging to /.local/share/YACReader/YACReaderLibrary/server_log.log
Warning: Spoiler!
Code:
#!/bin/sh
#
# PROVIDE: Headless YACReaderServer comic server
# REQUIRE: LOGIN
# 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 daemon runs as what
# you want it to be. It uses 'media' user by
# default. Do not sets it as empty or it will run
# as root.
. /etc/rc.subr
name="yac"
rcvar="${name}_enable"
load_rc_config ${name}
: ${yac_enable:="NO"}
: ${yac_user:="root"}
command="/usr/bin/YACReaderLibraryServer"
procname="/usr/bin/YACReaderLibraryServer"
command_args="start"
run_rc_command "$1"
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
Please Log in or Create an account to join the conversation.
- selmf
- Offline
- Moderator
-
Less
More
- Posts: 639
- Thank you received: 136
8 years 8 months ago #3556
by selmf
My answers are not necessarily official YACReader statements but mostly represent my own opinion in technical matters.
Replied by selmf on topic YACReaderLibraryServer freenas (freebsd 11.1) jail
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.
Please Log in or Create an account to join the conversation.
- carmat06
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 17
- Thank you received: 0
8 years 8 months ago - 8 years 8 months ago #3557
by carmat06
Replied by carmat06 on topic YACReaderLibraryServer freenas (freebsd 11.1) jail
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
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:
If I run as root its:
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.
Edit: look below for a better version
Warning: Spoiler!
Code:
#!/bin/sh
#
# $FreeBSD$
#
# Runs as unprivileged user "rtorrent"
# Lives in "tmux" (like "screen") because rtorrent can't daemonize itself
# To access rtorrent client that's in the tmux: su - rtorrent && tmux attach
# To detach the tmux and leave rtorrent running: Ctrl-B then D
# nice'd default +10 step to make it go easy on the machine
# Don't forget to put rtorrent_enable="YES" in your /etc/rc.conf
#
# PROVIDE: rtorrent
# REQUIRE: NETWORK
# KEYWORD: shutdown
. /etc/rc.subr
name="yac"
rcvar=yac_enable
start_cmd="${name}_start"
stop_cmd="${name}_stop"
load_rc_config $name
: ${rtorrent_enable:=no}
procname="/usr/bin/YACReaderLibraryServer"
yac_start() {
su - yac -c "/usr/bin/YACReaderLibraryServer start &"
}
yac_stop() {
killall -u yac
}
start_precmd="export XDG_CONFIG_HOME=/home/yac"
run_rc_command "$1"
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:
Code:
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:
Code:
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.
Code:
#!/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: 8 years 8 months ago by carmat06.
Please Log in or Create an account to join the conversation.
- selmf
- Offline
- Moderator
-
Less
More
- Posts: 639
- Thank you received: 136
8 years 8 months ago #3558
by selmf
My answers are not necessarily official YACReader statements but mostly represent my own opinion in technical matters.
Replied by selmf on topic YACReaderLibraryServer freenas (freebsd 11.1) jail
Congratulations!
My answers are not necessarily official YACReader statements but mostly represent my own opinion in technical matters.
Please Log in or Create an account to join the conversation.
- Luis Ángel
-
- Offline
- Administrator
-
Less
More
- Posts: 3354
- Thank you received: 692
8 years 8 months ago #3559
by Luis Ángel
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\
Replied by Luis Ángel on topic YACReaderLibraryServer freenas (freebsd 11.1) jail
I am going to pin these topic in case any other users are interested.
@carmat06 thanks for sharing your work and results on this!
@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\
Please Log in or Create an account to join the conversation.
- selmf
- Offline
- Moderator
-
Less
More
- Posts: 639
- Thank you received: 136
8 years 8 months ago #3563
by selmf
My answers are not necessarily official YACReader statements but mostly represent my own opinion in technical matters.
Replied by selmf on topic YACReaderLibraryServer freenas (freebsd 11.1) jail
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.
Please Log in or Create an account to join the conversation.
- Joe
- Offline
- Junior Member
-
Less
More
- Posts: 21
- Thank you received: 2
6 years 4 months ago #5250
by Joe
Replied by Joe on topic YACReaderLibraryServer freenas (freebsd 11.1) jail
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 :
The error comes repeatetedly and after 20, it stops compiling.
If anyone of you had a hint, I would be grateful.
Regards,
Joe
So, after compiling mostly all dependies via ports, I ended up with a lot of these errors in the make process :
Code:
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
Please Log in or Create an account to join the conversation.
- selmf
- Offline
- Moderator
-
Less
More
- Posts: 639
- Thank you received: 136
6 years 4 months ago #5251
by selmf
My answers are not necessarily official YACReader statements but mostly represent my own opinion in technical matters.
Replied by selmf on topic YACReaderLibraryServer freenas (freebsd 11.1) jail
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?
__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.
Please Log in or Create an account to join the conversation.
Moderators: Luis Ángel