[SailfishDevel] Keeping background process running in Sailfish OS

Martin Grimme martin.grimme at gmail.com
Sun May 3 11:43:49 UTC 2015


Hi,

2015-05-03 13:09 GMT+02:00, Andrey Kozhevnikov <coderusinbox at gmail.com>:
> afaik it only closing propcesses with windows, no?

No, it is the Linux OOM handler, which does not care or know about
what a Wayland window is.
If your daemon is invoked as a systemd service, you can adjust the
OOMScore in the system .service file of the daemon, like this:

  [Service]
  ExecStart=/usr/sbin/mydaemon
  OOMScoreAdjust=-250

The lower the value the less likely the process will be selected by
the OOM killer.
However, if you want to remain harbour-compatible, you cannot run the
daemon as a systemd service. In that case maybe you can write the
score directly at runtime to

  /proc/<your process pid>/oom_score_adj

but I did not test that solution.


Martin


More information about the Devel mailing list