CentOS 7 init.d/e2g service failing

175 views
Skip to first unread message

Mike K

unread,
Sep 8, 2015, 11:47:30 AM9/8/15
to e2guardian
I have had a usable e2guardian on several CentOS 6.5 and 6.6 servers with no problems. Now we're working on the newer CentOS 7.0 and 7.1 but running into an issue with the service/systemctl not actually starting e2g as a service, it fails.
Attached is the text file for our /etc/init.d/e2guardian which no longer works and we cannot find the little nuances with CentOS 7 to make the adjustments.

When trying "service e2guardian start" or "systemctl start e2guardian", it pauses for 5 minutes, before coming back with this error message:

Starting e2guardian (via systemctl):  Job for e2guardian.service failed. See 'systemctl status e2guardian.service' and 'journalctl -xn' for details.  [FAILED]

systemctl status e2guardian.service shows:
e2guardian.service - SYSV: e2guardian content filter.
   Loaded: loaded (/etc/rc.d/init.d/e2guardian)
   Active: failed (Result: timeout) since Tue 2015-09-08 10:26:10 CDT; 9min ago

Sep 08 10:20:54 GTWE1 e2guardian[2110]: Starting Web Content Filter (e2guardian):
Sep 08 10:20:54 GTWE1 systemd[1]: PID file /var/run/e2guardian not readable (yet?) after start.
Sep 08 10:26:10 GTWE1 systemd[1]: e2guardian.service operation timed out. Terminating.
Sep 08 10:26:10 GTWE1 systemd[1]: Failed to start SYSV: e2guardian content filter..
Sep 08 10:26:10 GTWE1 systemd[1]: Unit e2guardian.service entered failed state.


Squid 3.5.8 is active and running.

So what can be done to get this running properly? suggestions or ideas?

Thank you,
Mike

e2guardian.txt

Renato C. Pacheco

unread,
Sep 8, 2015, 12:04:08 PM9/8/15
to e2gua...@googlegroups.com
Mike,

I had this problem too and the last version of e2guardian, when you compile it, it has a script for systemd in e2guardian-3.2.0/data/scripts/e2guardian.service. Then, register this service with this:

# systemctl enable e2guardian.service

--
Renato Carneiro Pacheco
Certificado Linux LPIC-1
Pós-Graduado em Segurança em Redes de Computadores
Graduado em Redes de Comunicação
http://www.facebook.com/renatocarneirop

"Não acredite no que eu digo, pois é a minha experiência e não a sua. Experimente, indague e busque." - Osho Rajneesh

--
You received this message because you are subscribed to the Google Groups "e2guardian" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e2guardian+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike K

unread,
Sep 8, 2015, 3:30:58 PM9/8/15
to e2guardian
I tried that, it returns with

e2guardian.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig e2guardian on
The unit files have no [Install] section. They are not meant to be enabled
using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).


And trying either service start returns the same errors as mentioned already.

Mike

Mike K

unread,
Sep 8, 2015, 3:55:57 PM9/8/15
to e2guardian
And another error with the one from the script included with e2g 3.2.0:

[root@GTWE1 init.d]# systemctl status e2guardian.service
e2guardian.service
   Loaded: loaded (/etc/rc.d/init.d/e2guardian)
   Active: failed (Result: exit-code) since Tue 2015-09-08 14:52:32 CDT; 5s ago
  Process: 2461 ExecStart=/etc/rc.d/init.d/e2guardian start (code=exited, status=203/EXEC)

Sep 08 14:52:32 GTWE1 systemd[1]: e2guardian.service: control process exited, code=exited status=203
Sep 08 14:52:32 GTWE1 systemd[1]: Failed to start e2guardian.service.
Sep 08 14:52:32 GTWE1 systemd[1]: Unit e2guardian.service entered failed state.



Mike



On Tuesday, September 8, 2015 at 11:04:08 AM UTC-5, Renato Pacheco wrote:

Renato C. Pacheco

