Re: Cannot start service, initgroups(gotify,365): Operation not permitted

From: Matthias Fechner <idefix_at_fechner.net>
Date: Sun, 13 Oct 2024 04:41:45 UTC
Am 12.10.2024 um 11:37 schrieb Ronald Klop:
> sh -x /usr/local/etc/rc.d/gotify_server start
>
> Are your sure you ran 'service gotify_server start' as root?
> The man pages say that iinitgroups can only return EPERM via a call to 
> setgroups when not run as root.

thanks for the tip with sh -x, that made the problem visible.

I changed now this line:
command_args="-f -P ${pidfile} %%PREFIX%%/bin/gotify-server 
${gotify_server_args}"

This causes the execution of:
+ eval $' limits -C daemon  su -m gotify -c \'sh -c " /usr/sbin/daemon  
-f -P /var/run/gotify_server.pid /usr/local/bin/gotify-server "\''
+ limits -C daemon su -m gotify -c 'sh -c " /usr/sbin/daemon  -f -P 
/var/run/gotify_server.pid /usr/local/bin/gotify-server "'

which is exactly what I want.
The binary is now executed. There is no need to give a -u flag to daemon.

Gruß
Matthias

-- 

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the universe trying to
produce bigger and better idiots. So far, the universe is winning." --
Rich Cook