I’d like to give it a try, but I am not able to do Nethgui for now, but learning. I’d take your howto (I remember you wanted to refresh it) as starting point.
2 days ago I did a new install on NethServer 7.4 with all updates. There is no need to change the Howto. It just works as it is described in the wiki.
NetGui is probably the least of the problems creating the module and there are several experienced devs that can give pointers.
I would love to make it a joined effort.
@giacomo already made a start with the module. You can find that here: https://github.com/gsanchietti/nethserver-savapage. I hope we can make it a fully working addition to the nethserver-cups module.
Maybe I am thinking like a non coder, but I see some overlapping areas between SavaPage and Webtop.
Buth are java based applications so they both need java to be installed. Besides that, they both use postgresql. I can imagine it would be a good idea that they use the same version of java and postgresql. Is there an option to make that happen? (checks for already installed java/pgsql and versions) How are we going to be sure the 2 applications are not going to ‘bite’ eachother?
That’s just true.
Nice, I’ll clone it, get into it and start from what’s already there.
That’s the goal!
For sure we will use the nethserver-postgresql db for savapage like webtop does. So we can easily manage it with phppgadmin.
I have to check how it’s done in Nethserver/centos or in webtop, but just put some java re in /opt/java* should always be possible.
postgresql is no problem, they have different databases, so no bite possible. In java it just depends on version needed if they can share it. Java I have to check…
I’ll just start now and keep you updated…
For what I understood, SavaPage can do it’s job with both 1.7 and 1.8. I think Webtop uses 1.7 (have to check that) so it would be a no-brainer to use the same for savapage
Sorry @robb, I couldn’t get savapage to work for now, but won’t give up, just tired
[savapage@testserver savapage]$ savapage-db --db-init Starting ... Initializing database version  ... Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
[root@testserver ~]# systemctl status savapage -l ● savapage.service - SavaPage Open Print Portal Loaded: loaded (/usr/lib/systemd/system/savapage.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Sat 2017-12-09 00:43:08 CET; 6min ago Process: 49468 ExecStop=/opt/savapage/server/bin/linux-x64/app-server stop (code=exited, status=0/SUCCESS) Process: 49429 ExecStart=/opt/savapage/server/bin/linux-x64/app-server start (code=exited, status=0/SUCCESS) Main PID: 49456 (code=exited, status=1/FAILURE) Dec 09 00:43:08 testserver.domain.local systemd: Starting SavaPage Open Print Portal... Dec 09 00:43:08 testserver.domain.local su: (to savapage) root on none Dec 09 00:43:08 testserver.domain.local app-server: Starting SavaPage Open Print Portal started PID=49456 Dec 09 00:43:08 testserver.domain.local systemd: Started SavaPage Open Print Portal. Dec 09 00:43:08 testserver.domain.local systemd: savapage.service: main process exited, code=exited, status=1/FAILURE Dec 09 00:43:08 testserver.domain.local app-server: SavaPage Open Print Portal is not running Dec 09 00:43:08 testserver.domain.local systemd: Unit savapage.service entered failed state. Dec 09 00:43:08 testserver.domain.local systemd: savapage.service failed. Do you know where I can find a logfile or how to troubleshoot?
You may have a look at the code, I took the repo of @giacomo, cloned it and just updated to actual savapage version and added requirements to .spec file, I hope I didn’t forget something:
Requires: nethserver-avahi, nethserver-postgresql, nethserver-cups Requires: java-1.8.0-openjdk Requires: poppler-utils,ImageMagick Requires: java-1.8.0-openjdk-devel,avahi-tools Requires: binutils,which,gzip,perl
Please feel free to install the rpm on a TEST system and I hope you can find what’s wrong or what to be added to work…
I am afraid it may also break an installed webtop - “HTTP Status 500 - java.lang.NullPointerException” - but let’s concentrate on savapage first…
I will fire up a new NS7 VM and give it a go. Report back later…
btw, the http status 500 on webtop is not necessarily because of savapage. See WebTop HTTP Status 500
/edit: quick update
I just installed your RPM… install went great. Tomorrow I will investigate further what is lacking to make the application work…
First check: savapage user is not available. When I do sudo su savapage in terminal I get the response: This account is currently not available. Looks like no shell is set for the user. https://geekpeek.net/this-account-is-currently-not-available-login-problems/
looking at /etc/passwd confirms this:
While it should be:
(taken from manual installed server)
Also homedir is not created correctly.
I updated the package, now it should be the correct user.
[root@testserver ~]# getent passwd savapage savapage:x:994:991:Savapage user:/home/savapage:/bin/bash
Do we really need a homedir? It’s a system user so no home dir is autocreated. But we could add -m to create one…
User creation is done in https://github.com/mrmarkuz/nethserver-savapage/blob/master/nethserver-savapage.spec file:
%pre getent group savapage >/dev/null || groupadd -r savapage getent passwd savapage >/dev/null || \ useradd -r -g savapage -d /home/savapage -s /bin/bash \ -c "Savapage user" savapage exit 0
# remove savapage yum remove nethserver-savapage rm -Rf /opt/savapage /opt/savapageinstall # remove savapage user: userdel savapage rm -Rf /var/spool/mail/savapage /home/savapage # add User in same way as the RPM does: groupadd -r savapage useradd -r -g savapage -d /home/savapage -s /bin/bash -c "Savapage user" savapage
you are correct. no homedir needed (probably not wanted either…)
I found out that savapage isn’t installed fully, the service is missing for instance. So you have to execute
and go through the setup.
But although it is there now I am still not able to start the service, I don’t know why, database is there, db user is there, savapage system user/group is there. I’ll try to build nethserver-savapage in a way the services are included as next step. Maybe you can find what’s missing to start the savapage service meanwhile…
There is a non-interactive option when installing savapage: https://issues.savapage.org/view.php?id=763
Could that help when installing through rpm?
This is an amazing help, thanks…releasing an update asap.
It seems to work now, I can login but in red: Setup needed?
yum install http://markusneuberger.at/download/nethserver-savapage-0.0.1-3.ns7.x86_64.rpm
Added an application button
Pre Package extraction, Post finishing installation
cd root/opt/ && ./savapage-setup.bin -e
With -e parameter the package is extracted at the build process to include all the files.
During configuration process DB is created and savapage is installed as user savapage. I think the approach of @giacomo was to extract all files during build to have everything ready in the beginning.
I kept it but noticed that an installation as user savapage is mandatory. Installing from /opt/savapage to /opt/savapage didn’t work, so now savapage is installed from /opt/savapageinstaller to /opt/savapage which seems not very elegant but works.
Then your “-n” switch is used to install non-interactively as savapage user. Then root finishes with creating services. My next step is to change it to download savapage-installer.bin after package install process and do the savapage install via conf action script to keep the package small.
I don’t understand all db actions to the savapage db in this script, maybe you can help me here:
- Finishing config
- Some configuration db settings next to papersize?
- default config?
- Nethgui? Cockpit?
Oh wow! Looks amazing. How can I help? I will be happy to advertise this module
Thanks, it’s an early state so I’d say, let @robb test it a little bit. I don’t know much about SavaPage now. After testing and implementing some features @robb or others may suggest, we may open a Development/Testing (“nethserver-savapage needs testing”) thread. Heavy testers or SavaPage likers are able to test anytime and should just do it!
Have a look at the post installation config needs in the howto on our wiki. It describes what needs to be set (location, currency etc…)
Also it describes how NS Samba4 accountprovider can be used for SavaPage…
a HUGE thnx for the efoort this far @mrmarkuz!
Maybe one of the @dev_team can help with NethGUI to make it a real module?
I don’t know if we need so much Nethgui because it’s already usable via web interface as a NethServer application but we’ll see…
I’ll do that and report back, when there’s a new update…
The NethGUI integration will be very minor. In fact, it should be only a button to the SavaPage webinterface in the applications section. But it is needed since we want SavaPage module in NethServer-testing and ultimately in NethForge or even as a sub option for the official printerver module
I just fired up a new VM and will test your updated rpm.
btw, while you are busy, you can use the latest snapshot of the SavaPage installer: https://www.savapage.org/download/snapshots/savapage-setup-0.9.12-linux-x64.bin
It is more or less the RC for SavaPage v1.0
update: install went flawlessly! KUDOS KUDOS KUDOS to @mrmarkuz
Would it be better to use the snapshots or the installer in the package? Or in other words, are the snapshots stable enough?
The button is already there. Do you think we need other Nethgui configurable params?
Yes, the latest snapshot is stable enough… It does have some extra features, so it would be best to use this.
Things to do (as far as I can see)
configure NS Account provider for SavaPage (this will make a account provider (LDAP or Samba4) a dependency.
Change to PostgreSQL database: Apache derby database is an internal database. In situations you have even multiple users on 1 printer this can lock up your server since it is only for testing (in the sense of: ‘does it work’) purposes.
Thanks, with the latest snapshot I could finally login to savapage with pgsql as db backend!
I thought it works, but it was just Derby.
I can’t init the psql database…
[root@testserver ~]# su savapage -c "savapage-db --db-init" Starting ... Initializing database version  ... Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
I reached a milestone: I’ve gone through your howto again and the db connection to postgresql works now.
Now I have a working template I can build on.
Don’t know exactly what the problem was:
- database had wrong collation
- installing nethserver-postgresql as build-require sets a password for postgresql so the psql commands afterwards didn’t work non-interactively.
I hope I can release an update with working pgsql asap…
With these steps one can make a fresh 7.4 NS to a savapage server (also phppgadmin is installed to manage postgresql via web UI)
yum -y install http://mirror.de-labrusse.fr/NethServer/7/x86_64/nethserver-stephdl-1.0.6-1.ns7.sdl.noarch.rpm yum -y update yum -y install postgresql-server postgresql-contrib nethserver-cups nano which gzip strings perl java-1.8.0-openjdk-devel poppler-utils ImageMagick avahi-tools useradd -r savapage mkdir /opt/savapage chown savapage:savapage /opt/savapage grep -q -F "savapage" /etc/security/limits.conf || echo -e "savapage hard nofile 65535\nsavapage soft nofile 65535" >> /etc/security/limits.conf config set savapage service status enabled TCPPorts 8631,8632,8639,5353,5222 UDPPorts 8631,8632,8639,5353,5222 access green signal-event firewall-adjust echo a4 > /etc/papersize su savapage cd /opt/savapage wget https://www.savapage.org/download/snapshots/savapage-setup-0.9.12-linux-x64.bin chmod u+x savapage-setup-0.9.12-linux-x64.bin ./savapage-setup-0.9.12-linux-x64.bin -n exit /opt/savapage/MUST-RUN-AS-ROOT systemctl stop savapage su savapage -c "/opt/savapage/server/bin/linux-x64/savapage-db --db-export" postgresql-setup initdb sed -i 's/ident/md5/g' /var/lib/pgsql/data/pg_hba.conf sed -i 's/#password_encryption = on/password_encryption = on/g' /var/lib/pgsql/data/postgresql.conf systemctl restart postgresql su postgres -c "createuser savapage" su postgres -c psql alter user postgres with encrypted password 'POSTGRESSECRET'; alter user savapage with encrypted password 'SECRET'; \q su postgres -c "createdb -O savapage savapage" echo 'pathmunge /opt/savapage/server/bin/linux-x64/' > /etc/profile.d/savapage.sh chmod +x /etc/profile.d/savapage.sh sed -i 's/database.type=Internal/#database.type=Internal/g' /opt/savapage/server/server.properties sed -i 's/#database.type=PostgreSQL/database.type=PostgreSQL/g' /opt/savapage/server/server.properties sed -i 's/#database.driver=/database.driver=/g' /opt/savapage/server/server.properties sed -i 's/#database.url=/database.url=/g' /opt/savapage/server/server.properties sed -i 's/#database.user=/database.user=savapage/g' /opt/savapage/server/server.properties sed -i 's/#database.password=/database.password=SECRET/g' /opt/savapage/server/server.properties su savapage -c "/opt/savapage/server/bin/linux-x64/savapage-db --db-init" yum -y install nethserver-phppgadmin systemctl start savapage
I saw that savapage saves its config in the database, so we may use the db import/export function to provide some default settings. If we want more, we have to analyze how the savapage db is working and where the important values are saved. The AD/LDAP config is also stored in the DB.