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

systemctl stop autopweroff does not kill the process #37

Closed
it-jonas opened this issue Sep 27, 2022 · 1 comment
Closed

systemctl stop autopweroff does not kill the process #37

it-jonas opened this issue Sep 27, 2022 · 1 comment
Assignees

Comments

@it-jonas
Copy link

If autopoweroff is stopped by systemctl stop autopoweroff the deamon stops but the process keeps running.
See here:

jonas@pc-test:~$ ps -aux | grep [a]utopoweroff
jonas@pc-test:~$ sudo systemctl start autopoweroff.service 
jonas@pc-test:~$ sudo systemctl status autopoweroff.service 
● autopoweroff.service - LSB: Start daemon at boot time
     Loaded: loaded (/etc/init.d/autopoweroff; generated)
     Active: active (running) since Tue 2022-09-27 18:33:21 CEST; 6s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 24388 ExecStart=/etc/init.d/autopoweroff start (code=exited, status=0/SUCCESS)
      Tasks: 12 (limit: 4566)
     Memory: 9.2M
        CPU: 153ms
     CGroup: /system.slice/autopoweroff.service
             └─24395 python3 /usr/sbin/autopoweroffd

Sep 27 18:33:21 pc-test systemd[1]: Starting LSB: Start daemon at boot time...
Sep 27 18:33:21 pc-test autopoweroff[24388]:  * Starting Autopoweroff...
Sep 27 18:33:21 pc-test autopoweroff[24388]:    ...done.
Sep 27 18:33:21 pc-test systemd[1]: Started LSB: Start daemon at boot time.
Sep 27 18:33:21 pc-test autopoweroffd[24395]: Autopoweroff started with PID '24395'.
Sep 27 18:33:21 pc-test autopoweroffd[24395]: Reading configuration file:  /etc/autopoweroff/autopoweroff.conf
Sep 27 18:33:21 pc-test autopoweroffd[24395]: Command to execute when all conditions are met:  /usr/sbin/alt_hibernation.sh
Sep 27 18:33:22 pc-test autopoweroffd[24395]: Startup sleep of 5 minutes.
jonas@pc-test:~$ ps -aux | grep [a]utopoweroff
root       24395  0.4  0.3 836716 14992 ?        Sl   18:33   0:00 python3 /usr/sbin/autopoweroffd
jonas@pc-test:~$ sudo systemctl stop autopoweroff.service 
jonas@pc-test:~$ ps -aux | grep [a]utopoweroff
root       24395  0.2  0.3 836716 14992 ?        Sl   18:33   0:00 python3 /usr/sbin/autopoweroffd
jonas@pc-test:~$ sudo cat /var/run/autopoweroff/autopoweroff.pid
11300jonas@pc-test:~$ 
jonas@pc-test:~$ for psid in $(ps -aux | grep [a]utopoweroff | awk '{print $2}'); do kill -9 $psid; done
-bash: kill: (24395) - Vorgang nicht zulässig
jonas@pc-test:~$ for psid in $(ps -aux | grep [a]utopoweroff | awk '{print $2}'); do sudo kill -9 $psid; done

I fixed it with a dirty workaround by adding a line to the /etc/init.d/autopoweroff:

  for psid in $(ps -aux | grep [a]utopoweroff | awk '{print $2}'); do kill -9 $psid; done
@it-jonas it-jonas mentioned this issue Sep 27, 2022
@deragon deragon self-assigned this Sep 30, 2022
@deragon
Copy link
Owner

deragon commented Sep 30, 2022

Thanks @it-jonas. This is duplicate of #19. Please follow that one.

@deragon deragon closed this as not planned Won't fix, can't repro, duplicate, stale Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants