-2

I am using a SLES 12 VM where I have installed a service called as besclient using an RPM. When I uninstall the agent and remove the files the status of the service still shows ac active. I checked and found these 2 files still remain.

/sys/fs/cgroup/pids/system.slice/besclient.service
/sys/fs/cgroup/systemd/system.slice/besclient.service

which I am unable to remove using rm -rf command. How to remove these kind of files?

rm: cannot remove '/sys/fs/cgroup/pids/system.slice/besclient.service/tasks': Operation not permitted

I am running this as root.

codec
  • 7,978
  • 26
  • 71
  • 127
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww May 15 '18 at 23:03

2 Answers2

0

The /sys filesystem provides a filesystem-like view on information and config settings of the kernel. I.e., these are not "really" files, that is why you cannot delete them.

DevSolar
  • 67,862
  • 21
  • 134
  • 209
0

Persistent cgroups are released when the unit is disabled and its configuration file is deleted by running:

~]# systemctl disable name.service

where name stands for the name of the service to be disabled.

Red Hat reference

Apparently something is still running. Try: cat /sys/fs/cgroup/pids/system.slice/besclient.service/tasks to see if you can find a process PID.

Gerrit
  • 861
  • 6
  • 11
  • `deehdss013ccp:~/chefrepolocalmode # cat /sys/fs/cgroup/pids/system.slice/besclient.service/pids.current 0 ` – codec May 15 '18 at 14:44
  • This is after disabling the service. Also when I check status of the service service besclient status â besclient.service - Besclient Daemon Loaded: loaded (/usr/lib/systemd/system/besclient.service; disabled; vendor preset: disabled) Active: active (exited) since Tue 2018-05-15 12:27:13 UTC; 2h 17min ago Main PID: 10687 (code=exited, status=0/SUCCESS) Tasks: 0 (limit: 512) CGroup: /system.slice/besclient.service May 15 12:27:13 deehdss013ccp systemd[1]: Started Besclient Daemon. May 15 12:30:15 deehdss013ccp systemd[1]: Started Besclient Daemon. – codec May 15 '18 at 14:44
  • Try `systemd-cgls` – Gerrit May 15 '18 at 14:46
  • No output `systemd-cgls | grep bes` – codec May 15 '18 at 14:48
  • Did you try a `systemctl daemon-reload`? – Gerrit May 15 '18 at 14:57