New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed with result 'exit-code'. after building experimental fail2ban-0.10.x #1937

Closed
blub4747 opened this Issue Oct 24, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@blub4747

blub4747 commented Oct 24, 2017

Hi guys,

I build the above mentioned experimental branch fail2ban-0.10.x on my debian 9 box and it looks like if the building part went through without any problems.
however when I tried to setup fail2ban as a service #something# did not go through right.
And the service is refusing start up. can you guys please assist me ?
Thx
please let me know which bit of information you require.

thx,

We will be very grateful, if your problem was described as completely as possible,
enclosing excerpts from logs (if possible within DEBUG mode, if no errors evident
within INFO mode), and configuration in particular of effected relevant settings
(e.g., with fail2ban-client -d | grep 'affected-jail-name' for a particular
jail troubleshooting).
Thank you in advance for the details, because such issues like "It does not work"
alone could not help to resolve anything!
Thanks! (remove this paragraph and other comments upon reading)

Environment:

Fill out and check ([x]) the boxes which apply. If your Fail2Ban version is outdated,
and you can't verify that the issue persists in the recent release, better seek support
from the distribution you obtained Fail2Ban from

  • Fail2Ban version (including any possible distribution suffixes):
  • OS, including release name/version:
  • Fail2Ban installed via OS/distribution mechanisms
  • You have not applied any additional foreign patches to the codebase
  • Some customizations were done to the configuration (provide details below is so)

The issue:

Summary here

Steps to reproduce

tar xvfj fail2ban-0.10.tar.gz
cd fail2ban-0.10.0
python setup.py install

cp files/debian-initd /etc/init.d/fail2ban
update-rc.d fail2ban defaults
service fail2ban start

Expected behavior

Observed behavior

Ban Service
Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2017-10-24 18:34:19 JST; 15min ago
Docs: man:fail2ban(1)
Main PID: 531 (code=killed, signal=TERM)

Oct 24 18:34:19 atom-nuc systemd[1]: fail2ban.service: Control process exited, code=exited status=255
Oct 24 18:34:19 atom-nuc systemd[1]: Failed to start Fail2Ban Service.
Oct 24 18:34:19 atom-nuc systemd[1]: fail2ban.service: Unit entered failed state.
Oct 24 18:34:19 atom-nuc systemd[1]: fail2ban.service: Failed with result 'exit-code'.
Oct 24 18:34:19 atom-nuc systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart.
Oct 24 18:34:19 atom-nuc systemd[1]: Stopped Fail2Ban Service.
Oct 24 18:34:19 atom-nuc systemd[1]: fail2ban.service: Start request repeated too quickly.
Oct 24 18:34:19 atom-nuc systemd[1]: Failed to start Fail2Ban Service.
Oct 24 18:34:19 atom-nuc systemd[1]: fail2ban.service: Unit entered failed state.
Oct 24 18:34:19 atom-nuc systemd[1]: fail2ban.service: Failed with result 'exit-code'.

Any additional information

Configuration, dump and another helpful excerpts

Any customizations done to /etc/fail2ban/ configuration

Relevant parts of /var/log/fail2ban.log file:

preferably obtained while running fail2ban with loglevel = 4

Relevant lines from monitored log files in question:

@sebres

This comment has been minimized.

Show comment
Hide comment
@sebres

sebres Oct 24, 2017

Member

Can you start it with ?sudo? fail2ban-client start?
If also fails, try verbose variant using ?sudo? fail2ban-client -vvv start.
Any error messages? fail2ban.log?
Additionally please take a look to our wiki

Member

sebres commented Oct 24, 2017

Can you start it with ?sudo? fail2ban-client start?
If also fails, try verbose variant using ?sudo? fail2ban-client -vvv start.
Any error messages? fail2ban.log?
Additionally please take a look to our wiki

@blub4747

This comment has been minimized.

Show comment
Hide comment
@blub4747

blub4747 Oct 24, 2017

I actually ran the e service status command as root.
but of course if is not problem as try again as sudo.
Here is the result for the first command

sudo fail2ban-client start

