NethServer-SavaPage module

I’ve been wanting this particular module for a long time. IMO SavaPage is a killer application if it comes to print management. Especially if it is pure printing: no interactions on the printer itself, just managing printjobs.
I wrote a detailed howto on installing SavaPage on NethServer, but if it comes to real integration we need to make an (official) module for it to be installed on top of the nethserver-cups printserver module.

I have tried to create a module, but since I am not a developer, I just get it done. So I would like to do an urgent request to the rest of our community if someone is willing to spend some time on it. I can help in ways of testing and give application specific directions. I also can think out loud in discussions about possible solutions and I am in direct contact with the developer of SavaPage, so I can ask him questions so we can make this a great addition for NethServer.
Anyone available to help?

8 Likes

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 Likes

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?

1 Like

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

2 Likes

Sorry @robb, I couldn’t get savapage to work for now, but won’t give up, just tired :sleeping:

[savapage@testserver savapage]$ savapage-db --db-init
Starting ...
Initializing database version [1] ...
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[1]: Starting SavaPage Open Print Portal...
Dec 09 00:43:08 testserver.domain.local su[49454]: (to savapage) root on none
Dec 09 00:43:08 testserver.domain.local app-server[49429]: Starting SavaPage Open Print Portal   started PID=49456
Dec 09 00:43:08 testserver.domain.local systemd[1]: Started SavaPage Open Print Portal.
Dec 09 00:43:08 testserver.domain.local systemd[1]: savapage.service: main process exited, code=exited, status=1/FAILURE
Dec 09 00:43:08 testserver.domain.local app-server[49468]: SavaPage Open Print Portal is not running
Dec 09 00:43:08 testserver.domain.local systemd[1]: Unit savapage.service entered failed state.
Dec 09 00:43:08 testserver.domain.local systemd[1]: 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… :slight_smile:
btw, the http status 500 on webtop is not necessarily because of savapage. See WebTop HTTP Status 500 - #9 by robb

/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:

savapage:x:994:991:Savapage user:/opt/savapage:/sbin/nologin

While it should be:

savapage:x:994:991::/home/savapage:/bin/bash
(taken from manual installed server)

Also homedir is not created correctly.

1 Like

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…

For explanation:

User creation is done in nethserver-savapage/nethserver-savapage.spec at master · mrmarkuz/nethserver-savapage · GitHub 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

Testing helpers:

# 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
1 Like

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?

2 Likes

This is an amazing help, thanks…releasing an update asap.

Update:

It seems to work now, I can login but in red: Setup needed?

Install Link:

yum install http://markusneuberger.at/download/nethserver-savapage-0.0.1-3.ns7.x86_64.rpm

Added an application button

root/usr/share/nethesis/NethServer/Module/Dashboard/Applications/Savapage.php

nethserver-savapage/root/usr/share/nethesis/NethServer/Module/Dashboard/Applications/Savapage.php at master · mrmarkuz/nethserver-savapage · GitHub

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:

root/etc/e-smith/events/actions/nethserver-savapage-conf

nethserver-savapage/root/etc/e-smith/events/actions/nethserver-savapage-conf at master · mrmarkuz/nethserver-savapage · GitHub

Next steps:

  • Testing
  • Finishing config
  • Some configuration db settings next to papersize?
  • default config?
  • Nethgui? Cockpit?
3 Likes

Oh wow! Looks amazing. How can I help? I will be happy to advertise this module

1 Like

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!

1 Like

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…

2 Likes

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

1 Like

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?

1 Like

Yes, the latest snapshot is stable enough… :slight_smile: 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.

2 Likes

Thanks, with the latest snapshot I could finally login to savapage with pgsql as db backend! :sunglasses:

I thought it works, but it was just Derby. :unamused:

I can’t init the psql database…

[root@testserver ~]# su savapage -c "savapage-db --db-init"
Starting ...
Initializing database version [1] ...
Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]