I installed the SERPOSCOPE program on my Ubuntu 18.04 server. It needs Java to work, so I installed OpenJDK :

$ sudo apt install openjdk-8-jdk
$ java -version

openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-8u191-b12-2ubuntu0.18.04.1-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

Here are the installation instructions. There is a comment about the Java folder but I did not understand what I had to do :

https://github.com/serphacker/serposcope

https://serposcope.serphacker.com/en/doc/install.html

The problem and there is a problem with Java and SERPOSCOPE refuses to start :

[email protected]:~$ sudo systemctl status serposcope
● serposcope.service - LSB: serposcope rank checker
   Loaded: loaded (/etc/init.d/serposcope; generated)
   Active: failed (Result: exit-code) since Sun 2019-05-12 16:06:15 CEST; 7s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 9785 ExecStart=/etc/init.d/serposcope start (code=exited, status=1/FAILURE)

May 12 16:06:15 serp-example-com systemd[1]: Starting LSB: serposcope rank checker...
May 12 16:06:15 serp-example-com serposcope[9785]: Can't find JAVA_HOME, java seems not installed on this OS
May 12 16:06:15 serp-example-com systemd[1]: serposcope.service: Control process exited, code=exited status=1
May 12 16:06:15 serp-example-com systemd[1]: serposcope.service: Failed with result 'exit-code'.
May 12 16:06:15 serp-example-com systemd[1]: Failed to start LSB: serposcope rank checker.


[email protected]:~$ journalctl -xe
May 12 16:06:02 serp-example-com groupadd[9636]: group added to /etc/gshadow: name=serposcope
May 12 16:06:02 serp-example-com groupadd[9636]: new group: name=serposcope, GID=1001
May 12 16:06:02 serp-example-com useradd[9641]: new user: name=serposcope, UID=111, GID=65534, home=/var/lib/serposcope, shell=/usr/sbin/
May 12 16:06:02 serp-example-com usermod[9647]: change user 'serposcope' password
May 12 16:06:02 serp-example-com chage[9652]: changed password expiry for serposcope
May 12 16:06:03 serp-example-com systemd[1]: Reloading.
May 12 16:06:03 serp-example-com systemd[1]: Reloading.
May 12 16:06:03 serp-example-com sudo[9593]: pam_unix(sudo:session): session closed for user root
May 12 16:06:07 serp-example-com sudo[9749]:   ubuntu : TTY=pts/0 ; PWD=/home/ubuntu ; USER=root ; COMMAND=/usr/sbin/ufw allow 7134
May 12 16:06:07 serp-example-com sudo[9749]: pam_unix(sudo:session): session opened for user root by ubuntu(uid=0)
May 12 16:06:08 serp-example-com sudo[9749]: pam_unix(sudo:session): session closed for user root
May 12 16:06:15 serp-example-com sudo[9782]:   ubuntu : TTY=pts/0 ; PWD=/home/ubuntu ; USER=root ; COMMAND=/bin/systemctl start serposcop
May 12 16:06:15 serp-example-com sudo[9782]: pam_unix(sudo:session): session opened for user root by ubuntu(uid=0)
May 12 16:06:15 serp-example-com systemd[1]: Starting LSB: serposcope rank checker...
-- Subject: Unit serposcope.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit serposcope.service has begun starting up.
May 12 16:06:15 serp-example-com serposcope[9785]: Can't find JAVA_HOME, java seems not installed on this OS
May 12 16:06:15 serp-example-com systemd[1]: serposcope.service: Control process exited, code=exited status=1
May 12 16:06:15 serp-example-com sudo[9782]: pam_unix(sudo:session): session closed for user root
May 12 16:06:15 serp-example-com systemd[1]: serposcope.service: Failed with result 'exit-code'.
May 12 16:06:15 serp-example-com systemd[1]: Failed to start LSB: serposcope rank checker.
-- Subject: Unit serposcope.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit serposcope.service has failed.
-- 
-- The result is RESULT.
May 12 16:06:18 serp-example-com kernel: [UFW BLOCK] IN=ens3 OUT= MAC=fa:16:3a:c8:b3:fc:0a:c5:39:6b:41:e2:08:00 SRC=185.10.68.55 DST=51.8
May 12 16:06:23 serp-example-com sudo[9813]:   ubuntu : TTY=pts/0 ; PWD=/home/ubuntu ; USER=root ; COMMAND=/bin/systemctl status serposco
May 12 16:06:23 serp-example-com sudo[9813]: pam_unix(sudo:session): session opened for user root by ubuntu(uid=0)
May 12 16:06:23 serp-example-com sudo[9813]: pam_unix(sudo:session): session closed for user root

[email protected]:~$ sudo JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64 systemctl status serposcope

● serposcope.service - LSB: serposcope rank checker
   Loaded: loaded (/etc/init.d/serposcope; generated)
   Active: failed (Result: exit-code) since Sun 2019-05-12 17:43:02 CEST; 9min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 10202 ExecStart=/etc/init.d/serposcope start (code=exited, status=1/FAILURE)

May 12 17:43:02 serp-example-com systemd[1]: Starting LSB: serposcope rank checker...
May 12 17:43:02 serp-example-com serposcope[10202]: Can't find JAVA_HOME, java seems not installed on this OS
May 12 17:43:02 serp-example-com systemd[1]: serposcope.service: Control process exited, code=exited status=1
May 12 17:43:02 serp-example-com systemd[1]: serposcope.service: Failed with result 'exit-code'.
May 12 17:43:02 serp-example-com systemd[1]: Failed to start LSB: serposcope rank checker.

1 Answers

0
Community On Best Solutions

First find out the location of Java home with update-java-alternatives -l (the last part is the path to remember).

Then run systemctl edit serposcope and this should open an editor. Add the following lines:

[Service]
Environment="JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64"

Where the value from JAVA_HOME is the one from the first point.

Try to start your service with sudo systemctl status serposcope