prelockd icon indicating copy to clipboard operation
prelockd copied to clipboard

Enabling systemd service doesn't make it auto start

Open ghost opened this issue 4 years ago • 10 comments

➜  ~ systemctl status prelockd.service
● prelockd.service - Daemon that locks executables/libraries in memory
     Loaded: loaded (/usr/local/lib/systemd/system/prelockd.service; enabled; vendor preset: disabled)
     Active: inactive (dead)
       Docs: man:prelockd(8)
             https://github.com/hakavlad/prelockd

Manually systemctl start prelockd.service works, but it won't be started automatically on boot. The only thing I did was enabling this service, everything else stays untouched. Other enabled multi-user.target.wants services start when boot, only prelockd and nohang had this issue. (both have similar goal) Very annoying to reproduce as it requires a boot cycle. Occurs on both my laptop and desktop, both running openSUSE, this could be a distro issue but I was unable to look into this further, dmesg and journalctl shows nothing about the issue, it behaves as if the service was not enabled.

ghost avatar Feb 20 '21 18:02 ghost

Did you try

sudo systemctl enable prelockd.service

Or did you try only systemctl start?

hakavlad avatar Feb 20 '21 20:02 hakavlad

vendor preset: disabled

If you see a Vendor preset: Disabled, it means when the service first installs it will be disabled on start up and will have to be manually started.

hakavlad avatar Feb 20 '21 21:02 hakavlad

Did you try

sudo systemctl enable prelockd.service

Or did you try only systemctl start?

Yes, I followed the guide and executed sudo systemctl enable --now prelockd.service, didn't work, it does start the service as of execution but it won't auto start after reboot. I've also tried disabling it and reenabing, no luck. all the other systemd services don't have this issue, except this and nohang. I don't see any typo error in service file. Linux is magic. image

ghost avatar Feb 21 '21 04:02 ghost

Linux is magic.

systemd is magic

hakavlad avatar Feb 21 '21 05:02 hakavlad

How did you install it? What is in the journal?

sudo journalctl -eu prelockd

hakavlad avatar Feb 21 '21 05:02 hakavlad

I installed it with make install The following are done after rebooting

➜  ~ sudo journalctl -eu prelockd 
...
Feb 21 13:28:32 DESKTOP-G4KA9BY prelockd[6547]: currently locked 246.3M, 763 files
Feb 21 13:33:32 DESKTOP-G4KA9BY prelockd[6547]: currently locked 246.3M, 763 files
Feb 21 13:38:32 DESKTOP-G4KA9BY prelockd[6547]: currently locked 246.3M, 763 files
Feb 21 13:43:32 DESKTOP-G4KA9BY prelockd[6547]: currently locked 246.3M, 763 files
Feb 21 13:48:32 DESKTOP-G4KA9BY prelockd[6547]: currently locked 246.3M, 763 files
Feb 21 13:53:32 DESKTOP-G4KA9BY prelockd[6547]: currently locked 246.3M, 763 files
Feb 21 13:58:33 DESKTOP-G4KA9BY prelockd[6547]: currently locked 246.3M, 763 files
Feb 21 13:58:52 DESKTOP-G4KA9BY systemd[1]: Stopping Daemon that locks executables/libraries in memory...
Feb 21 13:58:52 DESKTOP-G4KA9BY prelockd[6547]: Got signal 15
Feb 21 13:58:52 DESKTOP-G4KA9BY prelockd[6547]: Unlocking files and dumping snapshots
Feb 21 13:58:52 DESKTOP-G4KA9BY prelockd[6547]: Uptime 6h 7min 4s, CPU time 2.96s (user 2.01s, sys 0.95s), avg 0.01%
Feb 21 13:58:52 DESKTOP-G4KA9BY prelockd[6547]: Exit.
Feb 21 13:58:52 DESKTOP-G4KA9BY systemd[1]: prelockd.service: Succeeded.
Feb 21 13:58:52 DESKTOP-G4KA9BY systemd[1]: Stopped Daemon that locks executables/libraries in memory.
lines 204-244/244 (END)
➜  ~ systemctl status prelockd.service
● prelockd.service - Daemon that locks executables/libraries in memory
     Loaded: loaded (/usr/local/lib/systemd/system/prelockd.service; enabled; vendor preset: disabled)
     Active: inactive (dead)
       Docs: man:prelockd(8)
             https://github.com/hakavlad/prelockd
➜  ~ systemctl start prelockd.service 
➜  ~ systemctl status prelockd.service
● prelockd.service - Daemon that locks executables/libraries in memory
     Loaded: loaded (/usr/local/lib/systemd/system/prelockd.service; enabled; vendor preset: disabled)
     Active: active (running) since Sun 2021-02-21 14:02:05 CST; 14s ago
       Docs: man:prelockd(8)
             https://github.com/hakavlad/prelockd
   Main PID: 7973 (python3)
      Tasks: 1 (limit: 1)
     CGroup: /unevictable.slice/prelockd.service
             └─7973 python3 /usr/local/sbin/prelockd -c /usr/local/etc/prelockd.conf
➜  ~ sudo journalctl -eu prelockd 
...
Feb 21 14:02:05 DESKTOP-G4KA9BY systemd[1]: Started Daemon that locks executables/libraries in memory.
Feb 21 14:02:06 DESKTOP-G4KA9BY prelockd[7973]: Starting prelockd with config /usr/local/etc/prelockd.conf
Feb 21 14:02:06 DESKTOP-G4KA9BY prelockd[7973]: currently locked 246.3M, 763 files

Feb 21 13:58:52 DESKTOP-G4KA9BY prelockd[6547]: Uptime 6h 7min 4s, CPU time 2.96s (user 2.01s, sys 0.95s), avg 0.01%
Feb 21 13:58:52 DESKTOP-G4KA9BY prelockd[6547]: Exit.
Feb 21 13:58:52 DESKTOP-G4KA9BY systemd[1]: prelockd.service: Succeeded.
Feb 21 13:58:52 DESKTOP-G4KA9BY systemd[1]: Stopped Daemon that locks executables/libraries in memory.
-- Reboot --
Feb 21 14:02:05 DESKTOP-G4KA9BY systemd[1]: Started Daemon that locks executables/libraries in memory.
Feb 21 14:02:06 DESKTOP-G4KA9BY prelockd[7973]: Starting prelockd with config /usr/local/etc/prelockd.conf
Feb 21 14:02:06 DESKTOP-G4KA9BY prelockd[7973]: currently locked 246.3M, 763 files
lines 208-248/248 (END)

ghost avatar Feb 21 '21 06:02 ghost

I reinstalled nohang using rpm and it now autostart correctly. I'm now trying to use rpm version of prelockd to see if it works

ghost avatar Feb 21 '21 06:02 ghost

ok rpm version of prelockd autostart without a problem. so perhaps the issue is with make install ?

ghost avatar Feb 21 '21 06:02 ghost

make install works fine with debian and fedora and no problems with autostart

hakavlad avatar Feb 22 '21 06:02 hakavlad

ok rpm version of prelockd autostart without a problem. so perhaps the issue is with make install ?

Did you do a ´diff´ between the RPM's installed files and those installed by ´make´?

mwat56 avatar Oct 08 '21 09:10 mwat56