unread,
Sep 8, 2015, 4:35:13 PM9/8/15
to e2gua...@googlegroups.com
Mike,

Sorry. I hadn't payed attention about your distro (CentOS), 'cos mine is Debian. Did you try change owner of /var/run/e2guardian? Look at the message:


Sep 08 10:20:54 GTWE1 systemd[1]: PID file /var/run/e2guardian not readable (yet?) after start.

--
Renato Carneiro Pacheco
Certificado Linux LPIC-1
Pós-Graduado em Segurança em Redes de Computadores
Graduado em Redes de Comunicação
http://www.facebook.com/renatocarneirop

"Não acredite no que eu digo, pois é a minha experiência e não a sua. Experimente, indague e busque." - Osho Rajneesh

Mike K

unread,
Sep 9, 2015, 8:50:02 PM9/9/15
to e2guardian
I ended up going another way. Changed the e2guardianf1.conf to allow for it to run in the background, no need for a service. Now I check it in the morning to make sure it is running, and if not just use "/usr/sbin/e2guardian" and it starts right up and filters normally.

Mike

Mike K

unread,
Sep 10, 2015, 5:01:45 PM9/10/15
to e2guardian
Still trying to get it working, but even with all the requirements, the service aspect is still failing.

[root@GTWE1 init.d]# systemctl start e2guardian

Job for e2guardian.service failed. See 'systemctl status e2guardian.service' and 'journalctl -xn' for details.
[root@GTWE1 init.d]# systemctl status e2guardian.service
e2guardian.service
   Loaded: loaded (/etc/rc.d/init.d/e2guardian)
   Active: failed (Result: exit-code) since Thu 2015-09-10 15:46:06 CDT; 6s ago
  Process: 6711 ExecStart=/etc/rc.d/init.d/e2guardian start (code=exited, status=203/EXEC)

Sep 10 15:46:06 GTWE1 systemd[1]: e2guardian.service: control process exited, code=exited status=203
Sep 10 15:46:06 GTWE1 systemd[1]: Failed to start e2guardian.service.
Sep 10 15:46:06 GTWE1 systemd[1]: Unit e2guardian.service entered failed state.


Mike K

unread,
Sep 10, 2015, 5:52:59 PM9/10/15
to e2guardian
Issue is calling it as simply /usr/sbin/e2guardian starts it, or if it is running it will say "I seem to running already!".

I even did some digging with systemd and found more info so I tried a few setups but nothing is working.

[Unit]
Description=E2guardian Web filtering
After=network.target

[Service]
Type=forked
ExecStart=/usr/sbin/e2guardian
ExecStop=/usr/sbin/e2guardian -q
PIDFile=/var/run/e2guardian.pid
ExecReload=/usr/sbin/e2guardian -Q

[Install]
WantedBy=multi-user.target

Yet still the same problem. Would be nice to get this figured out before we're forced to roll a system out into production for customers.

Thank you,
Mike

Renato C. Pacheco

unread,
Sep 11, 2015, 2:29:04 PM9/11/15
to e2gua...@googlegroups.com
Mike,

Do you can run it manually? I suppose that your e2guardian has a problem at your config... check /var/log/syslog if there are errors about e2guardian.

--
Renato Carneiro Pacheco
Certificado Linux LPIC-1
Pós-Graduado em Segurança em Redes de Computadores
Graduado em Redes de Comunicação
http://www.facebook.com/renatocarneirop

"Não acredite no que eu digo, pois é a minha experiência e não a sua. Experimente, indague e busque." - Osho Rajneesh

Philip Pearce

unread,
Sep 14, 2015, 6:35:10 AM9/14/15
to e2guardian
Mike,

Try adding  'syslog.target squid.target' to the After =

Also check that PIDFile entry is same as pidfilename in e2guardian.conf


> Issue is calling it as simply /usr/sbin/e2guardian starts it, or if it is running it will say "I seem to running already!".

Why is this an issue?

Regards
Philip


Reply all
Reply to author
Forward
0 new messages