You are not logged in.

#1 2024-09-16 19:17:06

arbitarycounterfactual
Member
Registered: 2024-07-17
Posts: 20

Run service for seperate user in current session with systemctl --user

I pulled from the latest upstream of searx and went by the official docs for a quick lazy set-up. The installation guide prompts me to isolate searx to a separate user and build and install searx in that user's environment. 

I want management of the instance server to be passed onto systemd, but to do so without invoking superuser. I'm looking at systemctl --user. I've added the User= and Group= directives  (both of them are set to the literal name of the user, "searx" for
this instance, not %I).

grep searx /etc/passwd 
searx:x:955:955::/usr/local/searx:/bin/bash

The searx.service is put under /usr/lib/systemd/system. Although the process starts under "searx", it requires invoking superuser to manage the service.

I'm looking to find out if it's possible to lay .service(s) in systemd/user/, where processes that require resources owned by a separate user can be launched by systemctl --user without superuser in current session. What motivates me towards this is perhaps https://bbs.archlinux.org/viewtopic.php … 1#p1264871 comment given I understood its objective correctly (although the parent thread is slightly on a different topic).

In summery, what I want:

1. Manage searx with systemd 
2. Manage searx with current user session.

If my direction of tackling this is not possible or does not make sense, I would appreciate any reference conversely to something which makes this (somewhat) possible.

Offline

#2 2024-09-25 03:37:38

shreven
Member
Registered: 2024-09-25
Posts: 1
Website

Re: Run service for seperate user in current session with systemctl --user

Searx is no longer maintained, use SearXNG instead. They have documentation on daemonizing with uWSGI, which can be started by systemd. If it's running as a dedicated searxng user, systemctl --user would still require you to be logged in as that user, not your regular one (requiring either root or that user's password). You might want to configure sudo/doas to allow you to restart it without your password instead.

Offline

Board footer

Powered by FluxBB