[sudo] password for blub:
 Server already running`

And here for the second one 
` sudo fail2ban-client -vvv start
 +  110 7F2A7F8A0700 fail2ban.configreader     INFO  Loading configs for fail2ban under /etc/fail2ban
 +  111 7F2A7F8A0700 fail2ban.configreader     DEBUG Reading configs for fail2ban under /etc/fail2ban
 +  113 7F2A7F8A0700 fail2ban.configreader     DEBUG Reading config files: /etc/fail2ban/fail2ban.conf
 +  114 7F2A7F8A0700 fail2ban.configparserinc  INFO    Loading files: ['/etc/fail2ban/fail2ban.conf']
 +  115 7F2A7F8A0700 fail2ban.configparserinc  TRACE     Reading file: /etc/fail2ban/fail2ban.conf
 +  116 7F2A7F8A0700 fail2ban.configparserinc  INFO    Loading files: ['/etc/fail2ban/fail2ban.conf']
 +  117 7F2A7F8A0700 fail2ban.configparserinc  TRACE     Shared file: /etc/fail2ban/fail2ban.conf
 +  118 7F2A7F8A0700 fail2ban                  INFO  Using socket file /var/run/fail2ban/fail2ban.sock
 +  119 7F2A7F8A0700 fail2ban                  INFO  Using pid file /var/run/fail2ban/fail2ban.pid, [INFO] logging to /var/log/fail2ban.log
 +  120 7F2A7F8A0700 fail2ban                  HEAVY CMD: ['ping', 0.1]
 +  122 7F2A7F8A0700 fail2ban                  HEAVY OK : 'pong'
 +  123 7F2A7F8A0700 fail2ban                  ERROR Server already running
 +  124 7F2A7F8A0700 fail2ban                  DEBUG Exit with code -1

I hope this provided information will help,
thx

blub4747 commented Oct 24, 2017

I actually ran the e service status command as root.
but of course if is not problem as try again as sudo.
Here is the result for the first command

sudo fail2ban-client start

[sudo] password for blub:
 Server already running`

And here for the second one 
` sudo fail2ban-client -vvv start
 +  110 7F2A7F8A0700 fail2ban.configreader     INFO  Loading configs for fail2ban under /etc/fail2ban
 +  111 7F2A7F8A0700 fail2ban.configreader     DEBUG Reading configs for fail2ban under /etc/fail2ban
 +  113 7F2A7F8A0700 fail2ban.configreader     DEBUG Reading config files: /etc/fail2ban/fail2ban.conf
 +  114 7F2A7F8A0700 fail2ban.configparserinc  INFO    Loading files: ['/etc/fail2ban/fail2ban.conf']
 +  115 7F2A7F8A0700 fail2ban.configparserinc  TRACE     Reading file: /etc/fail2ban/fail2ban.conf
 +  116 7F2A7F8A0700 fail2ban.configparserinc  INFO    Loading files: ['/etc/fail2ban/fail2ban.conf']
 +  117 7F2A7F8A0700 fail2ban.configparserinc  TRACE     Shared file: /etc/fail2ban/fail2ban.conf
 +  118 7F2A7F8A0700 fail2ban                  INFO  Using socket file /var/run/fail2ban/fail2ban.sock
 +  119 7F2A7F8A0700 fail2ban                  INFO  Using pid file /var/run/fail2ban/fail2ban.pid, [INFO] logging to /var/log/fail2ban.log
 +  120 7F2A7F8A0700 fail2ban                  HEAVY CMD: ['ping', 0.1]
 +  122 7F2A7F8A0700 fail2ban                  HEAVY OK : 'pong'
 +  123 7F2A7F8A0700 fail2ban                  ERROR Server already running
 +  124 7F2A7F8A0700 fail2ban                  DEBUG Exit with code -1

I hope this provided information will help,
thx

@sebres

This comment has been minimized.

Show comment
Hide comment
@sebres

sebres Oct 24, 2017

Member

Did you see Server already running? This meant that the fail2ban is "already running" (or pid-/socket- files are still present). And as we see pong, this is really running and does answer.
As you installed it (upgrade?) was the previous fail2ban version down? (it is necessary).
Try to stop fail2ban via fail2ban-client stop.
Be sure you've not another python fail2ban process running...

