[systemd-devel] Restart SystemD service when Memory Usage in More than a threshold

Michal Koutný mkoutny at suse.com
Mon Sep 18 17:12:38 UTC 2023


Hello Ahmad.

On Sat, Sep 16, 2023 at 09:29:07PM +0600, Ahmad Ismail <ismail783 at gmail.com> wrote:
> The file in ~/.config/autostart which autostart the service is:
             ^^^

> So, I came up with a systemd service which will restart nemo-desktop when
> memory usage is 100MB.

Is the bug you mention a memory leak? (A restart at arbitrary moment
doesn't sound like the best user experience.)

Or is it another cause? Nevertheless, you may want to report it to
the respective upstream or upgrade to its latest version.

> sudo tee /etc/systemd/system/nemo-desktop-bug-workaround.service << END
                        ^^^^^^

> [Service]
> User=ismail
> Group=ismail
...
> ExecStart=/usr/bin/nemo-desktop
...
> What am I doing wrong here?

Maybe you conflate a system service (running with changed User=/Group=)
and a user instance service (spawned under user@$UID.service) and some
necessary settings are missing in the nemo-dektop's environment (I'm not
familiar with that particular program, hence a guess only).

HTH,
Michal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20230918/2133ee80/attachment.sig>


More information about the systemd-devel mailing list