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

Enabling systemd service doesn't make it auto start #8

Open
ghost opened this issue Feb 20, 2021 · 10 comments
Open

Enabling systemd service doesn't make it auto start #8

ghost opened this issue Feb 20, 2021 · 10 comments

Comments

@ghost
Copy link

ghost commented Feb 20, 2021

➜  ~ 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.

@hakavlad
Copy link
Owner

Did you try

sudo systemctl enable prelockd.service

Or did you try only systemctl start?

@hakavlad
Copy link
Owner

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.

@ghost
Copy link
Author

ghost commented Feb 21, 2021

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

@hakavlad
Copy link
Owner

Linux is magic.

systemd is magic

@hakavlad
Copy link
Owner

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

sudo journalctl -eu prelockd

@ghost
Copy link
Author

ghost commented Feb 21, 2021

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
Copy link
Author

ghost commented Feb 21, 2021

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
Copy link
Author

ghost commented Feb 21, 2021

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

@hakavlad
Copy link
Owner

hakavlad commented Feb 22, 2021

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

@mwat56
Copy link

mwat56 commented Oct 8, 2021

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´?

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