And then try to start via service...

Member

sebres commented Oct 24, 2017

Did you see Server already running? This meant that the fail2ban is "already running" (or pid-/socket- files are still present). And as we see pong, this is really running and does answer.
As you installed it (upgrade?) was the previous fail2ban version down? (it is necessary).
Try to stop fail2ban via fail2ban-client stop.
Be sure you've not another python fail2ban process running...

And then try to start via service...

@blub4747

This comment has been minimized.

Show comment
Hide comment
@blub4747

blub4747 Oct 24, 2017

No I did not stop the previous version of fail2ban since I expected the previous version to be replace.
What I just did now was to run a

ps aux

for fail2ban and did a kill -9 on the pid.
after that I ran another
sudo service fail2ban status

which deli vert this output

fail2ban.service - Fail2Ban Service
   Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2017-10-24 22:36:13 JST; 2s ago
     Docs: man:fail2ban(1)
  Process: 3781 ExecStart=/usr/bin/fail2ban-client -x start (code=exited, status=255)
 Main PID: 531 (code=killed, signal=TERM)

Oct 24 22:36:12 atom-nuc systemd[1]: fail2ban.service: Control process exited, code=exited status=255
Oct 24 22:36:12 atom-nuc systemd[1]: Failed to start Fail2Ban Service.
Oct 24 22:36:12 atom-nuc systemd[1]: fail2ban.service: Unit entered failed state.
Oct 24 22:36:12 atom-nuc systemd[1]: fail2ban.service: Failed with result 'exit-code'.
Oct 24 22:36:13 atom-nuc systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart.
Oct 24 22:36:13 atom-nuc systemd[1]: Stopped Fail2Ban Service.
Oct 24 22:36:13 atom-nuc systemd[1]: fail2ban.service: Start request repeated too quickly.
Oct 24 22:36:13 atom-nuc systemd[1]: Failed to start Fail2Ban Service.
Oct 24 22:36:13 atom-nuc systemd[1]: fail2ban.service: Unit entered failed state.
Oct 24 22:36:13 atom-nuc systemd[1]: fail2ban.service: Failed with result 'exit-code'.

blub4747 commented Oct 24, 2017

No I did not stop the previous version of fail2ban since I expected the previous version to be replace.
What I just did now was to run a

ps aux

for fail2ban and did a kill -9 on the pid.
after that I ran another
sudo service fail2ban status

which deli vert this output

fail2ban.service - Fail2Ban Service
   Loaded: loaded (/lib/systemd/system/fail2ban.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2017-10-24 22:36:13 JST; 2s ago
     Docs: man:fail2ban(1)
  Process: 3781 ExecStart=/usr/bin/fail2ban-client -x start (code=exited, status=255)
 Main PID: 531 (code=killed, signal=TERM)

Oct 24 22:36:12 atom-nuc systemd[1]: fail2ban.service: Control process exited, code=exited status=255
Oct 24 22:36:12 atom-nuc systemd[1]: Failed to start Fail2Ban Service.
Oct 24 22:36:12 atom-nuc systemd[1]: fail2ban.service: Unit entered failed state.
Oct 24 22:36:12 atom-nuc systemd[1]: fail2ban.service: Failed with result 'exit-code'.
Oct 24 22:36:13 atom-nuc systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart.
Oct 24 22:36:13 atom-nuc systemd[1]: Stopped Fail2Ban Service.
Oct 24 22:36:13 atom-nuc systemd[1]: fail2ban.service: Start request repeated too quickly.
Oct 24 22:36:13 atom-nuc systemd[1]: Failed to start Fail2Ban Service.
Oct 24 22:36:13 atom-nuc systemd[1]: fail2ban.service: Unit entered failed state.
Oct 24 22:36:13 atom-nuc systemd[1]: fail2ban.service: Failed with result 'exit-code'.
@sebres

This comment has been minimized.

Show comment
Hide comment
@sebres

sebres Nov 26, 2017

Member

Fail2ban 0.9 should be stopped before upgrade to 0.10.

Member

sebres commented Nov 26, 2017

Fail2ban 0.9 should be stopped before upgrade to 0.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment