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

Always detecting ssh.service as service to restart #52

Closed
micw opened this issue Dec 9, 2016 · 4 comments
Closed

Always detecting ssh.service as service to restart #52

micw opened this issue Dec 9, 2016 · 4 comments
Assignees
Labels

Comments

@micw
Copy link

micw commented Dec 9, 2016

Hi,

I use needrestart on jessie from jessie-backports. I have the problem that ssh.service is always detected, e.g.:
[main] #9761 exe => /usr/bin/lxc-start
[main] #9761 is ssh.service

[main] #4166 exe => /usr/lib/jvm/java-8-oracle/bin/java
[Core] #4166 is a NeedRestart::Interp::Java
[Core] #4166 source is UNKNOWN
[main] #4166 is ssh.service

@liske liske self-assigned this Dec 10, 2016
@liske liske added the bug label Dec 10, 2016
@liske
Copy link
Owner

liske commented Dec 10, 2016

Hi,

does the system runs with systemd? Could you please provide the content of /proc/9761/cgroup? Could you give needrestart 2.10 from stretch a try?

@Korni22
Copy link

Korni22 commented Jan 5, 2017

Hi,

here is the output from my machine, since I have the same problem, this might help you 😊

[main] #2491 exe => /usr/bin/screen-4.4.0
[main] #2491 is sshd.service
[main] #2492 exe => /usr/bin/zsh
[main] #2492 is sshd.service
[main] #3776 exe => /usr/bin/screen-4.4.0
[main] #3776 is sshd.service
[main] #3777 exe => /usr/bin/zsh
[main] #3777 is sshd.service
[main] #10556 exe => /usr/bin/screen-4.4.0
[main] #10556 is sshd.service
[main] #10562 exe => /usr/bin/bash
[main] #10562 is sshd.service
[main] #29337 exe => /usr/bin/screen-4.4.0
[main] #29337 is sshd.service
n
user@host ~ $ cat /proc/2491/cgroup
9:net_cls:/
8:cpuset:/
7:blkio:/
6:devices:/system.slice/sshd.service
5:cpu,cpuacct:/
4:memory:/
3:freezer:/
2:pids:/system.slice/sshd.service
1:name=systemd:/system.slice/sshd.service
user@host ~ $ cat /proc/2492/cgroup
9:net_cls:/
8:cpuset:/
7:blkio:/
6:devices:/system.slice/sshd.service
5:cpu,cpuacct:/
4:memory:/
3:freezer:/
2:pids:/system.slice/sshd.service
1:name=systemd:/system.slice/sshd.service
user@host ~ $ cat /proc/3776/cgroup
9:net_cls:/
8:cpuset:/
7:blkio:/
6:devices:/system.slice/sshd.service
5:cpu,cpuacct:/
4:memory:/
3:freezer:/
2:pids:/system.slice/sshd.service
1:name=systemd:/system.slice/sshd.service
user@host ~ $ cat /proc/3777/cgroup
9:net_cls:/
8:cpuset:/
7:blkio:/
6:devices:/system.slice/sshd.service
5:cpu,cpuacct:/
4:memory:/
3:freezer:/
2:pids:/system.slice/sshd.service
1:name=systemd:/system.slice/sshd.service
user@host ~ $ cat /proc/10556/cgroup
9:net_cls:/
8:cpuset:/
7:blkio:/
6:devices:/system.slice/sshd.service
5:cpu,cpuacct:/
4:memory:/
3:freezer:/
2:pids:/system.slice/sshd.service
1:name=systemd:/system.slice/sshd.service
user@host ~ $ cat /proc/10562/cgroup
9:net_cls:/
8:cpuset:/
7:blkio:/
6:devices:/system.slice/sshd.service
5:cpu,cpuacct:/
4:memory:/
3:freezer:/
2:pids:/system.slice/sshd.service
1:name=systemd:/system.slice/sshd.service
user@host ~ $ cat /proc/29337/cgroup
9:net_cls:/
8:cpuset:/
7:blkio:/
6:devices:/system.slice/sshd.service
5:cpu,cpuacct:/
4:memory:/
3:freezer:/
2:pids:/system.slice/sshd.service
1:name=systemd:/system.slice/sshd.service

I installed needrestart from the AUR, which seems to be version 2.10-1, but needrestart --version tells me its needrestart 2.9 - Restart daemons after library updates. 🤔

@liske
Copy link
Owner

liske commented Jan 14, 2017

@Korni22: do you use systemd's PAM module (libpam-systemd on Debian)? The content of the cgroup files shows that your screen instances are part of the sshd.service. If the systemd PAM module is used the user's processes should be part of a user session:

$ ssh localhost
$ cat /proc/$$/cgroup
10:freezer:/
9:cpuset:/
8:devices:/user.slice/user-1000.slice
7:perf_event:/
6:net_cls,net_prio:/
5:pids:/user.slice/user-1000.slice/session-309219.scope
4:memory:/user.slice/user-1000.slice
3:blkio:/user.slice/user-1000.slice
2:cpu,cpuacct:/user.slice/user-1000.slice
1:name=systemd:/user.slice/user-1000.slice/session-309219.scope

Without the systemd PAM module needrestart is unable to detect user sessions.

PS: There was a bug showing the wrong version number in the needrestart 2.10 release.

@Korni22
Copy link

Korni22 commented Jan 14, 2017

@liske it seems that Arch Linux does not use libpam-systemd, so I'm out of luck, but thanks for your help!

liske added a commit that referenced this issue Jan 14, 2017
…md is used without PAM integration (closes issue #52).
@liske liske closed this as completed Jan 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants