When I restart preload service when using ionice with -c3 parameter it sometimes fails with errors like: /etc/init.d/preload restart * Stopping preload ... [ ok ] * Starting preload ... * ionice'ing preload execvp: No such file or directory [ !! ] /etc/init.d/preload restart * Stopping preload ... [ ok ] * Starting preload ... * ionice'ing preload ioprio_set: No such process [ !! ] You can try to reproduce it (you need a bit of patience) executing "/etc/init.d/preload restart" really quickly, repeating it just after prompt returns a lot of times (sometimes only 2 attempts are needed, but other times, you will need to try >10 attempts) It seems to be easily workaround simply sleeping 1 sec Reproducible: Always
Created attachment 169724 [details, diff] preload.init-d.patch I add a sleep just before running ionice, it seems to work ok (at least for me) Thanks
Yea, rather annoying. I found that the pid changes after it is started. It must fork and then kill the parent or something? This is why I could not accomplish a PIDFILE technique. Kai, any ideas on the best way to do this?
Jeremy, as always with such behaving daemons and the start/stop daemon mechanism, it is required to run the daemon in foreground (so it does not detach and thus not fork) and let std do the backgrounding. Now you can let std create a pidfile. Have a look at the original init.d from my overlay to see how I did solve it. Additionally I found that on shutdown preload can take a long time to write its state file (especially when ionice'd). So please add a start-stop timeout to the stop function as I did it. Otherwise the shutdown process can kill preload while it is writing its state file. On the next boot preload doesn't start because the state file is corrupted then. All that caused me some headache, too. So let's not repeat it. ;-)
(In reply to comment #3) > Jeremy, > > as always with such behaving daemons and the start/stop daemon mechanism, it is > required to run the daemon in foreground (so it does not detach and thus not > fork) and let std do the backgrounding. Now you can let std create a pidfile. > > Have a look at the original init.d from my overlay to see how I did solve it. > Additionally I found that on shutdown preload can take a long time to write its > state file (especially when ionice'd). So please add a start-stop timeout to > the stop function as I did it. Otherwise the shutdown process can kill preload > while it is writing its state file. On the next boot preload doesn't start > because the state file is corrupted then. > > All that caused me some headache, too. So let's not repeat it. ;-) > I literally copied you ssd arguments and got this: %% sudo /etc/init.d/preload start preload | * Starting preload ... [ ok ] %% ps aux|grep preload root 15066 0.2 0.0 9972 1716 ? SNs 17:42 0:00 /usr/sbin/preload -l /var/log/preload.log -V 4 -n 15 -s /var/lib/preload/preload.state %% cat /var/run/preload.pid 15063 It's not the same pid...
Argh! :-( Well it used to work some time ago. Will check it...
Jeremy, > /usr/sbin/preload -l /var/log/preload.log -V 4 -n 15 \ > -s /var/lib/preload/preload.state Where's the -f switch gone?
(In reply to comment #6) > Where's the -f switch gone? Dang. Fixed now, you will see a shiny -r5 when you next sync. Hopefully this is the last fix needed =/ Thanks for reporting and thanks for helping.
Thanks a lot to you and kai for the great support :-)