Skip to content
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

intelmq-manager start/stop does not work #42

Closed
aaronkaplan opened this issue Feb 25, 2015 · 11 comments
Closed

intelmq-manager start/stop does not work #42

aaronkaplan opened this issue Feb 25, 2015 · 11 comments

Comments

@aaronkaplan
Copy link
Member

Pressing Start/Stop in the Management tab does nothing.

Probably a permission problem?

@SYNchroACK
Copy link
Contributor

Yes, its a bug. What I do everytime i star the machine is:

mkdir /var/log/intelmq
mkdir /var/run/intelmq
chmod -R 700 /var/run/intelmq
chmod -R 700 /var/log/intelmq
chown -R intelmq.intelmq /var/run/intelmq
chown -R intelmq.intelmq /var/log/intelmq

chmod -R 770 /etc/intelmq/
chmod -R 700 /var/run/intelmq
chmod -R 700 /var/lib/intelmq
chmod -R 700 /usr/local/bin/intelmqctl
chmod -R 700 /var/log/intelmq

chown -R intelmq.intelmq /etc/intelmq/
chown -R intelmq.intelmq /var/run/intelmq
chown -R intelmq.intelmq /var/lib/intelmq
chown -R intelmq.intelmq /usr/local/bin/intelmqctl
chown -R intelmq.intelmq /var/log/intelmq

Of course, we need to commit a solution to do this automatically.

@aaronkaplan
Copy link
Member Author

Every time the VM reboots, the directories /var/run/ seems to be deleted.
Suggestion: if intelmqctl is triggered, it should check the permissions and folders.

@SYNchroACK
Copy link
Contributor

mkdir /var/run/intelmq
chmod -R 700 /var/run/intelmq
chown -R intelmq.intelmq /var/run/intelmq

@SYNchroACK
Copy link
Contributor

So, its a problem on 'intelmqctl'

@Th4nat0s
Copy link

I had issue only on "stop"... start is ok... could it been related ?

Traceback (most recent call last):
  File "/opt/intelmq/bin/intelmqctl", line 413, in <module>
    x.run()
  File "/opt/intelmq/bin/intelmqctl", line 184, in run
    results = call_method(self.args.bot_id)
  File "/opt/intelmq/bin/intelmqctl", line 233, in bot_stop
    res = self.__bot_stop(bot_id, pid)
  File "/opt/intelmq/bin/intelmqctl", line 242, in __bot_stop
    stop_process(pid)
  File "/opt/intelmq/bin/intelmqctl", line 112, in stop_process
    p.send_signal(signal.SIGINT)
  File "/usr/local/lib/python2.7/dist-packages/psutil-2.1.1-py2.7-linux-x86_64.egg/psutil/__init__.py", line 258, in wrapper
    return fun(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/psutil-2.1.1-py2.7-linux-x86_64.egg/psutil/__init__.py", line 986, in send_signal
    self._send_signal(sig)
  File "/usr/local/lib/python2.7/dist-packages/psutil-2.1.1-py2.7-linux-x86_64.egg/psutil/__init__.py", line 975, in _send_signal
    raise AccessDenied(self.pid, self._name)
psutil.AccessDenied: (pid=69718)

@sebix
Copy link
Member

sebix commented Aug 6, 2015

@Th4nat0s Does this issue still persist on current versions (v1.0-final branch of intelmq)?

@kralca
Copy link

kralca commented Dec 11, 2015

Today I have a similar problem. I can stop a bot in intelmq-manager, but I cannot start it. There are no errors in the logs, and I tracked it down to being a problem with running intelmqctl via sudo. For some reason that I cannot explain, the bot does not start when intelmqctl is run using the 'sudo -u intelmq' approach. You can very easily verify this for yourself. The bot starts fine if you 'sudo -iu intelmq' first and then run intelmqctl from the shell.

@kralca
Copy link

kralca commented Dec 11, 2015

This is related to #61. The problem is that the environment variable INTELMQ_PYTHON is not set when intelmq is run via 'sudo -u intelmq'. I have tested the following solution (Ubuntu 14.04.3). No doubt there are other ways to achieve the same result.

  1. add INTELMQ_PYTHON=/usr/bin/python3.4 to /etc/environment
  2. add Defaults env_file="/etc/environment" to sudoers using visudo

@sebix
Copy link
Member

sebix commented Dec 11, 2015

If INTELMQ_PYTHON is not set, the standard Python version is used (python), it is not necessary to run the software itself. This means that the bot was not able to start with Python 2.

@kralca
Copy link

kralca commented Dec 13, 2015

That makes sense. We are using the Python 3 version of intelmq as recommended in the installation. I changed the first line of intelmqctl to #!/usr/bin/env python3 to make things work on Ubuntu since python will be Python 2 for a while - see https://wiki.ubuntu.com/Python/3. Is there a better way to use intelmq with Python 3? Using an alias for python will not solve the issues above with intelmq-manager.

@sebix
Copy link
Member

sebix commented Sep 15, 2016

Duplicate of #69

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

No branches or pull requests

5 participants